You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rz...@apache.org on 2017/02/17 22:56:39 UTC

[01/51] [abbrv] ambari git commit: AMBARI-19795 Ambari upgrade to not add ranger plugin configs under ranger plugin supported services (mugdha)

Repository: ambari
Updated Branches:
  refs/heads/branch-feature-BUG-74026 [created] 626d4348e


http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-security.xml
index 3c0b29f..562684b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-security.xml
@@ -23,19 +23,19 @@
     <name>ranger.plugin.yarn.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing policies for this Yarn instance</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.yarn.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.yarn.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -47,18 +47,18 @@
     <name>ranger.plugin.yarn.policy.rest.ssl.config.file</name>
     <value>/etc/hadoop/conf/ranger-policymgr-ssl-yarn.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.yarn.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.yarn.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-audit.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-audit.xml
index efeea5f..0044680 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-audit.xml
@@ -24,7 +24,7 @@
     <name>xasecure.audit.is.enabled</name>
     <value>true</value>
     <description>Is Audit enabled?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -41,7 +41,7 @@
         <name>xasecure.audit.destination.hdfs</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -54,14 +54,14 @@
         <name>xasecure.audit.destination.hdfs.dir</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
     <value>/var/log/atlas/audit/hdfs/spool</value>
     <description>/var/log/atlas/audit/hdfs/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -78,7 +78,7 @@
         <name>xasecure.audit.destination.solr</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -94,7 +94,7 @@
         <name>ranger.audit.solr.urls</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -107,14 +107,14 @@
         <name>ranger.audit.solr.zookeepers</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>xasecure.audit.destination.solr.batch.filespool.dir</name>
     <value>/var/log/atlas/audit/solr/spool</value>
     <description>/var/log/atlas/audit/solr/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -125,7 +125,7 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml
index 977127c..fd623cb 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml
@@ -26,7 +26,7 @@
     <display-name>Policy user for Atlas</display-name>
     <description>This user must be system user and also present at Ranger
       admin portal</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -36,7 +36,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -54,7 +54,7 @@
       <type>boolean</type>
       <overridable>false</overridable>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -63,7 +63,7 @@
     <display-name>Ranger repository config user</display-name>
     <description>Used for repository creation on ranger admin
     </description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -76,55 +76,7 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
 </configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-policymgr-ssl.xml
index 349c829..dcffb63 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-policymgr-ssl.xml
@@ -24,7 +24,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/atlas-server/conf/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -35,14 +35,14 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/atlas-server/conf/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
@@ -53,21 +53,21 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
     <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java keystore credential file</description>
-      <on-ambari-upgrade add="true"/>
+      <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
 </configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-security.xml
index c5588d1..8fac342 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/ATLAS/configuration/ranger-atlas-security.xml
@@ -23,21 +23,21 @@
     <name>ranger.plugin.atlas.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing Atlas policies</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>ranger.plugin.atlas.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>ranger.plugin.atlas.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -50,28 +50,28 @@
     <name>ranger.plugin.atlas.policy.rest.ssl.config.file</name>
     <value>/usr/hdp/current/atlas-server/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>ranger.plugin.atlas.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>ranger.plugin.atlas.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
   <property>
     <name>xasecure.add-hadoop-authorization</name>
     <value>true</value>
     <description>Enable/Disable the default hadoop authorization (based on rwxrwxrwx permission on the resource) if Ranger Authorization fails.</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 
 </configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.5/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HBASE/configuration/ranger-hbase-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
deleted file mode 100644
index 3450970..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * 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.
- */
--->
-<configuration>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.5/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
index 953e42e..77f7be2 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
@@ -26,54 +26,6 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true" />
-  </property>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false" />
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-plugin-properties.xml
deleted file mode 100644
index 3450970..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-plugin-properties.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * 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.
- */
--->
-<configuration>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-security.xml
index 640234b..1d1b0c2 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/ranger-hive-security.xml
@@ -23,6 +23,6 @@
     <name>ranger.plugin.hive.policy.rest.ssl.config.file</name>
     <value>/usr/hdp/current/{{ranger_hive_component}}/conf/conf.server/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.5/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml
deleted file mode 100644
index 3450970..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * 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.
- */
--->
-<configuration>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.5/services/KNOX/configuration/ranger-knox-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/KNOX/configuration/ranger-knox-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/KNOX/configuration/ranger-knox-plugin-properties.xml
deleted file mode 100644
index 3450970..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/KNOX/configuration/ranger-knox-plugin-properties.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * 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.
- */
--->
-<configuration>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
index 21658e7..5672f04 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
@@ -23,12 +23,12 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/storm-client/conf/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/storm-client/conf/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-security.xml
index 8a3dd2e..f3d7530 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/STORM/configuration/ranger-storm-security.xml
@@ -23,6 +23,6 @@
     <name>ranger.plugin.storm.policy.rest.ssl.config.file</name>
     <value>/usr/hdp/current/storm-client/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/ranger-yarn-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/ranger-yarn-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/ranger-yarn-plugin-properties.xml
deleted file mode 100644
index 3450970..0000000
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/YARN/configuration/ranger-yarn-plugin-properties.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * 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.
- */
--->
-<configuration>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml
new file mode 100644
index 0000000..d8885e5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/ATLAS/configuration/ranger-atlas-plugin-properties.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/configuration/ranger-hbase-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
new file mode 100644
index 0000000..d8885e5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.6/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
new file mode 100644
index 0000000..6e93879
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/ranger-hive-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/ranger-hive-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/ranger-hive-plugin-properties.xml
new file mode 100644
index 0000000..d8885e5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/ranger-hive-plugin-properties.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.6/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml
new file mode 100644
index 0000000..d8885e5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/KAFKA/configuration/ranger-kafka-plugin-properties.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.6/services/KNOX/configuration/ranger-knox-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/KNOX/configuration/ranger-knox-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/KNOX/configuration/ranger-knox-plugin-properties.xml
new file mode 100644
index 0000000..d8885e5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/KNOX/configuration/ranger-knox-plugin-properties.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/configuration/ranger-storm-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/configuration/ranger-storm-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/configuration/ranger-storm-plugin-properties.xml
new file mode 100644
index 0000000..d8885e5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/STORM/configuration/ranger-storm-plugin-properties.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/ranger-yarn-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/ranger-yarn-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/ranger-yarn-plugin-properties.xml
new file mode 100644
index 0000000..d8885e5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/ranger-yarn-plugin-properties.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration>
+
+  <property>
+    <name>external_admin_username</name>
+    <value></value>
+    <display-name>External Ranger admin username</display-name>
+    <description>Add ranger default admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_admin_password</name>
+    <value></value>
+    <display-name>External Ranger admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_username</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin username</display-name>
+    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
+    <value-attributes>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+  <property>
+    <name>external_ranger_admin_password</name>
+    <value></value>
+    <display-name>External Ranger Ambari admin password</display-name>
+    <property-type>PASSWORD</property-type>
+    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
+    <value-attributes>
+      <type>password</type>
+      <empty-value-valid>true</empty-value-valid>
+    </value-attributes>
+    <on-ambari-upgrade add="false"/>
+  </property>
+
+</configuration>
\ No newline at end of file


[46/51] [abbrv] ambari git commit: AMBARI-19879. Updating yarn-env and hadoop-env templates with ZK secure options on stack upgrade (Attila Magyar via magyari_sandor)

Posted by rz...@apache.org.
AMBARI-19879. Updating yarn-env and hadoop-env templates with ZK secure options on stack upgrade (Attila Magyar via magyari_sandor)

(cherry picked from commit 8ef31458a989dec5fb2b7f35223dd689fdeaba7b)

Change-Id: I4f77c3631df581e1d9255bdce16f6ebcaeed029f


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 47d94bf5ed3d8025b5041f6d2cbc3444ed529d3b
Parents: 664c3ba
Author: Attila Magyar <am...@hortonworks.com>
Authored: Tue Feb 7 14:42:03 2017 +0100
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 10:29:04 2017 -0800

----------------------------------------------------------------------
 .../HDFS/2.1.0.2.0/package/scripts/zkfc_slave.py      |  3 +--
 .../stacks/HDP/2.3/upgrades/config-upgrade.xml        |  9 +++++++++
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml       | 12 ++++++++++++
 .../resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml |  2 ++
 .../stacks/HDP/2.4/upgrades/config-upgrade.xml        |  8 ++++++++
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml       | 14 ++++++++++++++
 .../resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml |  2 ++
 .../stacks/HDP/2.5/upgrades/config-upgrade.xml        |  8 ++++++++
 .../HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml       | 13 +++++++++++++
 .../resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml |  2 ++
 10 files changed, 71 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/47d94bf5/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/zkfc_slave.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/zkfc_slave.py b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/zkfc_slave.py
index 275d349..74b72c7 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/zkfc_slave.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/zkfc_slave.py
@@ -39,8 +39,6 @@ from resource_management.libraries.functions.stack_features import check_stack_f
 from resource_management.libraries.script import Script
 from resource_management.core.resources.zkmigrator import ZkMigrator
 
-
-
 class ZkfcSlave(Script):
   def get_component_name(self):
     import params
@@ -62,6 +60,7 @@ class ZkfcSlave(Script):
     import params
     env.set_params(params)
     hdfs("zkfc_slave")
+    utils.set_up_zkfc_security(params)
     pass
 
 @OsFamilyImpl(os_family=OsFamilyImpl.DEFAULT)

http://git-wip-us.apache.org/repos/asf/ambari/blob/47d94bf5/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
index f3e8ddd..f86b03d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
@@ -375,6 +375,11 @@
             <regex-replace  key="content" find="hadoop.security.log.maxfilesize=([0-9]+)MB" replace-with="hadoop.security.log.maxfilesize={{hadoop_security_log_max_backup_size}}MB"/>
             <regex-replace  key="content" find="hadoop.security.log.maxbackupindex=([0-9]+)" replace-with="hadoop.security.log.maxbackupindex={{hadoop_security_log_number_of_backup_files}}"/>
           </definition>
+
+          <definition xsi:type="configure" id="hadoop_env_zkfc_security_opts" summary="Adding HDFS ZKFC Security ACLs">
+            <type>hadoop-env</type>
+            <insert key="content" value="{% if hadoop_zkfc_opts is defined %} export HADOOP_ZKFC_OPTS=&quot;{{hadoop_zkfc_opts}} $HADOOP_ZKFC_OPTS&quot; {% endif %}" insert-type="append" newline-before="true" newline-after="true" />
+          </definition>
         </changes>
       </component>
     </service>
@@ -504,6 +509,10 @@
             <regex-replace key="content" find="^log4j.appender.RMSUMMARY.MaxFileSize=([0-9]+)MB" replace-with="log4j.appender.RMSUMMARY.MaxFileSize={{yarn_rm_summary_log_max_backup_size}}MB"/>
             <regex-replace key="content" find="^log4j.appender.RMSUMMARY.MaxBackupIndex=([0-9]+)" replace-with="log4j.appender.RMSUMMARY.MaxBackupIndex={{yarn_rm_summary_log_number_of_backup_files}}"/>
           </definition>
+          <definition xsi:type="configure" id="yarn_env_security_opts" summary="Adding YARN Security ACLs">
+            <type>yarn-env</type>
+            <insert key="content" value="{% if rm_security_opts is defined %} YARN_OPTS=&quot;{{rm_security_opts}} $YARN_OPTS&quot; {% endif %}" insert-type="append" newline-before="true" newline-after="true" />
+          </definition>
         </changes>
       </component>
     </service>

http://git-wip-us.apache.org/repos/asf/ambari/blob/47d94bf5/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
index dc53c67..8b7451e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
@@ -286,6 +286,12 @@
         </task>
       </execute-stage>
 
+      <execute-stage service="HDFS" component="NAMENODE" title="Adding HDFS ZKFC Security ACLs">
+        <task xsi:type="configure" id="hadoop_env_zkfc_security_opts">
+          <summary>Adding HDFS ZKFC Security ACLs</summary>
+        </task>
+      </execute-stage>
+
       <!-- YARN -->
       <execute-stage service="YARN" component="RESOURCEMANAGER" title="Calculating Yarn Properties for Spark">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.SparkShufflePropertyConfig">
@@ -293,6 +299,12 @@
         </task>
       </execute-stage>
 
+      <execute-stage service="YARN" component="RESOURCEMANAGER" title="Adding YARN Security ACLs">
+        <task xsi:type="configure" id="yarn_env_security_opts">
+          <summary>Adding YARN Security ACLs</summary>
+        </task>
+      </execute-stage>
+
       <execute-stage service="YARN" component="RESOURCEMANAGER" title="Apply config changes for Yarn Resourcemanager">
         <task xsi:type="configure" id="hdp_2_5_0_0_remove_ranger_yarn_audit_db"/>
       </execute-stage>

http://git-wip-us.apache.org/repos/asf/ambari/blob/47d94bf5/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
index 290d3c5..01fc102 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
@@ -680,6 +680,7 @@
           <task xsi:type="configure" id="hdp_2_4_0_0_namenode_ha_adjustments"/>
           <task xsi:type="configure" id="hdp_2_5_0_0_remove_ranger_hdfs_audit_db" />
           <task xsi:type="configure" id="hdfs_log4j_parameterize" />
+          <task xsi:type="configure" id="hadoop_env_zkfc_security_opts" />
         </pre-upgrade>
 
         <pre-downgrade /> <!--  no-op to prevent config changes on downgrade -->
@@ -760,6 +761,7 @@
           </task>
           <task xsi:type="configure" id="hdp_2_5_0_0_remove_ranger_yarn_audit_db" />
           <task xsi:type="configure" id="yarn_log4j_parameterize" />
+          <task xsi:type="configure" id="yarn_env_security_opts" />
         </pre-upgrade>
         <pre-downgrade /> <!--  no-op to prevent config changes on downgrade -->
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/47d94bf5/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
index 6a462ec..57227f6 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
@@ -264,6 +264,10 @@
             <regex-replace  key="content" find="hadoop.security.log.maxfilesize=([0-9]+)MB" replace-with="hadoop.security.log.maxfilesize={{hadoop_security_log_max_backup_size}}MB"/>
             <regex-replace  key="content" find="hadoop.security.log.maxbackupindex=([0-9]+)" replace-with="hadoop.security.log.maxbackupindex={{hadoop_security_log_number_of_backup_files}}"/>
           </definition>
+          <definition xsi:type="configure" id="hadoop_env_zkfc_security_opts" summary="Adding HDFS ZKFC Security ACLs">
+            <type>hadoop-env</type>
+            <insert key="content" value="{% if hadoop_zkfc_opts is defined %} export HADOOP_ZKFC_OPTS=&quot;{{hadoop_zkfc_opts}} $HADOOP_ZKFC_OPTS&quot; {% endif %}" insert-type="append" newline-before="true" newline-after="true" />
+          </definition>
         </changes>
       </component>
     </service>
@@ -289,6 +293,10 @@
             <regex-replace key="content" find="^log4j.appender.RMSUMMARY.MaxFileSize=([0-9]+)MB" replace-with="log4j.appender.RMSUMMARY.MaxFileSize={{yarn_rm_summary_log_max_backup_size}}MB"/>
             <regex-replace key="content" find="^log4j.appender.RMSUMMARY.MaxBackupIndex=([0-9]+)" replace-with="log4j.appender.RMSUMMARY.MaxBackupIndex={{yarn_rm_summary_log_number_of_backup_files}}"/>
           </definition>
+          <definition xsi:type="configure" id="yarn_env_security_opts" summary="Adding YARN Security ACLs">
+            <type>yarn-env</type>
+            <insert key="content" value="{% if rm_security_opts is defined %} YARN_OPTS=&quot;{{rm_security_opts}} $YARN_OPTS&quot; {% endif %}" insert-type="append" newline-before="true" newline-after="true" />
+          </definition>
         </changes>
       </component>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/47d94bf5/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
index 8a988cc..5661641 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
@@ -281,6 +281,13 @@
         </task>
       </execute-stage>
 
+      <!--Yarn-->
+      <execute-stage service="YARN" component="RESOURCEMANAGER" title="Adding YARN Security ACLs">
+        <task xsi:type="configure" id="yarn_env_security_opts">
+          <summary>Adding YARN Security ACLs</summary>
+        </task>
+      </execute-stage>
+
       <!-- YARN -->
       <execute-stage service="YARN" component="NODEMANAGER" title="Add Spark2 shuffle">
         <task xsi:type="configure" id="hdp_2_5_0_0_add_spark2_yarn_shuffle"/>
@@ -400,6 +407,13 @@
         </task>
       </execute-stage>
 
+      <!--HDFS-->
+      <execute-stage service="HDFS" component="NAMENODE" title="Adding HDFS ZKFC Security ACLs">
+        <task xsi:type="configure" id="hadoop_env_zkfc_security_opts">
+          <summary>Adding HDFS ZKFC Security ACLs</summary>
+        </task>
+      </execute-stage>
+
       <!-- SQOOP -->
       <execute-stage service="SQOOP" component="SQOOP" title="Apply config changes for Sqoop to remove Atlas Configs">
         <!-- Remove Atlas configs that were incorrectly added to sqoop-site instead of Atlas' application.properties. -->

http://git-wip-us.apache.org/repos/asf/ambari/blob/47d94bf5/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
index cadef73..7b12af5 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
@@ -685,6 +685,7 @@
           <task xsi:type="configure" id="hdp_2_5_0_0_namenode_ha_adjustments"/>
           <task xsi:type="configure" id="hdp_2_5_0_0_remove_ranger_hdfs_audit_db" />
           <task xsi:type="configure" id="hdfs_log4j_parameterize" />
+          <task xsi:type="configure" id="hadoop_env_zkfc_security_opts" />
         </pre-upgrade>
 
         <pre-downgrade /> <!--  no-op to prevent config changes on downgrade -->
@@ -765,6 +766,7 @@
           </task>
           <task xsi:type="configure" id="hdp_2_5_0_0_remove_ranger_yarn_audit_db" />
           <task xsi:type="configure" id="yarn_log4j_parameterize" />
+          <task xsi:type="configure" id="yarn_env_security_opts" />
         </pre-upgrade>
         <pre-downgrade /> <!--  no-op to prevent config changes on downgrade -->
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/47d94bf5/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
index 188e6f4..54a824d 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/config-upgrade.xml
@@ -128,6 +128,10 @@
           <regex-replace key="content" find="^log4j.appender.RMSUMMARY.MaxFileSize=([0-9]+)MB" replace-with="log4j.appender.RMSUMMARY.MaxFileSize={{yarn_rm_summary_log_max_backup_size}}MB"/>
           <regex-replace key="content" find="^log4j.appender.RMSUMMARY.MaxBackupIndex=([0-9]+)" replace-with="log4j.appender.RMSUMMARY.MaxBackupIndex={{yarn_rm_summary_log_number_of_backup_files}}"/>
         </definition>
+        <definition xsi:type="configure" id="yarn_env_security_opts" summary="Adding YARN Security ACLs">
+          <type>yarn-env</type>
+          <insert key="content" value="{% if rm_security_opts is defined %} YARN_OPTS=&quot;{{rm_security_opts}} $YARN_OPTS&quot; {% endif %}" insert-type="append" newline-before="true" newline-after="true" />
+        </definition>
       </changes>
     </component>
   </service>
@@ -146,6 +150,10 @@
           <regex-replace  key="content" find="hadoop.security.log.maxfilesize=([0-9]+)MB" replace-with="hadoop.security.log.maxfilesize={{hadoop_security_log_max_backup_size}}MB"/>
           <regex-replace  key="content" find="hadoop.security.log.maxbackupindex=([0-9]+)" replace-with="hadoop.security.log.maxbackupindex={{hadoop_security_log_number_of_backup_files}}"/>
         </definition>
+        <definition xsi:type="configure" id="hadoop_env_zkfc_security_opts" summary="Adding HDFS ZKFC Security ACLs">
+          <type>hadoop-env</type>
+          <insert key="content" value="{% if hadoop_zkfc_opts is defined %} export HADOOP_ZKFC_OPTS=&quot;{{hadoop_zkfc_opts}} $HADOOP_ZKFC_OPTS&quot; {% endif %}" insert-type="append" newline-before="true" newline-after="true" />
+        </definition>
       </changes>
     </component>
   </service>

http://git-wip-us.apache.org/repos/asf/ambari/blob/47d94bf5/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
index 1fad885..7bb679e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/nonrolling-upgrade-2.6.xml
@@ -291,6 +291,13 @@
         </task>
       </execute-stage>
 
+      <!--Yarn-->
+      <execute-stage service="YARN" component="RESOURCEMANAGER" title="Adding YARN Security ACLs">
+        <task xsi:type="configure" id="yarn_env_security_opts">
+          <summary>Adding YARN Security ACLs</summary>
+        </task>
+      </execute-stage>
+
       <!--TEZ-->
       <execute-stage service="TEZ" component="TEZ_CLIENT" title="Verify LZO codec path for Tez">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.FixLzoCodecPath">
@@ -317,6 +324,12 @@
         </task>
       </execute-stage>
 
+      <execute-stage service="HDFS" component="NAMENODE" title="Adding HDFS ZKFC Security ACLs">
+        <task xsi:type="configure" id="hadoop_env_zkfc_security_opts">
+          <summary>Adding HDFS ZKFC Security ACLs</summary>
+        </task>
+      </execute-stage>
+
       <!--HBASE-->
       <execute-stage service="HBASE" component="HBASE_MASTER" title="Parameterizing HBase Log4J Properties">
         <task xsi:type="configure" id="hbase_log4j_parameterize">

http://git-wip-us.apache.org/repos/asf/ambari/blob/47d94bf5/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
index 291397a..2f07c97 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/upgrades/upgrade-2.6.xml
@@ -589,6 +589,7 @@
       <component name="NAMENODE">
         <pre-upgrade>
           <task xsi:type="configure" id="hdfs_log4j_parameterize" />
+          <task xsi:type="configure" id="hadoop_env_zkfc_security_opts" />
         </pre-upgrade>
         <pre-downgrade />
         <upgrade>
@@ -667,6 +668,7 @@
       <component name="RESOURCEMANAGER">
         <pre-upgrade>
           <task xsi:type="configure" id="yarn_log4j_parameterize" />
+          <task xsi:type="configure" id="yarn_env_security_opts" />
         </pre-upgrade>
         <pre-downgrade />
         <upgrade>


[22/51] [abbrv] ambari git commit: AMBARI-19733: Regression in Spark2 keytab and {{stack_root}} for Livy2 (Bikas Saha via jluniya)

Posted by rz...@apache.org.
AMBARI-19733: Regression in Spark2 keytab and {{stack_root}} for Livy2 (Bikas Saha via jluniya)

(cherry picked from commit 2ccee3d2617f1e620dac49ced5414697d9928555)

Change-Id: If563b8e55258c2c3ba1d2e86e0874cfdf762de10


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: bd2674d50e6ab86ac2b47e64323a978f2dac814a
Parents: d1c34a9
Author: Jayush Luniya <jl...@hortonworks.com>
Authored: Wed Feb 1 21:54:08 2017 -0800
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 02:09:48 2017 -0800

----------------------------------------------------------------------
 .../stacks/HDP/2.6/services/SPARK2/configuration/livy2-env.xml   | 2 +-
 .../main/resources/stacks/HDP/2.6/services/SPARK2/kerberos.json  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/bd2674d5/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-env.xml
index afb1d17..6ba9141 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-env.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/configuration/livy2-env.xml
@@ -61,7 +61,7 @@
     </property>
     <property>
         <name>spark_home</name>
-        <value>{{stack_root}}/current/spark2-client</value>
+        <value>/usr/hdp/current/spark2-client</value>
         <value-attributes>
             <type>directory</type>
         </value-attributes>

http://git-wip-us.apache.org/repos/asf/ambari/blob/bd2674d5/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/kerberos.json b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/kerberos.json
index 6b5b053..01ee87e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/kerberos.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/SPARK2/kerberos.json
@@ -15,7 +15,7 @@
             "local_username" : "${spark2-env/spark_user}"
           },
           "keytab": {
-            "file": "${keytab_dir}/spark.headless.keytab",
+            "file": "${keytab_dir}/spark2.headless.keytab",
             "owner": {
               "name": "${spark2-env/spark_user}",
               "access": "r"
@@ -96,7 +96,7 @@
                 "local_username": "${livy2-env/livy2_user}"
               },
               "keytab": {
-                "file": "${keytab_dir}/livy.service.keytab",
+                "file": "${keytab_dir}/livy2.service.keytab",
                 "owner": {
                   "name": "${livy2-env/livy2_user}",
                   "access": "r"


[35/51] [abbrv] ambari git commit: AMBARI-19789. Hive LLAP and Hive2 log4j changes should be removed from upgrade packs hdp 2.3 and hdp 2.4 (Madhuvanthi Radhakrishnan via smohanty)

Posted by rz...@apache.org.
AMBARI-19789. Hive LLAP and Hive2 log4j changes should be removed from upgrade packs hdp 2.3 and hdp 2.4 (Madhuvanthi Radhakrishnan via smohanty)

(cherry picked from commit 695d3a5b76994b2088bdb2adb8f337cb75b6cb54)

Change-Id: I4cb05abd45d47ac39a6d395197fb30c6b91addb5


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: a08d0bfd729863e00c9ebb6ac2fad5ebb520d88c
Parents: d56e520
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Wed Feb 1 13:56:13 2017 -0800
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 06:44:14 2017 -0800

----------------------------------------------------------------------
 .../stacks/HDP/2.3/upgrades/config-upgrade.xml  | 27 ------------------
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml | 18 +-----------
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml | 18 ------------
 .../HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml | 17 -----------
 .../stacks/HDP/2.3/upgrades/upgrade-2.4.xml     | 14 +--------
 .../stacks/HDP/2.3/upgrades/upgrade-2.5.xml     | 14 +--------
 .../stacks/HDP/2.3/upgrades/upgrade-2.6.xml     | 14 +--------
 .../stacks/HDP/2.4/upgrades/config-upgrade.xml  | 30 +-------------------
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml | 20 +------------
 .../HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml | 18 +-----------
 .../stacks/HDP/2.4/upgrades/upgrade-2.5.xml     | 14 +--------
 .../stacks/HDP/2.4/upgrades/upgrade-2.6.xml     | 13 +--------
 12 files changed, 9 insertions(+), 208 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a08d0bfd/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
index 73d40fb..f3e8ddd 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/config-upgrade.xml
@@ -195,33 +195,6 @@
             <regex-replace key="content" find="#log4j.appender.DRFA.MaxBackupIndex=([0-9]+)" replace-with="#log4j.appender.DRFA.MaxBackupIndex={{hive_log_maxbackupindex}}"/>
             <replace key="content" find="log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender" replace-with="log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender&#xA;log4j.appender.DRFA.MaxFileSize = {{hive_log_maxfilesize}}MB"/>
           </definition>
-          <definition xsi:type="configure" id="hive_llap_log4j_parameterize" summary="Parameterizing Hive llap Log4J Properties">
-            <type>llap-daemon-log4j</type>
-            <set key="hive_llap_log_maxfilesize" value="256"/>
-            <set key = "hive_llap_log_maxbackupindex" value="240"/>
-            <regex-replace key="content" find="property.llap.daemon.log.maxfilesize = ([0-9]+)MB" replace-with="property.llap.daemon.log.maxfilesize = {{hive_llap_log_maxfilesize}}MB"/>
-            <regex-replace key="content" find="property.llap.daemon.log.maxbackupindex = ([0-9]+)" replace-with="property.llap.daemon.log.maxbackupindex = {{hive_llap_log_maxbackupindex}}"/>
-          </definition>
-        </changes>
-      </component>
-
-      <component name="HIVE_SERVER_INTERACTIVE">
-        <changes>
-          <definition xsi:type="configure" id="hive_log4j2_parameterize" summary="Parameterizing Hive Log4J2 Properties">
-            <type>hive-log4j2</type>
-            <set key="hive2_log_maxfilesize" value="256"/>
-            <set key = "hive2_log_maxbackupindex" value="30"/>
-            <regex-replace key="content" find="appender.DRFA.strategy.max = ([0-9]+)" replace-with="appender.DRFA.strategy.max = {{hive2_log_maxbackupindex}}"/>
-            <replace key="content" find="appender.DRFA.strategy.type = DefaultRolloverStrategy" replace-with="appender.DRFA.strategy.type = DefaultRolloverStrategy&#xA;appender.DRFA.policies.fsize.type = SizeBasedTriggeringPolicy&#xA;appender.DRFA.policies.fsize.size = {{hive2_log_maxfilesize}}MB"/>
-          </definition>
-
-          <definition xsi:type="configure" id="llap_cli_log4j2_parameterize" summary="Parameterizing LLAP Cli Log4J2 Properties">
-            <type>llap-cli-log4j2</type>
-            <set key="llap_cli_log_maxfilesize" value="256"/>
-            <set key = "llap_cli_log_maxbackupindex" value="30"/>
-            <regex-replace key="content" find="appender.DRFA.strategy.max = ([0-9]+)" replace-with="appender.DRFA.strategy.max = {{llap_cli_log_maxbackupindex}}"/>
-            <replace key="content" find="appender.DRFA.strategy.type = DefaultRolloverStrategy" replace-with="appender.DRFA.strategy.type = DefaultRolloverStrategy&#xA;appender.DRFA.policies.fsize.type = SizeBasedTriggeringPolicy&#xA;appender.DRFA.policies.fsize.size = {{llap_cli_log_maxfilesize}}MB"/>
-          </definition>
         </changes>
       </component>
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a08d0bfd/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml
index 9e13036..52421d9 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.4.xml
@@ -323,11 +323,7 @@
           <summary>Updating the Hive Log4J properties to include parameterizations</summary>
         </task>
       </execute-stage>
-      <execute-stage service="HIVE" component="HIVE_SERVER" title="Parameterizing Hive LLAP Log4J Properties">
-        <task xsi:type="configure" id="hive_llap_log4j_parameterize">
-          <summary>Updating the Hive llap Log4J properties to include parameterizations</summary>
-        </task>
-      </execute-stage>
+
       <execute-stage service="HIVE" component="WEBHCAT_SERVER" title="Parameterizing WebHCat Log4J Properties">
         <task xsi:type="configure" id="webhcat_log4j_parameterize">
           <summary>Updating the Webhcat Log4J properties to include parameterizations</summary>
@@ -338,18 +334,6 @@
         <task xsi:type="configure" id="hdp_2_4_0_0_hive_server_configure_authentication"/>
       </execute-stage>
 
-      <execute-stage service="HIVE" component="HIVE_SERVER_INTERACTIVE" title="Parameterizing LLAP Cli Log4J2 Properties">
-        <task xsi:type="configure" id="llap_cli_log4j2_parameterize">
-          <summary>Updating the LLAP Cli Log4J2 properties to include parameterizations</summary>
-        </task>
-      </execute-stage>
-
-      <execute-stage service="HIVE" component="HIVE_SERVER_INTERACTIVE" title="Parameterizing Hive Log4J2 Properties">
-        <task xsi:type="configure" id="hive_log4j2_parameterize">
-          <summary>Updating the Hive Log4J2 properties to include parameterizations</summary>
-        </task>
-      </execute-stage>
-
       <!--OOZIE-->
       <execute-stage service="OOZIE" component="OOZIE_SERVER" title="Apply config changes for Oozie Server">
         <task xsi:type="server_action" class="org.apache.ambari.server.serveraction.upgrades.OozieConfigCalculation">

http://git-wip-us.apache.org/repos/asf/ambari/blob/a08d0bfd/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml
index 875b74e..ec61c63 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.5.xml
@@ -368,24 +368,6 @@
         </task>
       </execute-stage>
 
-      <execute-stage service="HIVE" component="HIVE_SERVER" title="Parameterizing Hive LLAP Log4J Properties">
-        <task xsi:type="configure" id="hive_llap_log4j_parameterize">
-          <summary>Updating the Hive llap Log4J properties to include parameterizations</summary>
-        </task>
-      </execute-stage>
-
-      <execute-stage service="HIVE" component="HIVE_SERVER_INTERACTIVE" title="Parameterizing LLAP Cli Log4J2 Properties">
-        <task xsi:type="configure" id="llap_cli_log4j2_parameterize">
-          <summary>Updating the LLAP Cli Log4J2 properties to include parameterizations</summary>
-        </task>
-      </execute-stage>
-
-      <execute-stage service="HIVE" component="HIVE_SERVER_INTERACTIVE" title="Parameterizing Hive Log4J2 Properties">
-        <task xsi:type="configure" id="hive_log4j2_parameterize">
-          <summary>Updating the Hive Log4J2 properties to include parameterizations</summary>
-        </task>
-      </execute-stage>
-
       <execute-stage service="HIVE" component="WEBHCAT_SERVER" title="Parameterizing WebHCat Log4J Properties">
         <task xsi:type="configure" id="webhcat_log4j_parameterize">
           <summary>Updating the Webhcat Log4J properties to include parameterizations</summary>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a08d0bfd/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
index 0afa2c9..dc53c67 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/nonrolling-upgrade-2.6.xml
@@ -399,23 +399,6 @@
           <summary>Updating the Hive Log4J properties to include parameterizations</summary>
         </task>
       </execute-stage>
-      <execute-stage service="HIVE" component="HIVE_SERVER" title="Parameterizing Hive LLAP Log4J Properties">
-        <task xsi:type="configure" id="hive_llap_log4j_parameterize">
-          <summary>Updating the Hive llap Log4J properties to include parameterizations</summary>
-        </task>
-      </execute-stage>
-
-      <execute-stage service="HIVE" component="HIVE_SERVER_INTERACTIVE" title="Parameterizing LLAP Cli Log4J2 Properties">
-        <task xsi:type="configure" id="llap_cli_log4j2_parameterize">
-          <summary>Updating the LLAP Cli Log4J2 properties to include parameterizations</summary>
-        </task>
-      </execute-stage>
-
-      <execute-stage service="HIVE" component="HIVE_SERVER_INTERACTIVE" title="Parameterizing Hive Log4J2 Properties">
-        <task xsi:type="configure" id="hive_log4j2_parameterize">
-          <summary>Updating the Hive Log4J2 properties to include parameterizations</summary>
-        </task>
-      </execute-stage>
 
       <!--OOZIE-->
       <execute-stage service="OOZIE" component="OOZIE_SERVER" title="Apply config changes for Oozie Server">

http://git-wip-us.apache.org/repos/asf/ambari/blob/a08d0bfd/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
index 34027ae..01e145e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.4.xml
@@ -753,8 +753,7 @@
         <pre-upgrade>
           <task xsi:type="configure" id="hdp_2_4_0_0_hive_server_configure_authentication"/>
           <task xsi:type="configure" id="hive_log4j_parameterize" />
-          <task xsi:type="configure" id="hive_llap_log4j_parameterize" />
-        </pre-upgrade>
+         </pre-upgrade>
 
         <pre-downgrade/>
 
@@ -787,17 +786,6 @@
           <task xsi:type="restart-task" />
         </upgrade>
       </component>
-
-      <component name="HIVE_SERVER_INTERACTIVE">
-        <pre-upgrade>
-          <task xsi:type="configure" id="hive_log4j2_parameterize"/>
-          <task xsi:type="configure" id="llap_cli_log4j2_parameterize"/>
-        </pre-upgrade>
-        <pre-downgrade/>
-        <upgrade>
-	   <task xsi:type="restart-task" />
-        </upgrade>
-      </component>
     </service>
 
     <service name="SLIDER">

http://git-wip-us.apache.org/repos/asf/ambari/blob/a08d0bfd/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
index 220c358..604c1dc 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.5.xml
@@ -875,7 +875,6 @@
           <task xsi:type="configure" id="hdp_2_4_0_0_hive_server_configure_authentication"/>
           <task xsi:type="configure" id="hdp_2_5_0_0_remove_ranger_hive_audit_db" />
           <task xsi:type="configure" id="hive_log4j_parameterize" />
-          <task xsi:type="configure" id="hive_llap_log4j_parameterize" />
 
           <!-- Remove Atlas configs that were incorrectly added to hive-site instead of Atlas' application.properties. -->
           <task xsi:type="configure" id="hdp_2_5_0_0_remove_hive_atlas_configs" />
@@ -916,18 +915,7 @@
           <task xsi:type="restart-task" />
         </upgrade>
       </component>
-
-      <component name="HIVE_SERVER_INTERACTIVE">
-        <pre-upgrade>
-          <task xsi:type="configure" id="hive_log4j2_parameterize"/>
-          <task xsi:type="configure" id="llap_cli_log4j2_parameterize"/>
-        </pre-upgrade>
-        <pre-downgrade/>
-        <upgrade>
-	  <task xsi:type="restart-task" />
-        </upgrade>
-      </component>
-    </service>
+   </service>
 
     <service name="SLIDER">
       <component name="SLIDER">

http://git-wip-us.apache.org/repos/asf/ambari/blob/a08d0bfd/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
index 24bf816..290d3c5 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/upgrades/upgrade-2.6.xml
@@ -888,7 +888,6 @@
             <summary>Update hive-env content</summary>
           </task>
           <task xsi:type="configure" id="hive_log4j_parameterize" />
-          <task xsi:type="configure" id="hive_llap_log4j_parameterize" />
         </pre-upgrade>
 
         <pre-downgrade/>
@@ -922,18 +921,7 @@
           <task xsi:type="restart-task" />
         </upgrade>
       </component>
-
-      <component name="HIVE_SERVER_INTERACTIVE">
-        <pre-upgrade>
-          <task xsi:type="configure" id="hive_log4j2_parameterize"/>
-          <task xsi:type="configure" id="llap_cli_log4j2_parameterize"/>
-        </pre-upgrade>
-        <pre-downgrade/>
-        <upgrade>
-	<task xsi:type="restart-task" />
-        </upgrade>
-      </component>
-    </service>
+   </service>
 
     <service name="SLIDER">
       <component name="SLIDER">

http://git-wip-us.apache.org/repos/asf/ambari/blob/a08d0bfd/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
index 8d80491..6a462ec 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/config-upgrade.xml
@@ -96,35 +96,7 @@
             <regex-replace key="content" find="#log4j.appender.DRFA.MaxBackupIndex=([0-9]+)" replace-with="#log4j.appender.DRFA.MaxBackupIndex={{hive_log_maxbackupindex}}"/>
             <replace key="content" find="log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender" replace-with="log4j.appender.DRFA=org.apache.log4j.DailyRollingFileAppender&#xA;log4j.appender.DRFA.MaxFileSize = {{hive_log_maxfilesize}}MB"/>
           </definition>
-          <definition xsi:type="configure" id="hive_llap_log4j_parameterize" summary="Parameterizing Hive llap Log4J Properties">
-            <type>llap-daemon-log4j</type>
-            <set key="hive_llap_log_maxfilesize" value="256"/>
-            <set key = "hive_llap_log_maxbackupindex" value="240"/>
-            <regex-replace key="content" find="property.llap.daemon.log.maxfilesize = ([0-9]+)MB" replace-with="property.llap.daemon.log.maxfilesize = {{hive_llap_log_maxfilesize}}MB"/>
-            <regex-replace key="content" find="property.llap.daemon.log.maxbackupindex = ([0-9]+)" replace-with="property.llap.daemon.log.maxbackupindex = {{hive_llap_log_maxbackupindex}}"/>
-          </definition>
-        </changes>
-      </component>
-
-      <component name="HIVE_SERVER_INTERACTIVE">
-        <changes>
-          <definition xsi:type="configure" id="hive_log4j2_parameterize" summary="Parameterizing Hive Log4J2 Properties">
-            <type>hive-log4j2</type>
-            <set key="hive2_log_maxfilesize" value="256"/>
-            <set key = "hive2_log_maxbackupindex" value="30"/>
-            <regex-replace key="content" find="appender.DRFA.strategy.max = ([0-9]+)" replace-with="appender.DRFA.strategy.max = {{hive2_log_maxbackupindex}}"/>
-            <replace key="content" find="appender.DRFA.strategy.type = DefaultRolloverStrategy" replace-with="appender.DRFA.strategy.type = DefaultRolloverStrategy&#xA;appender.DRFA.policies.fsize.type = SizeBasedTriggeringPolicy&#xA;appender.DRFA.policies.fsize.size = {{hive2_log_maxfilesize}}MB"/>
-          </definition>
-
-          <definition xsi:type="configure" id="llap_cli_log4j2_parameterize" summary="Parameterizing LLAP Cli Log4J2 Properties">
-            <type>llap-cli-log4j2</type>
-            <set key="llap_cli_log_maxfilesize" value="256"/>
-            <set key = "llap_cli_log_maxbackupindex" value="30"/>
-            <regex-replace key="content" find="appender.DRFA.strategy.max = ([0-9]+)" replace-with="appender.DRFA.strategy.max = {{llap_cli_log_maxbackupindex}}"/>
-            <replace key="content" find="appender.DRFA.strategy.type = DefaultRolloverStrategy" replace-with="appender.DRFA.strategy.type = DefaultRolloverStrategy&#xA;appender.DRFA.policies.fsize.type = SizeBasedTriggeringPolicy&#xA;appender.DRFA.policies.fsize.size = {{llap_cli_log_maxfilesize}}MB"/>
-          </definition>
-
-        </changes>
+         </changes>
       </component>
 
       <component name="WEBHCAT_SERVER">

http://git-wip-us.apache.org/repos/asf/ambari/blob/a08d0bfd/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml
index 96dc65b..6bc7859 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.5.xml
@@ -429,31 +429,13 @@
         </task>
       </execute-stage>
 
-      <execute-stage service="HIVE" component="HIVE_SERVER" title="Parameterizing Hive LLAP Log4J Properties">
-        <task xsi:type="configure" id="hive_llap_log4j_parameterize">
-          <summary>Updating the Hive llap Log4J properties to include parameterizations</summary>
-        </task>
-      </execute-stage>
-
       <execute-stage service="HIVE" component="WEBHCAT_SERVER" title="Parameterizing WebHCat Log4J Properties">
         <task xsi:type="configure" id="webhcat_log4j_parameterize">
           <summary>Updating the Webhcat Log4J properties to include parameterizations</summary>
         </task>
       </execute-stage>
 
-      <execute-stage service="HIVE" component="HIVE_SERVER_INTERACTIVE" title="Parameterizing LLAP Cli Log4J2 Properties">
-        <task xsi:type="configure" id="llap_cli_log4j2_parameterize">
-          <summary>Updating the LLAP Cli Log4J2 properties to include parameterizations</summary>
-        </task>
-      </execute-stage>
-
-      <execute-stage service="HIVE" component="HIVE_SERVER_INTERACTIVE" title="Parameterizing Hive Log4J2 Properties">
-        <task xsi:type="configure" id="hive_log4j2_parameterize">
-          <summary>Updating the Hive Log4J2 properties to include parameterizations</summary>
-        </task>
-      </execute-stage>
-
-      <!-- HBASE -->
+     <!-- HBASE -->
       <execute-stage service="HBASE" component="HBASE_MASTER" title="Apply config changes for Hbase Master">
         <task xsi:type="configure" id="hdp_2_5_0_0_remove_ranger_hbase_audit_db"/>
       </execute-stage>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a08d0bfd/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
index 65efb1a..8a988cc 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/nonrolling-upgrade-2.6.xml
@@ -438,29 +438,13 @@
           <summary>Updating the Hive Log4J properties to include parameterizations</summary>
         </task>
       </execute-stage>
-      <execute-stage service="HIVE" component="HIVE_SERVER" title="Parameterizing Hive LLAP Log4J Properties">
-        <task xsi:type="configure" id="hive_llap_log4j_parameterize">
-          <summary>Updating the Hive llap Log4J properties to include parameterizations</summary>
-        </task>
-      </execute-stage>
+
       <execute-stage service="HIVE" component="WEBHCAT_SERVER" title="Parameterizing WebHCat Log4J Properties">
         <task xsi:type="configure" id="webhcat_log4j_parameterize">
           <summary>Updating the Webhcat Log4J properties to include parameterizations</summary>
         </task>
       </execute-stage>
 
-      <execute-stage service="HIVE" component="HIVE_SERVER_INTERACTIVE" title="Parameterizing LLAP Cli Log4J2 Properties">
-        <task xsi:type="configure" id="llap_cli_log4j2_parameterize">
-          <summary>Updating the LLAP Cli Log4J2 properties to include parameterizations</summary>
-        </task>
-      </execute-stage>
-
-      <execute-stage service="HIVE" component="HIVE_SERVER_INTERACTIVE" title="Parameterizing Hive Log4J2 Properties">
-        <task xsi:type="configure" id="hive_log4j2_parameterize">
-          <summary>Updating the Hive Log4J2 properties to include parameterizations</summary>
-        </task>
-      </execute-stage>
-
       <!-- HBASE -->
       <execute-stage service="HBASE" component="HBASE_MASTER" title="Apply config changes for Hbase Master">
         <task xsi:type="configure" id="hdp_2_5_0_0_remove_ranger_hbase_audit_db"/>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a08d0bfd/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
index f172209..3774896 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.5.xml
@@ -876,7 +876,6 @@
             <summary>Update hive-env content</summary>
           </task>
           <task xsi:type="configure" id="hive_log4j_parameterize" />
-          <task xsi:type="configure" id="hive_llap_log4j_parameterize" />
         </pre-upgrade>
 
         <pre-downgrade/>
@@ -907,18 +906,7 @@
           <task xsi:type="restart-task" />
         </upgrade>
       </component>
-
-      <component name="HIVE_SERVER_INTERACTIVE">
-        <pre-upgrade>
-          <task xsi:type="configure" id="hive_log4j2_parameterize"/>
-          <task xsi:type="configure" id="llap_cli_log4j2_parameterize"/>
-        </pre-upgrade>
-        <pre-downgrade/>
-        <upgrade>
-	<task xsi:type="restart-task" />
-        </upgrade>
-      </component>
-    </service>
+     </service>
 
     <service name="SLIDER">
       <component name="SLIDER">

http://git-wip-us.apache.org/repos/asf/ambari/blob/a08d0bfd/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
index ecdbf30..cadef73 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.4/upgrades/upgrade-2.6.xml
@@ -886,7 +886,6 @@
             <summary>Update hive-env content</summary>
           </task>
           <task xsi:type="configure" id="hive_log4j_parameterize" />
-          <task xsi:type="configure" id="hive_llap_log4j_parameterize" />
 
         </pre-upgrade>
 
@@ -919,17 +918,7 @@
         </upgrade>
       </component>
 
-      <component name="HIVE_SERVER_INTERACTIVE">
-        <pre-upgrade>
-          <task xsi:type="configure" id="hive_log4j2_parameterize"/>
-          <task xsi:type="configure" id="llap_cli_log4j2_parameterize"/>
-        </pre-upgrade>
-        <pre-downgrade/>
-        <upgrade>
-	<task xsi:type="restart-task" />
-        </upgrade>
-      </component>
-    </service>
+   </service>
 
     <service name="SLIDER">
       <component name="SLIDER">


[49/51] [abbrv] ambari git commit: AMBARI-19887 : Add AMS and Grafana to PERF cluster. (avijayan)

Posted by rz...@apache.org.
AMBARI-19887 : Add AMS and Grafana to PERF cluster. (avijayan)

(cherry picked from commit a45b521372c70b5d4b50d3376350dad8353fa47a)

Change-Id: Ib69554ba3352b530d23b06cbd0ea043930d54ec9


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 6e2a2855615b1ad44d799f20a44fe1e27b6572dd
Parents: 8cfbd7b
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Tue Feb 7 10:16:21 2017 -0800
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 15:56:55 2017 -0800

----------------------------------------------------------------------
 .../functions/get_not_managed_resources.py      | 19 ++--
 .../system/impl/AmbariMetricSinkImpl.java       | 44 +++++++--
 .../PERF/1.0/hooks/before-ANY/scripts/hook.py   |  7 ++
 .../PERF/1.0/hooks/before-ANY/scripts/params.py | 42 +++++++++
 .../before-ANY/scripts/shared_initialization.py | 94 ++++++++++++++++++++
 .../PERF/1.0/hooks/before-START/scripts/hook.py |  1 +
 .../AMBARI_METRICS/configuration/ams-site.xml   | 36 ++++++++
 .../1.0/services/AMBARI_METRICS/metainfo.xml    | 26 ++++++
 .../PERF/1.0/services/FAKEZOOKEEPER/alerts.json |  4 +-
 .../1.0/services/FAKEZOOKEEPER/kerberos.json    |  4 +-
 .../1.0/services/FAKEZOOKEEPER/metainfo.xml     |  7 +-
 .../package/scripts/zookeeper_client.py         |  2 +-
 .../package/scripts/zookeeper_server.py         |  2 +-
 .../stacks/PERF/1.0/services/stack_advisor.py   | 37 ++++++++
 14 files changed, 298 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-common/src/main/python/resource_management/libraries/functions/get_not_managed_resources.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/get_not_managed_resources.py b/ambari-common/src/main/python/resource_management/libraries/functions/get_not_managed_resources.py
index 5f8bc67..4af636b 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/get_not_managed_resources.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/get_not_managed_resources.py
@@ -34,17 +34,18 @@ def get_not_managed_resources():
   """
   config = Script.get_config()
   not_managed_hdfs_path_list = json.loads(config['hostLevelParams']['not_managed_hdfs_path_list'])[:]
-  managed_hdfs_resource_property_names = config['configurations']['cluster-env']['managed_hdfs_resource_property_names']
-  managed_hdfs_resource_property_list = filter(None, [property.strip() for property in managed_hdfs_resource_property_names.split(',')])
+  if 'managed_hdfs_resource_property_names' in config['configurations']['cluster-env']:
+    managed_hdfs_resource_property_names = config['configurations']['cluster-env']['managed_hdfs_resource_property_names']
+    managed_hdfs_resource_property_list = filter(None, [property.strip() for property in managed_hdfs_resource_property_names.split(',')])
 
-  for property_name in managed_hdfs_resource_property_list:
-    property_value = default('/configurations/' + property_name, None)
+    for property_name in managed_hdfs_resource_property_list:
+      property_value = default('/configurations/' + property_name, None)
 
-    if property_value == None:
-      Logger.warning(("Property {0} from cluster-env/managed_hdfs_resource_property_names not found in configurations. "
+      if property_value == None:
+        Logger.warning(("Property {0} from cluster-env/managed_hdfs_resource_property_names not found in configurations. "
                      "Management of this DFS resource will not be forced.").format(property_name))
-    else:
-      while property_value in not_managed_hdfs_path_list:
-        not_managed_hdfs_path_list.remove(property_value)
+      else:
+        while property_value in not_managed_hdfs_path_list:
+          not_managed_hdfs_path_list.remove(property_value)
 
   return not_managed_hdfs_path_list
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java
index 58d36c3..275ad16 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java
@@ -43,6 +43,8 @@ import org.apache.ambari.server.metrics.system.SingleMetric;
 import org.apache.ambari.server.security.authorization.internal.InternalAuthenticationToken;
 import org.apache.ambari.server.state.Cluster;
 import org.apache.ambari.server.state.Clusters;
+import org.apache.ambari.server.state.Config;
+import org.apache.ambari.server.state.ConfigHelper;
 import org.apache.ambari.server.state.Service;
 import org.apache.ambari.server.state.ServiceComponent;
 import org.apache.ambari.server.state.ServiceComponentHost;
@@ -99,6 +101,28 @@ public class AmbariMetricSinkImpl extends AbstractTimelineMetricsSink implements
       Cluster c = kv.getValue();
       Resource.Type type = Resource.Type.ServiceConfigVersion;
 
+      //If Metrics Collector VIP settings are configured, use that.
+      boolean vipHostConfigPresent = false;
+      boolean vipPortConfigPresent = false;
+      Config clusterEnv = c.getDesiredConfigByType(ConfigHelper.CLUSTER_ENV);
+      if (clusterEnv != null) {
+        Map<String, String> configs = clusterEnv.getProperties();
+
+        String metricsCollectorVipHost = configs.get("metrics_collector_vip_host");
+        if (StringUtils.isNotEmpty(metricsCollectorVipHost)) {
+          LOG.info("Setting Metrics Collector Vip Host : " + metricsCollectorVipHost);
+          collectorHosts.add(metricsCollectorVipHost);
+          vipHostConfigPresent = true;
+        }
+
+        String metricsCollectorVipPort = configs.get("metrics_collector_vip_port");
+        if (StringUtils.isNotEmpty(metricsCollectorVipPort)) {
+          LOG.info("Setting Metrics Collector Vip Port : " + metricsCollectorVipPort);
+          port = metricsCollectorVipPort;
+          vipPortConfigPresent = true;
+        }
+      }
+
       Set<String> propertyIds = new HashSet<String>();
       propertyIds.add(ServiceConfigVersionResourceProvider.SERVICE_CONFIG_VERSION_CONFIGURATIONS_PROPERTY_ID);
 
@@ -116,14 +140,16 @@ public class AmbariMetricSinkImpl extends AbstractTimelineMetricsSink implements
         ambariManagementController);
 
       try {
-        //get collector host(s)
-        Service service = c.getService(ambariMetricsServiceName);
-        if (service != null) {
-          for (String component : service.getServiceComponents().keySet()) {
-            ServiceComponent sc = service.getServiceComponents().get(component);
-            for (ServiceComponentHost serviceComponentHost : sc.getServiceComponentHosts().values()) {
-              if (serviceComponentHost.getServiceComponentName().equals("METRICS_COLLECTOR")) {
-                collectorHosts.add(serviceComponentHost.getHostName());
+        if ( !vipHostConfigPresent ) {
+          //get collector host(s)
+          Service service = c.getService(ambariMetricsServiceName);
+          if (service != null) {
+            for (String component : service.getServiceComponents().keySet()) {
+              ServiceComponent sc = service.getServiceComponents().get(component);
+              for (ServiceComponentHost serviceComponentHost : sc.getServiceComponentHosts().values()) {
+                if (serviceComponentHost.getServiceComponentName().equals("METRICS_COLLECTOR")) {
+                  collectorHosts.add(serviceComponentHost.getHostName());
+                }
               }
             }
           }
@@ -140,7 +166,7 @@ public class AmbariMetricSinkImpl extends AbstractTimelineMetricsSink implements
               if (config != null && config.get("type").equals("ams-site")) {
                 TreeMap<Object, Object> properties = (TreeMap<Object, Object>) config.get("properties");
                 String timelineWebappAddress = (String) properties.get("timeline.metrics.service.webapp.address");
-                if (StringUtils.isNotEmpty(timelineWebappAddress) && timelineWebappAddress.contains(":")) {
+                if (!vipPortConfigPresent && StringUtils.isNotEmpty(timelineWebappAddress) && timelineWebappAddress.contains(":")) {
                   port = timelineWebappAddress.split(":")[1];
                 }
                 String httpPolicy = (String) properties.get("timeline.metrics.service.http.policy");

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py
index 90e0266..ef409e2 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/hook.py
@@ -18,11 +18,18 @@ limitations under the License.
 """
 
 from resource_management.libraries.script import Hook
+from shared_initialization import *
 
 class BeforeAnyHook(Hook):
 
   def hook(self, env):
     print "Before Any Hook"
+    import params
+    env.set_params(params)
+
+    #For AMS.
+    setup_users()
+    setup_java()
 
 if __name__ == "__main__":
   BeforeAnyHook().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/params.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/params.py
new file mode 100644
index 0000000..dee9d07
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/params.py
@@ -0,0 +1,42 @@
+"""
+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.
+
+"""
+import collections
+import ambari_simplejson as json
+from resource_management.libraries.script import Script
+from resource_management.libraries.functions import default
+from resource_management.libraries.functions.expect import expect
+from ambari_commons.constants import AMBARI_SUDO_BINARY
+
+config = Script.get_config()
+tmp_dir = Script.get_tmp_dir()
+
+group_list = json.loads(config['hostLevelParams']['group_list'])
+user_list = json.loads(config['hostLevelParams']['user_list'])
+
+user_group = config['configurations']['cluster-env']['user_group']
+user_to_gid_dict = collections.defaultdict(lambda:user_group)
+user_to_groups_dict = collections.defaultdict(lambda:[user_group])
+
+jdk_name = default("/hostLevelParams/jdk_name", None)
+java_home = config['hostLevelParams']['java_home']
+artifact_dir = format("{tmp_dir}/AMBARI-artifacts/")
+jdk_location = config['hostLevelParams']['jdk_location']
+java_version = expect("/hostLevelParams/java_version", int)
+
+sudo = AMBARI_SUDO_BINARY
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/shared_initialization.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/shared_initialization.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/shared_initialization.py
new file mode 100644
index 0000000..7dc1a48
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-ANY/scripts/shared_initialization.py
@@ -0,0 +1,94 @@
+"""
+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.
+
+"""
+
+import os
+import tempfile
+from resource_management import *
+
+def setup_users():
+  """
+  Creates users before cluster installation
+  """
+  import params
+
+  for group in params.group_list:
+    Group(group,
+          )
+
+  for user in params.user_list:
+    User(user,
+         gid=params.user_to_gid_dict[user],
+         groups=params.user_to_groups_dict[user],
+         fetch_nonlocal_groups=False
+         )
+
+def setup_java():
+  """
+  Installs jdk using specific params, that comes from ambari-server
+  """
+  import params
+
+  java_exec = format("{java_home}/bin/java")
+
+  if not os.path.isfile(java_exec):
+    if not params.jdk_name: # if custom jdk is used.
+      raise Fail(format("Unable to access {java_exec}. Confirm you have copied jdk to this host."))
+
+    jdk_curl_target = format("{tmp_dir}/{jdk_name}")
+    java_dir = os.path.dirname(params.java_home)
+
+    Directory(params.artifact_dir,
+              create_parents = True,
+              )
+
+    File(jdk_curl_target,
+         content = DownloadSource(format("{jdk_location}/{jdk_name}")),
+         not_if = format("test -f {jdk_curl_target}")
+         )
+
+    tmp_java_dir = tempfile.mkdtemp(prefix="jdk_tmp_", dir=params.tmp_dir)
+
+    try:
+      if params.jdk_name.endswith(".bin"):
+        chmod_cmd = ("chmod", "+x", jdk_curl_target)
+        install_cmd = format("cd {tmp_java_dir} && echo A | {jdk_curl_target} -noregister && {sudo} cp -rp {tmp_java_dir}/* {java_dir}")
+      elif params.jdk_name.endswith(".gz"):
+        chmod_cmd = ("chmod","a+x", java_dir)
+        install_cmd = format("cd {tmp_java_dir} && tar -xf {jdk_curl_target} && {sudo} cp -rp {tmp_java_dir}/* {java_dir}")
+
+      Directory(java_dir
+                )
+
+      Execute(chmod_cmd,
+              sudo = True,
+              )
+
+      Execute(install_cmd,
+              )
+
+    finally:
+      Directory(tmp_java_dir, action="delete")
+
+    File(format("{java_home}/bin/java"),
+         mode=0755,
+         cd_access="a",
+         )
+    Execute(('chmod', '-R', '755', params.java_home),
+            sudo = True,
+            )

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-START/scripts/hook.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-START/scripts/hook.py b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-START/scripts/hook.py
index c5600a3..cc24233 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-START/scripts/hook.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/hooks/before-START/scripts/hook.py
@@ -22,6 +22,7 @@ from resource_management.libraries.script import Hook
 class BeforeStartHook(Hook):
 
   def hook(self, env):
+    self.run_custom_hook('before-ANY')
     print "Before Start Hook"
 
 if __name__ == "__main__":

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/configuration/ams-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/configuration/ams-site.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/configuration/ams-site.xml
new file mode 100644
index 0000000..1dc66ea
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/configuration/ams-site.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<!--
+/**
+ *
+ * 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.
+ */
+-->
+<configuration>
+ <property>
+   <name>cluster.zookeeper.quorum</name>
+   <value>{{zookeeper_quorum_hosts}}</value>
+   <description>Comma separated list of servers in the cluster ZooKeeper Quorum.
+   </description>
+   <on-ambari-upgrade add="true"/>
+ </property>
+ <property>
+   <name>cluster.zookeeper.property.clientPort</name>
+   <value>{{zookeeper_clientPort}}</value>
+   <on-ambari-upgrade add="true"/>
+  </property>
+</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/metainfo.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/metainfo.xml
new file mode 100644
index 0000000..03a5ab5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/AMBARI_METRICS/metainfo.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+   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.
+-->
+<metainfo>
+    <schemaVersion>2.0</schemaVersion>
+    <services>
+        <service>
+            <name>AMBARI_METRICS</name>
+            <extends>common-services/AMBARI_METRICS/0.1.0</extends>
+        </service>
+    </services>
+</metainfo>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/alerts.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/alerts.json b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/alerts.json
index c30a53b1..b9c8976 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/alerts.json
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/alerts.json
@@ -1,7 +1,7 @@
 {
-    "FAKEZOOKEEPER": {
+    "ZOOKEEPER": {
 
-        "FAKEZOOKEEPER_SERVER": [
+        "ZOOKEEPER_SERVER": [
             {
                 "name": "zookeeper_server_process",
                 "label": "Zookeeper server Process",

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/kerberos.json b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/kerberos.json
index c8c55b7..0a64ea5 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/kerberos.json
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/kerberos.json
@@ -1,7 +1,7 @@
 {
   "services": [
     {
-      "name": "FAKEZOOKEEPER",
+      "name": "ZOOKEEPER",
       "identities": [
         {
           "name": "/smokeuser"
@@ -9,7 +9,7 @@
       ],
       "components": [
         {
-          "name": "FAKEZOOKEEPER_SERVER",
+          "name": "ZOOKEEPER_SERVER",
           "identities": [
             {
               "name": "zookeeper_zk",

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/metainfo.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/metainfo.xml b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/metainfo.xml
index 366ff6e..38bc3c2 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/metainfo.xml
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/metainfo.xml
@@ -19,7 +19,8 @@
   <schemaVersion>2.0</schemaVersion>
   <services>
     <service>
-      <name>FAKEZOOKEEPER</name>
+      <!-- Note : Service and Component Names are original (not fake) to facilitate AMS dependency on Zk. No Zk Install is done -->
+      <name>ZOOKEEPER</name>
       <version>3.4.6.2.3</version>
       <displayName>FAKEZOOKEEPER</displayName>
       <comment>Centralized service which provides highly reliable distributed coordination</comment>
@@ -27,7 +28,7 @@
       <!-- Overwrite the commandScript for each of the components. -->
       <components>
         <component>
-          <name>FAKEZOOKEEPER_SERVER</name>
+          <name>ZOOKEEPER_SERVER</name>
           <displayName>FAKEZooKeeper Server</displayName>
           <category>MASTER</category>
           <cardinality>1+</cardinality>
@@ -40,7 +41,7 @@
         </component>
 
         <component>
-          <name>FAKEZOOKEEPER_CLIENT</name>
+          <name>ZOOKEEPER_CLIENT</name>
           <displayName>FAKEZooKeeper Client</displayName>
           <category>CLIENT</category>
           <cardinality>1+</cardinality>

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_client.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_client.py
index 78cee4d..25b2409 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_client.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_client.py
@@ -32,7 +32,7 @@ class ZookeeperClient(Dummy):
 
   def __init__(self):
     super(ZookeeperClient, self).__init__()
-    self.component_name = "FAKEZOOKEEPER_CLIENT"
+    self.component_name = "ZOOKEEPER_CLIENT"
 
 if __name__ == "__main__":
   ZookeeperClient().execute()

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_server.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_server.py
index 4373205..6ab88bb 100644
--- a/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_server.py
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/FAKEZOOKEEPER/package/scripts/zookeeper_server.py
@@ -32,7 +32,7 @@ class ZookeeperServer(Dummy):
 
   def __init__(self):
     super(ZookeeperServer, self).__init__()
-    self.component_name = "FAKEZOOKEEPER_SERVER"
+    self.component_name = "ZOOKEEPER_SERVER"
     self.principal_conf_name = "zookeeper-env"
     self.principal_name = "zookeeper_principal_name"
     self.keytab_conf_name = "zookeeper-env"

http://git-wip-us.apache.org/repos/asf/ambari/blob/6e2a2855/ambari-server/src/main/resources/stacks/PERF/1.0/services/stack_advisor.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/PERF/1.0/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/PERF/1.0/services/stack_advisor.py
new file mode 100644
index 0000000..43d417e
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/PERF/1.0/services/stack_advisor.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env ambari-python-wrap
+"""
+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.
+"""
+
+# Python Imports
+
+# Local Imports
+from resource_management.core.logger import Logger
+from stack_advisor import DefaultStackAdvisor
+
+
+class PERF10StackAdvisor(DefaultStackAdvisor):
+
+  def __init__(self):
+    super(PERF10StackAdvisor, self).__init__()
+    Logger.initialize_logger()
+
+  def getServiceConfigurationRecommenderDict(self):
+    return {}
+
+  def getServiceConfigurationValidators(self):
+    return {}
\ No newline at end of file


[29/51] [abbrv] ambari git commit: AMBARI-19878 Log Search Portal time zone selection bug (mgergely)

Posted by rz...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/e3b9ef3c/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/timezone/WorldMapGenerator.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/timezone/WorldMapGenerator.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/timezone/WorldMapGenerator.js
deleted file mode 100644
index 3462ce8..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/timezone/WorldMapGenerator.js
+++ /dev/null
@@ -1,3471 +0,0 @@
-/**
- * @version: 1.0.1
- * @author: Keval Bhatt 
- * @copyright: Copyright (c) 2015 Keval Bhatt. All rights reserved.
- * @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
- * @website: http://kevalbhatt.github.io/WorldMapGenerator/
- */
-'use strict';
-(function(root, factory) {
-
-    if (typeof define === 'function' && define.amd) {
-        define(['moment', 'jquery'], function(momentjs, $) {
-            root.worldMapTime = {};
-            factory(momentjs, $, root.worldMapTime);
-        });
-
-    } else {
-        if ((typeof root.moment == "undefined")) {
-            var moment = false;
-            console.log('Day light feature requires moment.js')
-        } else {
-            if (!(root.moment.tz)) {
-                throw new Error('moment-timezone dependency not found');
-            }
-        }
-        if ((root.jQuery != "undefined" || root.Zepto != "undefined" || root.ender != "undefined" || root.$ != "undefined")) {
-            var c = root.worldMapTime = {};
-            factory(root.moment || moment, (root.jQuery || root.Zepto || root.ender || root.$), c);
-        } else {
-            throw new Error('jQuery dependnecy not found');
-        }
-
-    }
-
-}(this, function(moment, $, getTimeZoneObjct) {
-    var findValue = function(key, value) {
-        var referObj = [];
-        var obj = WorldMapGenerator.timeZoneValue.filter(function(object) {
-            if (object[key] === value) {
-                referObj.push($.extend(true, {},object));
-                return object;
-            }
-        });
-        for(var i=0;i<referObj.length;i++){
-           delete referObj[i].points;
-           delete referObj[i].pin;
-        }
-        return referObj;
-    }
-    getTimeZoneObjct['getSystemTimezone'] = function() {
-        /* var d = new Date()
-         var n = d.getTimezoneOffset();
-         var offset = (-(n))/60*/
-        var zoneAbr = new Date().toString().split('(')[1].slice(0, -1)
-        return findValue('zoneName', zoneAbr)
-    }
-    getTimeZoneObjct['getZoneName'] = function(zoneAbr) {
-        return findValue('zoneName', zoneAbr).zoneName
-    }
-    getTimeZoneObjct['getTimeZoneString'] = function(zoneAbr) {
-        return findValue('zoneName', zoneAbr).timezone
-    }
-    getTimeZoneObjct['getTimeZoneObject'] = function(zoneAbr) {
-        return findValue('zoneName', zoneAbr)
-    }
-
-
-    var WorldMapGenerator = function(element, options) {
-        this.$el = element;
-        this.generateMap(options);
-    }
-
-    WorldMapGenerator.VERSION = '1.0.1';
-
-    WorldMapGenerator.DEFAULTS = {
-        width: 500,
-        height: 250,
-        hoverColor: '#5A5A5A',
-        selectedColor: '#496A84',
-        mapColor: '#BBB',
-        defaultCss: true,
-        localStore: true,
-        quickLink: [{
-            "IST": "IST",
-            "EAT": "EAT"
-        }],
-        selectBox: true,
-        showHoverText: true,
-        dayLightSaving: ((typeof moment == "function") ? (true) : (false))
-    };
-
-    WorldMapGenerator.prototype = {
-
-        constructor: WorldMapGenerator,
-
-        /**
-         * [setValue set value in map]
-         * @param {[type]} value        [attribute value]
-         * @param {[type]} attribute         [attribute name]
-         */
-        setValue: function(value, attribute) {
-
-            this.$el.find('svg polygon').attr('data-selected', 'false');
-            var elements = this.$el.find('svg polygon[data-' + ((attribute) ? (attribute) : ("timezone")) + '="' + value + '"]');
-
-            if (elements && elements.length) {
-                elements.attr('data-selected', 'true');
-                this.$el.find('select option[value="' + ((attribute) ? (elements.attr('data-timeZone')) : (value)) + '"]').prop('selected', true);
-                this.$el.find('.quickLink span').removeClass('active');
-                var findQuickLink = this.$el.find('.quickLink span[data-select="' + value + '"]');
-                this.$el.find('.quickLink span[data-select="' + value + '"]').addClass('active');
-                this.$el.find('.quickLink span[data-select="' + elements.attr('data-zonename') + '"]').addClass('active');
-
-            }
-        },
-        /**
-         * [getValue get selected value array]
-         * @return {[type]} [description]
-         */
-        getValue: function() {
-            var value = [];
-            this.$el.find('svg polygon[data-selected="true"]').map(function(index, el) {
-                value.push($(el).data());
-            });
-            return value;
-        },
-        /**
-         * [generateMap create element dynamically]
-         * @param  {[type]} options [depanding on option it will create e]
-         * @return {[type]}         [description]
-         */
-        generateMap: function(options) {
-
-            var polygon = [],
-                option = [],
-                quickLink = [],
-                containerArr = [],
-                timezone = WorldMapGenerator.timeZoneValue;
-            for (var index in timezone) {
-                polygon.push(this.genrateElement('polygon', {
-                    'data-timezone': timezone[index].timezone,
-                    'data-country': timezone[index].country,
-                    'data-pin': timezone[index].pin,
-                    'data-offset': timezone[index].offset,
-                    'points': timezone[index].points,
-                    'data-zonename': ((options.dayLightSaving) ? (moment().tz(timezone[index].timezone).zoneName()) : (timezone[index].zoneName))
-                }, false, true));
-                option.push(this.genrateElement('option', {
-                    'value': timezone[index].timezone
-                }, timezone[index].timezone + " (" + ((options.dayLightSaving) ? (moment().tz(timezone[index].timezone).zoneName()) : (timezone[index].zoneName)) + ")"));
-            }
-            if (options.selectBox) {
-                var select = this.genrateElement('select', {
-                    'class': 'mapDropDown dropdown-toggle',
-                }, option);
-                containerArr.push(select);
-            }
-
-
-            if (options.quickLink.length > 0) {
-                for (var index in options.quickLink[0]) {
-                    quickLink.push(this.genrateElement('span', {
-                        'data-select': options.quickLink[0][index]
-                    }, index));
-                }
-                var qickLinkDiv = this.genrateElement('div', {
-                    'class': 'quickLink'
-                }, quickLink);
-                containerArr.push(qickLinkDiv);
-            }
-
-
-
-            var svg = this.genrateElement('svg', {
-                'class': 'timezone-map',
-                'viewBox': '0 0 ' + options.width + ' ' + options.height
-            }, polygon, true);
-
-            if (containerArr.length > 0) {
-                var container = this.genrateElement('div', {
-                    'class': 'Cbox'
-                }, containerArr);
-                this.$el.append(container);
-
-            }
-            this.$el.append(svg);
-
-            if (options.showHoverText) {
-                var hoverZone = this.genrateElement('span', {
-                    'class': 'hoverZone',
-                });
-                this.$el.append(hoverZone);
-            }
-
-
-
-            if (options.defaultCss) {
-                this.createCss(options);
-            }
-            this.bindEvent(options);
-
-        },
-        /**
-         * [bindEvent bind all event i.e click,mouseenter,mouseleave,change(select)]
-         * @return {[type]} [description]
-         */
-        bindEvent: function() {
-            var that = this;
-            this.$el.on('mouseenter', 'svg polygon', function(e) {
-                var d = $(this).data();
-                $('.timezone-map polygon[data-zonename="' + d.zonename + '"]').attr('class', 'active');
-                that.$el.find('.hoverZone').text(d.timezone + " (" + d.zonename + ")");
-            });
-            this.$el.on('mouseleave', 'svg polygon', function(e) {
-                $('.timezone-map polygon').attr('class', '');
-                that.$el.find('.hoverZone').text('');
-            });
-            this.$el.on('click', 'svg polygon', function() {
-
-                that.setValue($(this).attr('data-timezone'));
-                that.$el.trigger("map:clicked");
-
-            });
-            this.$el.on('change', 'select', function() {
-                that.setValue($(this).val());
-                that.$el.trigger("map:clicked");
-            });
-            this.$el.on('click', '.quickLink span', function() {
-                var selectValue = $(this).data().select
-                if (selectValue.search('/') > 0) {
-                    that.setValue(selectValue, 'timezone');
-                } else {
-                    that.setValue(selectValue, 'zonename');
-                }
-                that.$el.trigger("map:clicked");
-            });
-        },
-        /**
-         * [genrateElement description]
-         * @param  {[Jquery Object]}  element     [selector]
-         * @param  {[type]}  elementAttr [description]
-         * @param  {[javascript Object or text]}  chilled      [If we pass javascript object or  array it will append all chilled and if you pass string it will add string(value) inside element ]
-         * @param  {Boolean} isSvg       [If it is svg then it will create svg element]
-         * @return {[type]}              [description]
-         */
-        genrateElement: function(element, elementAttr, chilled, isSvg) {
-
-
-            if (isSvg) {
-                var elementObject = document.createElementNS('http://www.w3.org/2000/svg', element);
-            } else {
-                var elementObject = document.createElement(element);
-            }
-            if (elementAttr) {
-                for (var key in elementAttr) {
-                    elementObject.setAttribute(key, elementAttr[key]);
-                }
-            }
-            if (chilled) {
-                if (chilled instanceof Array) {
-                    for (var chilleds in chilled) {
-                        elementObject.appendChild(chilled[chilleds]);
-                    }
-                } else if (typeof chilled == 'string') {
-                    elementObject.innerHTML = chilled;
-                } else {
-                    elementObject.appendChild(chilled);
-                }
-
-            }
-
-            return elementObject;
-
-        },
-        /**
-         * [createCss function will create css dynamically it is insert style attribute in  in head ]
-         * @param  {[type]} options [options has mapColor,selectedColor,hoverColor ]
-         * @return {[type]}         [description]
-         */
-        createCss: function(options) {
-            var style = document.createElement('style');
-            style.type = 'text/css';
-            style.innerHTML = '.timezone-map polygon[data-selected="true"] {fill: ' + options.selectedColor + '}' +
-                '.timezone-map polygon { fill: ' + options.mapColor + ';}' +
-                '.timezone-map polygon.active {fill: ' + options.hoverColor + ';}' +
-                '.timezone-map polygon:hover { cursor: pointer;}' +
-                '.Cbox .quickLink{width: 52%;float: right;padding-bottom: 11px;overflow-x: auto; white-space: nowrap;overflow-y: hidden;}' +
-                '.Cbox .quickLink span:hover {color:#FFF;background-color: #496A84;  cursor: pointer;}' +
-                '.Cbox select{width: 45%;float: left;height: 27px; padding: 0px 0px 0px 10px;}' +
-                '.Cbox .quickLink span.active {color: #FFF; background-color: #496A84;}' +
-                '.Cbox .quickLink span{ font-weight: 300; border-radius: 3px; color: #000; background-color: #FFF; border: solid 1px #CCC;margin-left: 10px;' +
-                'font-size: 9px;padding: 4px 6px 4px 6px;}';
-            document.getElementsByTagName('head')[0].appendChild(style);
-
-        }
-    };
-    /**
-     * [Plugin Staring point for plugin]
-     * @param {[type]} option [user options which can be override the default options]
-     */
-    function Plugin(option) {
-
-        return this.each(function() {
-            var $el = $(this)
-            var options = $.extend({}, WorldMapGenerator.DEFAULTS, $el.data(), typeof option == 'object' && option);
-            $el.data('WorldMapGenerator', new WorldMapGenerator($el, options));
-            $el.trigger("map:loaded");
-        });
-    };
-
-    $.fn.WorldMapGenerator = Plugin;
-
-    WorldMapGenerator.timeZoneValue = [{
-        "timezone": "Africa/Abidjan",
-        "country": "CI",
-        "pin": "244,118",
-        "offset": 0,
-        "points": "241,118,240,119,240,117,238,116,238,115,239,114,239,113,239,113,239,111,241,110,241,111,243,111,244,112,246,111,247,113,245,116,246,118,241,118",
-        "zoneName": "GMT"
-    }, {
-        "timezone": "Africa/Accra",
-        "country": "GH",
-        "pin": "250,117",
-        "offset": 0,
-        "points": "251,117,247,118,246,118,246,118,246,116,247,114,246,110,250,110,251,113,251,116,252,116,251,117",
-        "zoneName": "GMT"
-    }, {
-        "timezone": "Africa/Addis_Ababa",
-        "country": "ET",
-        "pin": "304,112",
-        "offset": 3,
-        "points": "313,118,311,118,308,120,307,119,305,120,300,119,299,116,296,114,296,113,297,113,298,110,299,110,300,107,300,107,301,105,302,105,303,104,303,105,307,105,309,108,308,110,310,110,309,110,310,112,317,114,313,118",
-        "zoneName": "EAT"
-    }, {
-        "timezone": "Africa/Algiers",
-        "country": "DZ",
-        "pin": "254,74",
-        "offset": 1,
-        "points": "263,83,264,86,264,88,263,89,264,91,266,91,267,92,258,98,255,99,254,97,252,97,250,95,238,87,238,85,239,85,243,83,243,82,245,82,245,81,246,81,246,80,248,80,249,80,248,79,248,77,247,76,254,74,262,74,261,74,262,77,260,78,263,81,263,83",
-        "zoneName": "CET"
-    }, {
-        "timezone": "Africa/Asmara",
-        "country": "ER",
-        "pin": "304,104",
-        "offset": 3,
-        "points": "306,104,310,107,309,108,306,105,303,105,303,104,302,105,301,105,301,101,304,100,305,104,305,103,306,104",
-        "zoneName": "EAT"
-    }, {
-        "timezone": "Africa/Bamako",
-        "country": "ML",
-        "pin": "239,107",
-        "offset": 0,
-        "points": "244,107,244,108,242,109,242,111,241,111,241,110,240,111,239,110,239,111,238,110,238,110,238,109,237,108,235,108,234,108,234,107,233,105,234,103,235,104,237,103,242,103,241,90,243,90,252,96,252,97,254,97,255,99,256,98,256,101,255,104,249,104,246,105,245,107,244,106,244,107",
-        "zoneName": "GMT"
-    }, {
-        "timezone": "Africa/Bangui",
-        "country": "CF",
-        "pin": "276,119",
-        "offset": 1,
-        "points": "284,118,283,119,282,118,281,119,277,118,276,119,276,120,273,120,272,122,270,119,270,117,272,115,276,114,276,113,278,112,280,110,281,110,283,111,283,113,284,113,284,113,285,114,288,118,285,118,285,118,284,118",
-        "zoneName": "WAT"
-    }, {
-        "timezone": "Africa/Banjul",
-        "country": "GM",
-        "pin": "227,106",
-        "offset": 0,
-        "points": "231,106,227,106,229,106,231,106",
-        "zoneName": "GMT"
-    }, {
-        "timezone": "Africa/Bissau",
-        "country": "GW",
-        "pin": "228,109",
-        "offset": 0,
-        "points": "228,109,228,109,228,109",
-        "zoneName": "GMT"
-    }, {
-        "timezone": "Africa/Blantyre",
-        "country": "MW",
-        "pin": "299,147",
-        "offset": 2,
-        "points": "298,144,300,146,299,149,298,147,298,145,297,145,295,144,297,142,296,140,297,140,296,138,298,139,299,141,298,142,298,144",
-        "zoneName": "CAT"
-    }, {
-        "timezone": "Africa/Brazzaville",
-        "country": "CG",
-        "pin": "271,131",
-        "offset": 1,
-        "points": "266,131,267,130,266,128,267,128,268,128,270,128,270,128,270,126,269,125,270,124,269,123,268,123,268,122,272,123,273,120,276,120,275,126,273,128,272,130,270,132,270,131,269,132,268,131,267,132,266,131",
-        "zoneName": "WAT"
-    }, {
-        "timezone": "Africa/Bujumbura",
-        "country": "BI",
-        "pin": "291,130",
-        "offset": 2,
-        "points": "292,131,291,131,290,129,291,129,292,128,292,128,293,130,292,131",
-        "zoneName": "CAT"
-    }, {
-        "timezone": "Asia/Oral",
-        "country": "KZ",
-        "pin": "321,54",
-        "offset": 5,
-        "points": "316,55,317,56,318,56,317,55,319,54,320,53,323,53,326,54,326,56,323,58,321,57,319,58,315,58,316,55",
-        "zoneName": "ORAT"
-    }, {
-        "timezone": "Africa/Cairo",
-        "country": "EG",
-        "pin": "293,83",
-        "offset": 2,
-        "points": "294,94,285,94,284,83,285,81,290,82,293,81,294,81,295,82,298,82,298,84,298,86,296,85,295,83,295,84,300,92,299,92,299,93,297,95,294,94",
-        "zoneName": "EET"
-    }, {
-        "timezone": "Africa/Casablanca",
-        "country": "MA",
-        "pin": "239,78",
-        "offset": 0,
-        "points": "242,84,240,84,238,85,238,87,232,87,236,84,237,83,236,81,237,80,241,78,242,75,243,75,244,76,246,76,248,77,248,80,246,80,246,81,245,81,245,82,243,82,242,84",
-        "zoneName": "WET"
-    }, {
-        "timezone": "Africa/Ceuta",
-        "country": "ES",
-        "pin": "243,75",
-        "offset": 1,
-        "points": "243,75,243,75,243,75",
-        "zoneName": "CET"
-    }, {
-        "timezone": "Africa/Conakry",
-        "country": "GN",
-        "pin": "231,112",
-        "offset": 0,
-        "points": "238,114,237,115,236,113,235,114,235,113,234,111,233,111,232,112,231,111,230,110,229,109,231,109,231,107,234,108,235,108,237,108,238,109,238,110,238,110,239,111,239,112,239,113,239,113,239,114,238,114",
-        "zoneName": "GMT"
-    }, {
-        "timezone": "Africa/Dakar",
-        "country": "SN",
-        "pin": "226,105",
-        "offset": 0,
-        "points": "227,107,229,106,231,106,229,106,227,106,226,105,227,102,230,102,233,105,234,108,229,107,227,108,227,108,227,108,227,107",
-        "zoneName": "GMT"
-    }, {
-        "timezone": "Africa/Dar_es_Salaam",
-        "country": "TZ",
-        "pin": "305,134",
-        "offset": 3,
-        "points": "306,139,306,139,306,140,302,141,299,141,297,138,293,137,291,134,291,132,293,130,292,129,293,128,292,126,297,126,302,129,302,130,304,131,304,134,305,135,305,137,306,139",
-        "zoneName": "EAT"
-    }, {
-        "timezone": "Asia/Yekaterinburg",
-        "country": "RU",
-        "pin": "334,46",
-        "offset": 6,
-        "points": "333,53,335,54,335,54,333,55,331,54,329,54,327,55,326,54,326,55,324,53,321,53,322,51,322,50,324,50,325,49,324,48,325,48,324,47,326,47,325,46,326,46,325,44,325,43,324,43,325,42,323,41,322,40,326,40,329,40,332,39,333,35,342,31,341,31,342,31,341,31,341,30,340,29,342,29,342,29,341,29,345,30,346,29,345,28,343,28,344,28,344,27,343,27,345,25,346,24,351,24,350,26,351,27,351,27,351,29,352,30,350,32,346,32,346,33,350,33,354,31,353,30,356,29,357,30,357,31,358,31,361,32,358,31,359,30,358,29,353,29,352,28,353,27,351,26,354,25,354,24,355,25,354,26,355,26,359,27,356,25,358,25,357,25,358,25,362,25,360,26,362,26,362,27,360,28,365,29,365,30,364,31,364,31,364,32,366,32,366,34,367,34,367,35,369,35,369,36,368,37,369,37,367,39,369,40,369,40,364,41,357,40,356,42,353,44,349,44,348,44,348,45,350,46,348,47,348,48,346,48,341,50,335,50,335,51,336,51,335,51,334,52,335,52,333,53",
-        "zoneName": "YEKT"
-    }, {
-        "timezone": "Africa/Djibouti",
-        "country": "DJ",
-        "pin": "310,109",
-        "offset": 3,
-        "points": "310,109,310,109,310,109",
-        "zoneName": "EAT"
-    }, {
-        "timezone": "Africa/Douala",
-        "country": "CM",
-        "pin": "263,119",
-        "offset": 1,
-        "points": "270,117,270,119,272,121,272,123,270,122,264,122,263,119,263,120,262,119,262,117,264,116,265,115,266,116,266,115,269,110,270,109,270,107,271,107,271,110,272,111,269,112,272,114,270,117",
-        "zoneName": "WAT"
-    }, {
-        "timezone": "Africa/Freetown",
-        "country": "SL",
-        "pin": "232,113",
-        "offset": 0,
-        "points": "235,115,234,115,232,114,232,112,233,111,234,111,235,112,235,114,236,114,235,115",
-        "zoneName": "GMT"
-    }, {
-        "timezone": "Africa/Gaborone",
-        "country": "BW",
-        "pin": "286,159",
-        "offset": 2,
-        "points": "287,158,285,161,282,160,281,162,279,162,279,161,278,159,278,156,279,156,279,150,282,150,283,151,285,150,286,152,289,153,289,155,291,156,287,158",
-        "zoneName": "CAT"
-    }, {
-        "timezone": "Africa/Harare",
-        "country": "ZW",
-        "pin": "293,150",
-        "offset": 2,
-        "points": "293,156,289,155,289,153,286,152,285,150,288,150,291,147,296,148,295,151,296,153,295,155,293,156",
-        "zoneName": "CAT"
-    }, {
-        "timezone": "Africa/El_Aaiun",
-        "country": "EH",
-        "pin": "232,87",
-        "offset": 0,
-        "points": "233,89,233,92,232,93,232,95,227,95,226,96,226,95,228,92,228,92,229,91,230,89,231,88,232,87,238,87,238,89,233,89",
-        "zoneName": "WET"
-    }, {
-        "timezone": "Africa/Johannesburg",
-        "country": "ZA",
-        "pin": "289,161",
-        "offset": 2,
-        "points": "283,172,278,173,276,172,276,173,275,171,275,170,275,169,273,165,274,164,274,165,275,165,278,164,278,159,279,161,279,162,280,162,282,160,285,161,288,158,290,156,293,156,294,159,294,161,294,161,293,162,294,163,294,163,294,162,296,162,295,165,289,171,286,172,283,172",
-        "zoneName": "SAST"
-    }, {
-        "timezone": "Africa/Juba",
-        "country": "SS",
-        "pin": "294,118",
-        "offset": 3,
-        "points": "299,117,299,118,300,118,300,119,298,119,297,120,293,120,291,119,289,119,289,119,287,116,284,113,285,111,286,111,287,112,290,112,292,111,293,111,295,110,295,108,296,108,296,110,297,111,297,113,296,113,296,114,297,115,299,117",
-        "zoneName": "EAT"
-    }, {
-        "timezone": "Africa/Kampala",
-        "country": "UG",
-        "pin": "295,125",
-        "offset": 3,
-        "points": "293,126,291,127,292,124,293,122,293,122,293,120,297,120,297,119,299,122,297,125,297,126,293,126",
-        "zoneName": "EAT"
-    }, {
-        "timezone": "Africa/Khartoum",
-        "country": "SD",
-        "pin": "295,103",
-        "offset": 3,
-        "points": "300,107,299,110,298,110,297,112,296,110,296,108,295,108,295,108,295,110,293,111,292,111,290,112,287,112,286,111,285,111,284,113,283,113,283,111,282,110,281,107,280,107,282,103,283,103,283,97,285,97,285,94,294,94,297,95,299,93,301,94,302,96,302,99,304,100,301,101,301,106,300,107,300,107",
-        "zoneName": "EAT"
-    }, {
-        "timezone": "Africa/Kinshasa",
-        "country": "CD",
-        "pin": "271,131",
-        "offset": 1,
-        "points": "271,131,272,130,273,128,275,126,276,119,277,118,277,118,279,119,283,120,281,120,283,122,281,122,281,123,283,125,282,126,283,126,282,126,284,127,281,128,281,128,281,128,279,128,279,131,278,131,278,135,277,135,277,136,274,136,273,133,267,133,268,131,269,132,270,131,270,132,271,131",
-        "zoneName": "WAT"
-    }, {
-        "timezone": "Africa/Lagos",
-        "country": "NG",
-        "pin": "255,116",
-        "offset": 1,
-        "points": "261,119,258,119,256,116,254,116,254,112,255,110,255,109,256,106,258,106,260,107,261,106,263,107,265,106,267,107,269,106,270,108,270,109,269,110,266,115,266,116,264,115,262,117,262,118,261,119",
-        "zoneName": "WAT"
-    }, {
-        "timezone": "Africa/Libreville",
-        "country": "GA",
-        "pin": "263,124",
-        "offset": 1,
-        "points": "269,125,270,126,270,128,267,128,267,128,266,128,267,130,266,131,263,128,262,126,263,126,263,125,264,125,263,124,263,124,266,124,266,122,268,122,268,123,270,123,270,124,269,125",
-        "zoneName": "WAT"
-    }, {
-        "timezone": "Africa/Lome",
-        "country": "TG",
-        "pin": "252,116",
-        "offset": 0,
-        "points": "252,116,251,116,251,113,250,110,251,110,251,111,252,111,253,116,252,116",
-        "zoneName": "GMT"
-    }, {
-        "timezone": "Africa/Kigali",
-        "country": "RW",
-        "pin": "292,128",
-        "offset": 2,
-        "points": "292,128,291,129,290,129,291,127,292,126,293,128,292,128",
-        "zoneName": "CAT"
-    }, {
-        "timezone": "Africa/Luanda",
-        "country": "AO",
-        "pin": "268,137",
-        "offset": 1,
-        "points": "281,140,281,141,283,140,283,143,281,143,281,148,283,149,279,150,276,149,269,149,268,149,266,149,267,144,269,142,269,140,268,138,269,137,267,133,273,133,274,136,277,136,277,135,280,135,280,138,281,140",
-        "zoneName": "WAT"
-    }, {
-        "timezone": "Africa/Lubumbashi",
-        "country": "CD",
-        "pin": "288,141",
-        "offset": 2,
-        "points": "291,132,291,134,293,136,290,137,289,138,290,139,289,141,290,142,291,142,291,144,290,144,288,141,287,142,286,142,285,141,284,141,283,140,281,141,280,135,278,135,277,134,278,133,278,131,279,131,279,128,281,128,281,128,281,128,284,127,282,126,283,126,282,126,283,125,281,123,281,122,283,122,281,120,283,120,281,119,282,118,285,118,285,118,288,118,289,119,291,119,293,120,293,122,293,122,292,124,291,127,290,128,291,132",
-        "zoneName": "CAT"
-    }, {
-        "timezone": "Africa/Lusaka",
-        "country": "ZM",
-        "pin": "289,146",
-        "offset": 2,
-        "points": "290,147,290,148,287,150,284,149,283,149,281,148,281,143,283,143,283,140,284,141,285,141,286,142,287,142,288,141,290,144,291,144,291,142,290,142,289,141,290,139,289,138,290,137,293,136,296,138,297,140,296,140,297,142,295,144,296,144,292,146,292,147,290,147",
-        "zoneName": "CAT"
-    }, {
-        "timezone": "Africa/Malabo",
-        "country": "GQ",
-        "pin": "262,120",
-        "offset": 1,
-        "points": "266,123,266,124,263,123,264,122,266,122,266,123",
-        "zoneName": "WAT"
-    }, {
-        "timezone": "Africa/Maputo",
-        "country": "MZ",
-        "pin": "295,161",
-        "offset": 2,
-        "points": "296,160,295,161,295,162,296,161,296,162,295,162,294,159,293,156,295,155,296,153,295,151,296,148,292,147,292,146,296,144,297,145,298,145,298,146,298,147,299,149,300,146,298,144,298,141,302,141,306,140,306,146,305,148,303,149,300,151,298,152,298,154,299,156,299,158,296,160",
-        "zoneName": "CAT"
-    }, {
-        "timezone": "Africa/Mbabane",
-        "country": "SZ",
-        "pin": "293,162",
-        "offset": 2,
-        "points": "294,161,295,162,294,163,293,162,294,161,294,161",
-        "zoneName": "SAST"
-    }, {
-        "timezone": "Africa/Mogadishu",
-        "country": "SO",
-        "pin": "313,122",
-        "offset": 3,
-        "points": "310,125,308,127,307,126,307,121,308,119,312,118,317,114,311,113,309,110,310,109,312,111,321,109,321,111,321,111,321,111,321,112,317,119,310,125",
-        "zoneName": "EAT"
-    }, {
-        "timezone": "Africa/Monrovia",
-        "country": "LR",
-        "pin": "235,116",
-        "offset": 0,
-        "points": "239,118,240,119,238,119,234,116,236,113,237,113,237,115,238,115,238,114,239,115,238,116,240,117,239,118",
-        "zoneName": "GMT"
-    }, {
-        "timezone": "Africa/Nairobi",
-        "country": "KE",
-        "pin": "301,127",
-        "offset": 3,
-        "points": "308,127,306,129,304,131,302,130,302,129,297,126,297,125,299,122,297,119,298,119,300,119,305,120,307,119,308,119,307,121,307,126,308,127",
-        "zoneName": "EAT"
-    }, {
-        "timezone": "Africa/Maseru",
-        "country": "LS",
-        "pin": "288,166",
-        "offset": 2,
-        "points": "289,167,289,167,288,166,290,165,291,166,289,167",
-        "zoneName": "SAST"
-    }, {
-        "timezone": "Africa/Ndjamena",
-        "country": "TD",
-        "pin": "271,108",
-        "offset": 1,
-        "points": "278,112,276,113,276,114,272,115,269,112,270,111,272,111,271,110,271,107,270,107,269,105,272,102,272,97,271,95,271,93,272,92,283,98,283,103,282,103,280,107,281,107,282,110,280,110,279,112,278,112",
-        "zoneName": "WAT"
-    }, {
-        "timezone": "Africa/Niamey",
-        "country": "NE",
-        "pin": "253,106",
-        "offset": 1,
-        "points": "256,106,255,108,255,109,254,108,253,108,253,107,251,107,252,106,251,106,250,104,255,104,256,101,256,98,258,98,267,92,270,94,271,93,271,95,272,97,272,102,269,105,269,106,267,107,265,106,263,107,261,106,260,107,258,106,256,106",
-        "zoneName": "WAT"
-    }, {
-        "timezone": "Africa/Nouakchott",
-        "country": "MR",
-        "pin": "228,100",
-        "offset": 0,
-        "points": "234,103,233,105,230,102,227,102,227,103,228,100,227,98,228,97,227,95,226,96,232,95,232,93,233,92,233,89,238,89,238,87,243,90,241,90,242,103,237,103,235,104,234,103",
-        "zoneName": "GMT"
-    }, {
-        "timezone": "Africa/Ouagadougou",
-        "country": "BF",
-        "pin": "248,108",
-        "offset": 0,
-        "points": "249,110,246,110,246,112,246,111,243,112,242,111,242,109,244,108,244,106,245,107,247,105,250,104,250,104,251,106,252,106,251,107,253,107,253,109,252,110,249,110",
-        "zoneName": "GMT"
-    }, {
-        "timezone": "Africa/Porto-Novo",
-        "country": "BJ",
-        "pin": "254,116",
-        "offset": 1,
-        "points": "254,114,254,116,252,116,252,112,251,111,252,109,253,109,254,108,255,109,255,110,254,112,254,114",
-        "zoneName": "WAT"
-    }, {
-        "timezone": "Africa/Tunis",
-        "country": "TN",
-        "pin": "264,74",
-        "offset": 1,
-        "points": "266,80,264,81,264,82,263,83,263,80,261,79,260,78,262,76,261,74,263,73,264,73,264,74,265,74,265,75,266,76,264,78,266,79,266,80",
-        "zoneName": "CET"
-    }, {
-        "timezone": "Africa/Sao_Tome",
-        "country": "ST",
-        "pin": "259,125",
-        "offset": 0,
-        "points": "260,123,260,123,260,123",
-        "zoneName": "GMT"
-    }, {
-        "timezone": "Africa/Tripoli",
-        "country": "LY",
-        "pin": "268,79",
-        "offset": 2,
-        "points": "285,88,285,97,283,97,283,98,272,92,270,94,264,91,263,89,264,88,264,86,263,83,264,82,264,81,266,80,266,79,271,80,272,81,276,83,278,82,278,80,281,79,282,80,285,81,284,83,285,88",
-        "zoneName": "EET"
-    }, {
-        "timezone": "Africa/Windhoek",
-        "country": "NA",
-        "pin": "274,156",
-        "offset": 2,
-        "points": "278,163,278,164,277,165,274,165,274,164,273,165,272,164,271,162,270,156,267,151,266,149,268,149,269,149,276,149,279,150,284,149,285,150,283,151,282,150,279,150,279,156,278,156,278,163",
-        "zoneName": "WAST"
-    }, {
-        "timezone": "America/Adak",
-        "country": "US",
-        "pin": "5,53",
-        "offset": -10,
-        "points": "7,53,6,53,8,52,7,53",
-        "zoneName": "HST"
-    }, {
-        "timezone": "America/Argentina/Salta",
-        "country": "AR",
-        "pin": "159,159",
-        "offset": -3,
-        "points": "162,180,162,182,163,182,160,182,160,183,150,183,150,180,152,179,151,176,152,175,153,177,155,177,155,175,160,175,160,174,162,174,162,180",
-        "zoneName": "ART"
-    }, {
-        "timezone": "America/Argentina/Salta",
-        "country": "AR",
-        "pin": "159,159",
-        "offset": -3,
-        "points": "159,156,161,157,161,156,163,156,163,156,163,159,162,161,158,162,157,161,158,160,155,160,155,159,157,158,158,159,158,157,159,159,161,159,161,158,160,158,159,156",
-        "zoneName": "ART"
-    }, {
-        "timezone": "America/Anchorage",
-        "country": "US",
-        "pin": "42,40",
-        "offset": -9,
-        "points": "42,42,40,43,39,43,40,42,39,42,40,41,43,41,42,40,42,40,40,40,36,43,37,43,36,44,30,47,30,47,25,48,25,48,27,48,27,47,31,45,31,44,32,43,30,44,30,43,29,44,27,43,25,44,25,37,27,36,26,36,27,35,25,35,25,33,26,33,25,33,25,32,26,33,25,32,25,27,33,26,34,26,33,27,35,26,39,27,39,27,38,27,39,27,51,28,54,28,54,42,54,41,50,42,46,41,47,40,44,40,45,40,43,41,44,41,44,41,44,41,42,42",
-        "zoneName": "AKST"
-    }, {
-        "timezone": "America/Anguilla",
-        "country": "AI",
-        "pin": "162,100",
-        "offset": -4,
-        "points": "162,100,162,100,162,100",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Antigua",
-        "country": "AG",
-        "pin": "164,101",
-        "offset": -4,
-        "points": "164,101,164,101,164,101",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Araguaina",
-        "country": "BR",
-        "pin": "183,135",
-        "offset": -3,
-        "points": "185,136,185,136,185,138,186,139,185,141,186,141,186,143,184,143,182,143,182,142,181,143,180,143,180,142,180,143,180,140,182,137,182,135,183,134,183,133,183,132,184,133,184,135,185,136",
-        "zoneName": "BRT"
-    }, {
-        "timezone": "America/Argentina/Buenos_Aires",
-        "country": "AR",
-        "pin": "169,173",
-        "offset": -3,
-        "points": "167,171,169,172,169,173,171,174,170,175,171,176,169,178,165,179,163,179,164,180,163,180,163,181,164,181,163,182,162,182,162,173,164,173,165,172,167,171",
-        "zoneName": "ART"
-    }, {
-        "timezone": "America/Argentina/Catamarca",
-        "country": "AR",
-        "pin": "159,165",
-        "offset": -3,
-        "points": "159,188,157,188,156,189,151,189,151,188,150,187,151,187,150,187,151,186,150,184,160,183,161,184,161,183,162,184,160,184,161,185,159,186,159,188",
-        "zoneName": "ART"
-    }, {
-        "timezone": "America/Argentina/Catamarca",
-        "country": "AR",
-        "pin": "159,165",
-        "offset": -3,
-        "points": "160,167,158,164,154,164,155,162,155,160,158,160,157,161,159,162,158,163,159,164,159,164,160,167",
-        "zoneName": "ART"
-    }, {
-        "timezone": "America/Argentina/Cordoba",
-        "country": "AR",
-        "pin": "161,169",
-        "offset": -3,
-        "points": "163,173,162,173,162,174,160,174,160,170,159,169,159,168,160,166,159,164,161,161,162,161,163,159,163,156,165,158,170,160,169,163,173,163,174,162,174,161,175,161,175,163,173,164,170,167,169,172,166,171,164,173,163,173",
-        "zoneName": "ART"
-    }, {
-        "timezone": "America/Argentina/Jujuy",
-        "country": "AR",
-        "pin": "159,159",
-        "offset": -3,
-        "points": "157,157,158,155,159,156,159,157,160,158,161,158,161,159,160,159,159,159,158,157,158,159,157,158,157,157",
-        "zoneName": "ART"
-    }, {
-        "timezone": "America/Argentina/La_Rioja",
-        "country": "AR",
-        "pin": "157,166",
-        "offset": -3,
-        "points": "156,167,154,166,154,165,153,164,154,164,158,164,160,167,159,169,157,169,156,167",
-        "zoneName": "ART"
-    }, {
-        "timezone": "America/Argentina/Mendoza",
-        "country": "AR",
-        "pin": "154,171",
-        "offset": -3,
-        "points": "152,170,156,170,157,171,157,175,155,175,155,177,153,177,152,175,152,174,153,171,152,170",
-        "zoneName": "ART"
-    }, {
-        "timezone": "America/Argentina/Rio_Gallegos",
-        "country": "AR",
-        "pin": "154,197",
-        "offset": -3,
-        "points": "151,189,156,189,157,190,159,191,158,192,154,195,154,197,155,198,150,197,149,197,150,195,148,196,148,195,148,193,150,192,149,191,150,191,151,189",
-        "zoneName": "ART"
-    }, {
-        "timezone": "America/Argentina/San_Juan",
-        "country": "AR",
-        "pin": "155,169",
-        "offset": -3,
-        "points": "153,167,154,164,154,165,154,166,156,167,157,169,156,169,156,170,154,169,152,170,152,168,153,167",
-        "zoneName": "ART"
-    }, {
-        "timezone": "America/Argentina/San_Luis",
-        "country": "AR",
-        "pin": "158,171",
-        "offset": -3,
-        "points": "159,169,160,170,160,175,157,175,156,169,159,169",
-        "zoneName": "ART"
-    }, {
-        "timezone": "America/Argentina/Tucuman",
-        "country": "AR",
-        "pin": "159,162",
-        "offset": -3,
-        "points": "158,161,160,161,160,164,159,164,158,163,159,162,158,161",
-        "zoneName": "ART"
-    }, {
-        "timezone": "America/Aruba",
-        "country": "AW",
-        "pin": "153,108",
-        "offset": -4,
-        "points": "153,108,153,108,153,108",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Argentina/Ushuaia",
-        "country": "AR",
-        "pin": "155,201",
-        "offset": -3,
-        "points": "155,201,155,198,155,199,155,199,156,200,160,201,158,201,155,201",
-        "zoneName": "ART"
-    }, {
-        "timezone": "America/Asuncion",
-        "country": "PY",
-        "pin": "170,160",
-        "offset": -3,
-        "points": "174,161,173,163,169,163,170,160,165,158,163,156,164,152,167,152,169,152,169,156,172,156,173,158,175,158,174,161",
-        "zoneName": "PYST"
-    }, {
-        "timezone": "America/Bahia_Banderas",
-        "country": "MX",
-        "pin": "104,96",
-        "offset": -6,
-        "points": "104,96,103,96,104,96",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Atikokan",
-        "country": "CA",
-        "pin": "123,57",
-        "offset": -5,
-        "points": "125,58,122,58,123,57,124,57,124,58,125,58",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Bahia",
-        "country": "BR",
-        "pin": "197,143",
-        "offset": -2,
-        "points": "187,146,186,146,186,141,185,141,186,140,187,139,188,140,189,140,189,138,191,138,193,137,194,138,195,137,197,137,198,139,197,140,198,141,196,143,196,147,195,150,194,149,195,147,194,147,193,147,192,146,189,145,189,145,187,146",
-        "zoneName": "BRT"
-    }, {
-        "timezone": "America/Barbados",
-        "country": "BB",
-        "pin": "167,107",
-        "offset": -4,
-        "points": "167,106,167,107,167,106",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Belem",
-        "country": "BR",
-        "pin": "183,127",
-        "offset": -3,
-        "points": "179,126,180,125,179,126,180,125,183,125,182,127,180,128,182,127,181,128,183,127,183,126,186,127,185,130,182,132,183,133,182,135,182,137,180,139,177,138,178,138,177,136,178,134,177,132,177,130,178,129,177,127,178,127,177,126,176,123,174,122,174,122,177,122,178,119,180,122,181,123,179,126",
-        "zoneName": "BRT"
-    }, {
-        "timezone": "America/Belize",
-        "country": "BZ",
-        "pin": "128,101",
-        "offset": -6,
-        "points": "128,101,128,101,128,101",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Blanc-Sablon",
-        "country": "CA",
-        "pin": "171,54",
-        "offset": -4,
-        "points": "169,54,167,55,169,54",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Boa_Vista",
-        "country": "BR",
-        "pin": "166,121",
-        "offset": -4,
-        "points": "167,118,166,119,167,120,167,121,167,122,168,123,168,125,167,125,166,126,165,126,164,127,163,126,163,122,161,122,160,119,163,120,163,119,165,119,166,118,167,118",
-        "zoneName": "AMT"
-    }, {
-        "timezone": "America/Bogota",
-        "country": "CO",
-        "pin": "147,119",
-        "offset": -5,
-        "points": "154,126,153,131,152,130,153,129,152,128,150,128,149,128,146,125,142,124,140,123,143,120,142,119,143,117,142,115,143,114,143,113,143,114,143,113,145,112,145,110,148,109,150,108,151,108,149,110,148,112,149,113,149,115,150,115,153,115,154,117,156,117,156,119,157,120,156,121,157,122,157,123,156,122,153,123,153,124,154,124,153,124,154,126",
-        "zoneName": "COT"
-    }, {
-        "timezone": "America/Boise",
-        "country": "US",
-        "pin": "89,64",
-        "offset": -7,
-        "points": "96,66,96,67,87,67,87,66,86,66,86,64,87,63,88,62,88,61,89,62,92,62,93,63,96,63,96,66",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Cambridge_Bay",
-        "country": "CA",
-        "pin": "104,29",
-        "offset": -7,
-        "points": "99,18,100,19,99,19,101,19,100,20,102,19,104,20,103,21,97,21,97,20,99,20,97,20,98,19,97,19,99,18",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Cambridge_Bay",
-        "country": "CA",
-        "pin": "104,29",
-        "offset": -7,
-        "points": "108,36,97,35,95,34,92,34,81,30,81,28,89,29,92,30,89,31,90,31,97,31,100,32,99,32,101,33,100,32,101,32,101,32,101,32,100,31,103,30,99,30,100,30,103,29,105,31,106,30,109,31,113,31,113,30,115,30,116,30,116,31,117,30,116,31,118,32,117,30,120,30,120,30,120,29,119,30,120,28,116,28,117,27,116,27,116,26,119,25,118,25,120,25,121,26,121,27,123,28,122,27,121,28,122,28,121,28,125,29,123,29,124,29,124,30,125,30,126,29,126,32,108,32,108,36",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Cambridge_Bay",
-        "country": "CA",
-        "pin": "104,29",
-        "offset": -7,
-        "points": "115,24,116,24,116,25,116,25,114,25,114,26,113,26,107,24,111,24,110,23,115,24",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Cambridge_Bay",
-        "country": "CA",
-        "pin": "104,29",
-        "offset": -7,
-        "points": "100,23,103,24,105,26,105,26,110,27,110,28,106,28,107,28,107,29,108,28,109,29,107,29,104,29,104,29,102,28,99,30,93,30,92,29,93,29,88,29,87,28,97,28,97,24,99,24,100,26,101,25,100,23,100,23",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Campo_Grande",
-        "country": "BR",
-        "pin": "174,153",
-        "offset": -3,
-        "points": "176,150,177,151,179,152,179,153,175,158,173,158,172,156,169,156,170,150,172,149,173,150,175,149,175,150,176,150",
-        "zoneName": "AMST"
-    }, {
-        "timezone": "America/Cancun",
-        "country": "MX",
-        "pin": "129,96",
-        "offset": -6,
-        "points": "128,95,130,96,128,98,129,98,128,100,128,99,127,100,126,100,126,98,128,96,128,95",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Caracas",
-        "country": "VE",
-        "pin": "157,110",
-        "offset": -4.5,
-        "points": "163,111,165,112,165,113,167,113,166,115,166,115,165,116,165,117,166,118,163,119,163,120,160,119,161,122,162,122,159,124,159,124,158,124,157,123,157,122,156,121,157,120,156,119,156,116,154,117,153,115,150,115,149,112,148,112,149,110,151,109,150,109,151,110,150,111,150,112,151,112,151,112,151,110,153,109,153,108,153,109,155,109,155,110,158,110,160,111,162,110,161,110,164,110,163,110,163,111",
-        "zoneName": "VET"
-    }, {
-        "timezone": "America/Cayenne",
-        "country": "GF",
-        "pin": "177,118",
-        "offset": -3,
-        "points": "176,117,178,119,177,122,175,122,175,120,174,118,175,117,176,117",
-        "zoneName": "GFT"
-    }, {
-        "timezone": "America/Cayman",
-        "country": "KY",
-        "pin": "137,98",
-        "offset": -5,
-        "points": "139,98,139,98,139,98",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Chicago",
-        "country": "US",
-        "pin": "128,67",
-        "offset": -6,
-        "points": "128,72,132,74,132,75,131,76,132,80,132,84,130,83,130,83,129,83,129,82,128,83,128,82,128,83,124,83,126,83,125,84,126,84,126,85,125,84,125,85,120,83,118,84,118,84,118,85,116,86,117,85,116,85,116,86,115,86,115,87,114,87,115,87,115,89,112,88,112,87,109,84,107,84,107,85,105,84,104,82,104,81,107,81,107,74,108,74,108,73,109,73,109,70,108,70,108,69,109,69,109,67,110,67,109,64,111,63,110,63,111,62,111,61,109,61,110,60,110,59,106,59,105,57,118,57,118,56,119,57,126,58,122,60,124,60,124,60,128,61,128,62,128,63,129,63,128,66,129,67,130,67,128,68,128,72",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Chihuahua",
-        "country": "MX",
-        "pin": "103,85",
-        "offset": -7,
-        "points": "106,85,106,86,106,88,105,88,103,88,101,89,98,86,99,86,99,82,100,82,100,81,102,81,104,83,105,84,106,85",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Coral_Harbour",
-        "country": "",
-        "pin": "250,125",
-        "offset": -5,
-        "points": "131,33,132,34,133,34,136,35,137,36,136,36,139,36,137,37,135,36,131,37,131,36,129,37,130,36,130,34,131,33",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Costa_Rica",
-        "country": "CR",
-        "pin": "133,111",
-        "offset": -6,
-        "points": "132,112,131,111,131,109,134,110,135,112,135,112,135,114,131,111,132,112",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Creston",
-        "country": "CA",
-        "pin": "88,57",
-        "offset": -7,
-        "points": "89,57,87,57,88,56,89,57",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Cuiaba",
-        "country": "BR",
-        "pin": "172,147",
-        "offset": -3,
-        "points": "179,146,176,148,176,150,175,150,175,149,173,150,172,149,170,150,169,149,169,148,166,148,166,144,167,142,167,141,165,140,164,137,169,137,169,135,170,137,171,138,180,139,180,141,180,143,179,146",
-        "zoneName": "AMST"
-    }, {
-        "timezone": "America/Curacao",
-        "country": "CW",
-        "pin": "154,108",
-        "offset": -4,
-        "points": "154,108,154,108,154,108",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Danmarkshavn",
-        "country": "GL",
-        "pin": "224,18",
-        "offset": 0,
-        "points": "223,15,223,15,224,15,221,16,221,16,220,17,221,17,223,17,224,17,221,17,224,18,225,18,218,18,223,19,220,19,223,20,218,20,219,14,223,15",
-        "zoneName": "GMT"
-    }, {
-        "timezone": "America/Dawson",
-        "country": "CA",
-        "pin": "56,36",
-        "offset": -8,
-        "points": "56,36,56,36,56,36",
-        "zoneName": "PST"
-    }, {
-        "timezone": "America/Dawson_Creek",
-        "country": "CA",
-        "pin": "83,42",
-        "offset": -7,
-        "points": "83,45,83,50,79,48,78,46,83,45",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Denver",
-        "country": "US",
-        "pin": "104,70",
-        "offset": -7,
-        "points": "93,63,92,62,91,62,91,60,89,59,89,57,105,57,106,59,108,59,108,60,110,61,109,61,111,61,111,62,110,63,111,63,109,64,110,67,109,67,109,69,108,69,108,70,109,70,109,73,108,73,108,74,107,74,107,81,104,81,104,82,102,81,99,81,99,76,96,76,95,74,95,74,92,74,92,67,96,67,96,63,93,63",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Detroit",
-        "country": "US",
-        "pin": "135,66",
-        "offset": -5,
-        "points": "132,67,129,67,130,66,130,64,130,63,131,62,132,63,132,61,134,62,134,62,134,63,133,65,135,64,136,65,134,67,132,67",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Detroit",
-        "country": "US",
-        "pin": "135,66",
-        "offset": -5,
-        "points": "125,60,127,59,127,60,130,61,132,60,134,61,131,61,130,62,129,61,128,62,129,62,128,61,126,61,125,60",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Dominica",
-        "country": "DM",
-        "pin": "165,104",
-        "offset": -4,
-        "points": "165,103,165,104,165,103",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Edmonton",
-        "country": "CA",
-        "pin": "92,51",
-        "offset": -7,
-        "points": "92,57,88,56,88,55,85,53,86,52,86,52,83,51,83,42,97,42,97,51,99,51,97,52,97,57,92,57",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Eirunepe",
-        "country": "BR",
-        "pin": "153,134",
-        "offset": -4,
-        "points": "156,138,148,135,148,134,149,132,150,131,153,131,156,138",
-        "zoneName": "ACT"
-    }, {
-        "timezone": "America/El_Salvador",
-        "country": "SV",
-        "pin": "126,106",
-        "offset": -6,
-        "points": "126,106,125,106,126,105,128,106,128,107,126,106",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Fortaleza",
-        "country": "BR",
-        "pin": "197,130",
-        "offset": -3,
-        "points": "201,134,202,135,201,135,199,137,198,136,198,135,197,136,194,135,194,136,192,138,189,138,189,140,187,140,186,139,185,138,185,136,184,135,184,133,182,132,185,130,186,126,187,127,187,127,188,127,188,128,188,130,188,128,189,129,190,128,191,129,194,129,198,132,201,132,201,134",
-        "zoneName": "BRT"
-    }, {
-        "timezone": "America/Glace_Bay",
-        "country": "CA",
-        "pin": "167,61",
-        "offset": -4,
-        "points": "167,61,166,61,166,61,167,61",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Godthab",
-        "country": "GL",
-        "pin": "178,36",
-        "offset": -3,
-        "points": "188,42,187,42,188,41,187,41,188,41,187,41,187,41,186,41,187,40,186,41,187,40,183,41,184,40,183,40,183,40,182,40,183,39,182,39,182,39,181,39,182,39,181,39,182,39,180,38,181,37,180,38,180,38,180,37,180,37,179,37,180,37,179,37,180,37,179,37,179,36,178,36,180,36,178,36,180,35,179,35,180,35,181,36,179,34,180,35,178,36,178,35,179,35,177,35,178,34,177,34,180,34,177,34,177,34,176,34,178,33,176,33,180,32,175,33,176,33,175,33,177,33,176,32,177,32,175,32,180,32,175,31,181,31,177,31,178,31,175,31,176,30,178,31,176,30,180,31,179,30,179,30,176,30,179,30,180,29,179,30,179,29,180,29,180,29,180,29,180,29,179,29,180,28,179,28,180,28,174,27,180,27,179,27,179,27,178,26,179,26,177,26,178,26,177,26,179,26,176,26,178,25,176,25,175,25,175,26,173,26,172,25,174,25,173,25,174,25,173,24,174,24,173,23,174,23,172,23,173,22,172,22,172,22,170,22,172,21,168,20,169,20,169,20,161,19,158,15,160,15,160,14,162,14,156,13,162,12,163,13,162,12,165,12,165,12,166,12,165,11,166,11,172,12,167,11,169,11,174,1
 1,176,11,175,12,176,11,181,12,179,11,181,11,179,10,180,10,188,11,189,11,188,11,188,11,188,11,191,11,186,10,195,10,187,10,196,10,196,10,199,10,196,9,202,9,214,9,201,10,215,9,216,10,214,10,220,10,204,11,216,11,213,12,213,12,221,11,220,12,217,13,224,12,223,12,228,11,234,12,229,13,221,13,228,13,221,14,222,14,226,14,225,14,219,14,218,20,223,20,223,21,219,20,220,20,219,20,222,21,219,21,224,22,219,22,219,22,219,22,220,23,220,22,222,22,221,23,219,23,217,23,219,23,214,22,216,23,212,23,213,23,212,23,212,24,215,24,212,24,216,24,213,24,215,24,215,25,216,25,216,26,210,25,212,25,210,26,215,26,211,26,212,26,209,27,213,27,210,28,212,28,215,27,219,28,213,30,208,30,206,30,205,30,206,31,204,31,202,33,198,33,198,34,197,33,198,33,197,33,197,33,197,33,197,34,195,34,194,34,195,34,194,35,193,35,194,36,192,36,194,36,194,37,192,36,193,37,192,37,192,37,191,37,192,38,190,38,191,38,190,38,192,39,190,39,191,39,190,40,191,40,189,40,191,40,190,41,190,41,189,41,190,42,189,41,188,42",
-        "zoneName": "WGT"
-    }, {
-        "timezone": "America/Goose_Bay",
-        "country": "CA",
-        "pin": "166,51",
-        "offset": -4,
-        "points": "171,53,161,53,161,52,162,52,162,52,161,52,160,53,158,53,158,51,156,52,157,51,156,50,157,49,156,49,157,49,157,48,159,49,161,49,162,48,161,48,161,47,162,47,161,47,162,45,160,44,162,43,160,43,161,43,161,42,160,42,160,41,162,43,161,43,163,43,162,44,163,44,162,44,164,45,163,45,165,46,163,46,164,46,164,47,166,48,166,48,166,49,167,48,167,48,168,48,167,49,168,48,168,49,170,49,167,50,169,50,166,51,170,50,171,50,170,51,171,53",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Grand_Turk",
-        "country": "TC",
-        "pin": "151,95",
-        "offset": -5,
-        "points": "151,95,151,95,151,95",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Grenada",
-        "country": "GD",
-        "pin": "164,108",
-        "offset": -4,
-        "points": "165,108,165,108,165,108",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Guadeloupe",
-        "country": "GP",
-        "pin": "165,102",
-        "offset": -4,
-        "points": "165,102,165,102,165,102",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Guatemala",
-        "country": "GT",
-        "pin": "124,105",
-        "offset": -6,
-        "points": "125,106,123,105,122,104,123,103,124,103,123,101,124,101,124,100,126,100,126,103,127,103,125,106",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Guayaquil",
-        "country": "EC",
-        "pin": "139,128",
-        "offset": -5,
-        "points": "141,130,140,132,139,131,138,131,139,128,139,129,137,128,139,124,141,123,142,124,144,124,145,125,145,125,146,126,141,130",
-        "zoneName": "ECT"
-    }, {
-        "timezone": "America/Guyana",
-        "country": "GY",
-        "pin": "169,116",
-        "offset": -4,
-        "points": "170,116,171,118,170,118,169,119,172,122,170,122,168,123,167,122,167,121,167,120,166,119,167,118,165,117,165,116,166,115,166,115,167,114,167,113,169,115,169,116,169,115,170,116",
-        "zoneName": "GYT"
-    }, {
-        "timezone": "America/Halifax",
-        "country": "CA",
-        "pin": "162,63",
-        "offset": -4,
-        "points": "161,63,162,62,160,62,161,61,163,62,164,61,165,62,161,63,159,65,158,64,158,63,160,62,161,63",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Havana",
-        "country": "CU",
-        "pin": "136,93",
-        "offset": -5,
-        "points": "146,96,147,97,142,97,143,96,141,96,141,95,136,94,136,94,137,94,136,93,132,95,134,93,138,93,146,96",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Hermosillo",
-        "country": "MX",
-        "pin": "96,85",
-        "offset": -7,
-        "points": "90,81,91,80,96,81,99,81,99,86,98,86,99,88,98,88,96,87,97,86,94,85,93,82,90,81",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Indiana/Petersburg",
-        "country": "US",
-        "pin": "129,72",
-        "offset": -5,
-        "points": "129,72,129,72,129,72",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Indiana/Tell_City",
-        "country": "US",
-        "pin": "129,72",
-        "offset": -6,
-        "points": "130,72,130,72,130,72",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Indiana/Vevay",
-        "country": "US",
-        "pin": "132,71",
-        "offset": -5,
-        "points": "132,71,132,71,132,71",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Indiana/Indianapolis",
-        "country": "US",
-        "pin": "130,70",
-        "offset": -5,
-        "points": "132,71,130,72,130,71,128,71,128,68,130,68,130,67,132,67,132,70,132,71",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Indiana/Knox",
-        "country": "US",
-        "pin": "130,68",
-        "offset": -6,
-        "points": "130,67,129,68,130,67",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Indiana/Marengo",
-        "country": "US",
-        "pin": "130,72",
-        "offset": -5,
-        "points": "130,72,130,72,130,72,130,72",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Indiana/Vincennes",
-        "country": "US",
-        "pin": "128,71",
-        "offset": -5,
-        "points": "128,72,128,71,130,71,130,72,128,72",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Indiana/Winamac",
-        "country": "US",
-        "pin": "130,68",
-        "offset": -5,
-        "points": "130,68,129,68,130,68",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Inuvik",
-        "country": "CA",
-        "pin": "64,30",
-        "offset": -7,
-        "points": "65,30,64,30,65,30",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Iqaluit",
-        "country": "CA",
-        "pin": "155,36",
-        "offset": -5,
-        "points": "139,20,138,20,140,20,138,21,140,21,132,21,132,20,139,20",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Iqaluit",
-        "country": "CA",
-        "pin": "155,36",
-        "offset": -5,
-        "points": "139,10,145,10,144,11,145,10,142,10,156,10,155,10,156,10,156,12,154,12,156,12,152,12,156,12,156,13,152,13,153,14,149,14,152,14,151,14,147,14,146,14,148,15,142,15,147,15,142,15,146,16,143,16,145,16,145,17,141,17,142,17,141,18,136,18,142,18,141,19,137,19,138,19,135,18,136,19,132,19,132,18,134,18,134,17,136,17,132,17,132,15,136,16,134,16,137,15,132,15,134,15,132,15,132,14,138,14,139,14,134,13,144,13,140,13,143,12,140,12,140,12,139,13,132,13,132,12,136,12,132,12,132,11,133,11,132,10,140,11,135,11,138,10,137,10,141,10,138,10,139,10",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Iqaluit",
-        "country": "CA",
-        "pin": "155,36",
-        "offset": -5,
-        "points": "132,30,133,29,132,29,132,28,136,28,134,28,137,29,136,29,137,30,135,30,137,31,134,33,133,32,132,32,132,30",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Iqaluit",
-        "country": "CA",
-        "pin": "155,36",
-        "offset": -5,
-        "points": "144,24,140,24,138,23,142,23,144,24",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Iqaluit",
-        "country": "CA",
-        "pin": "155,36",
-        "offset": -5,
-        "points": "133,23,137,23,139,24,138,24,138,24,138,25,139,24,142,25,140,25,142,25,141,24,142,24,146,24,146,25,144,25,147,25,145,26,146,25,146,26,148,25,147,26,148,26,147,26,149,26,148,26,149,25,151,26,149,27,150,27,149,27,152,26,150,27,151,27,151,28,153,27,152,27,155,27,152,28,155,28,153,28,156,27,155,28,153,28,156,29,154,29,155,29,154,29,155,29,155,29,156,29,154,29,156,30,156,33,155,33,156,34,156,37,154,36,156,37,156,39,151,37,150,37,151,37,149,36,148,36,148,35,148,36,148,35,147,36,147,35,146,35,146,35,147,36,142,36,141,35,142,34,148,34,147,33,150,32,148,30,148,30,147,30,148,30,145,29,144,30,145,29,143,28,143,28,143,28,143,28,142,28,142,27,140,27,139,27,140,27,141,28,136,28,138,28,135,27,137,28,132,28,132,26,133,25,132,25,132,25,133,25,132,25,132,24,133,24,132,23,133,24,132,23,133,23",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/La_Paz",
-        "country": "BO",
-        "pin": "155,148",
-        "offset": -4,
-        "points": "164,154,163,156,161,156,161,157,160,156,158,155,157,157,156,157,155,153,155,152,153,149,154,148,154,147,155,142,153,140,155,140,157,139,159,138,160,142,166,144,166,148,169,148,169,149,170,150,170,153,168,152,164,152,164,154",
-        "zoneName": "BOT"
-    }, {
-        "timezone": "America/Jamaica",
-        "country": "JM",
-        "pin": "143,100",
-        "offset": -5,
-        "points": "144,100,143,100,141,100,143,99,144,100",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Juneau",
-        "country": "US",
-        "pin": "63,44",
-        "offset": -9,
-        "points": "59,43,62,42,66,45,65,46,65,45,64,45,65,45,64,45,65,45,64,44,64,44,63,44,62,42,62,42,62,44,61,44,61,43,61,43,61,43,60,43,61,44,60,44,58,43,59,43",
-        "zoneName": "AKST"
-    }, {
-        "timezone": "America/Kentucky/Louisville",
-        "country": "US",
-        "pin": "131,72",
-        "offset": -5,
-        "points": "130,72,130,72,131,71,130,72",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Kentucky/Monticello",
-        "country": "US",
-        "pin": "132,74",
-        "offset": -5,
-        "points": "132,74,133,74,132,74,132,74",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Kralendijk",
-        "country": "BQ",
-        "pin": "155,108",
-        "offset": -4,
-        "points": "162,101,162,100,162,101",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Lima",
-        "country": "PE",
-        "pin": "143,142",
-        "offset": -5,
-        "points": "153,149,153,150,152,150,151,149,146,146,144,145,144,144,139,135,137,133,138,133,137,131,138,130,139,130,138,131,140,132,141,130,145,127,146,126,145,125,146,125,149,128,150,128,153,129,152,130,153,131,152,131,149,132,148,134,147,135,149,137,148,138,150,138,150,139,152,138,152,140,153,140,155,142,154,147,154,148,153,149",
-        "zoneName": "PET"
-    }, {
-        "timezone": "America/Managua",
-        "country": "NI",
-        "pin": "130,108",
-        "offset": -6,
-        "points": "132,110,131,110,128,107,129,107,129,106,131,106,132,104,135,104,134,110,132,110",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Manaus",
-        "country": "BR",
-        "pin": "167,129",
-        "offset": -4,
-        "points": "167,125,168,125,169,127,172,128,169,134,169,135,169,137,164,137,163,136,162,136,161,137,160,138,158,138,157,139,156,138,153,131,154,127,153,124,154,124,153,124,153,123,156,122,157,123,158,124,159,124,159,124,161,122,162,122,163,124,163,126,164,127,165,126,166,126,167,125",
-        "zoneName": "AMT"
-    }, {
-        "timezone": "America/Los_Angeles",
-        "country": "US",
-        "pin": "86,78",
-        "offset": -8,
-        "points": "91,62,88,62,88,61,88,62,87,63,86,64,86,66,87,66,87,67,92,67,92,75,91,75,91,77,91,79,91,79,87,80,85,78,82,77,82,76,80,73,80,72,79,72,78,71,77,69,78,67,77,66,78,61,78,61,78,61,78,60,78,60,78,60,78,60,77,58,80,58,79,59,80,58,80,59,79,60,80,59,80,57,89,57,89,59,91,60,91,62",
-        "zoneName": "PST"
-    }, {
-        "timezone": "America/Lower_Princes",
-        "country": "SX",
-        "pin": "162,100",
-        "offset": -4,
-        "points": "162,100,162,100,162,100",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Maceio",
-        "country": "BR",
-        "pin": "200,138",
-        "offset": -3,
-        "points": "199,140,198,141,197,140,198,139,197,138,198,137,199,138,201,137,199,140",
-        "zoneName": "BRT"
-    }, {
-        "timezone": "America/Marigot",
-        "country": "MF",
-        "pin": "162,100",
-        "offset": -4,
-        "points": "162,100,162,100,162,100",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Martinique",
-        "country": "MQ",
-        "pin": "165,105",
-        "offset": -4,
-        "points": "165,104,165,104,165,104",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Matamoros",
-        "country": "MX",
-        "pin": "115,89",
-        "offset": -6,
-        "points": "113,89,112,89,109,84,108,84,107,85,107,85,107,84,109,84,112,87,112,88,115,89,115,90,113,89",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Mazatlan",
-        "country": "MX",
-        "pin": "102,93",
-        "offset": -7,
-        "points": "104,93,106,95,105,96,104,96,104,95,103,94,100,90,98,89,98,88,100,88,101,90,104,93",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Mazatlan",
-        "country": "MX",
-        "pin": "102,93",
-        "offset": -7,
-        "points": "91,86,93,86,98,93,97,93,94,91,94,89,93,88,92,88,90,86,92,87,91,86",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Menominee",
-        "country": "US",
-        "pin": "128,62",
-        "offset": -6,
-        "points": "128,62,128,61,124,60,128,61,129,62,128,62",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Mexico_City",
-        "country": "MX",
-        "pin": "112,98",
-        "offset": -6,
-        "points": "119,103,118,102,116,103,114,103,104,98,103,97,104,96,105,96,106,95,105,94,106,92,108,91,107,90,110,91,111,93,114,94,117,99,119,100,122,99,122,100,124,100,124,101,123,101,124,102,123,103,122,105,119,102,119,103",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Merida",
-        "country": "MX",
-        "pin": "126,96",
-        "offset": -6,
-        "points": "124,96,125,95,128,95,128,96,126,98,126,100,122,100,122,99,123,99,124,96",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Metlakatla",
-        "country": "US",
-        "pin": "67,48",
-        "offset": -8,
-        "points": "67,48,67,48,67,48",
-        "zoneName": "PST"
-    }, {
-        "timezone": "America/Miquelon",
-        "country": "PM",
-        "pin": "172,60",
-        "offset": -3,
-        "points": "172,60,172,60,172,60",
-        "zoneName": "PMST"
-    }, {
-        "timezone": "America/Moncton",
-        "country": "CA",
-        "pin": "160,61",
-        "offset": -4,
-        "points": "157,58,160,59,159,60,160,60,160,61,161,61,158,62,156,62,156,62,156,60,154,59,155,58,157,58",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Monterrey",
-        "country": "MX",
-        "pin": "111,89",
-        "offset": -6,
-        "points": "107,90,108,91,106,92,105,94,104,94,101,90,103,88,105,88,106,88,106,86,106,85,108,84,109,84,112,89,115,89,115,90,115,90,114,90,114,94,111,93,110,91,107,90",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Montevideo",
-        "country": "UY",
-        "pin": "172,173",
-        "offset": -2,
-        "points": "172,173,170,173,169,172,170,167,171,167,172,168,173,168,176,170,175,173,172,173",
-        "zoneName": "UYT"
-    }, {
-        "timezone": "America/Montreal",
-        "country": "",
-        "pin": "250,125",
-        "offset": -5,
-        "points": "146,63,147,62,144,62,141,61,139,59,140,53,140,54,140,53,141,52,140,51,140,50,139,49,142,48,144,47,143,44,141,44,143,42,142,41,143,41,142,41,142,40,141,41,142,40,142,39,142,38,146,39,148,38,150,39,150,39,151,39,150,40,151,40,153,40,153,42,151,42,153,42,153,43,154,43,152,44,154,43,155,44,154,45,156,44,155,44,156,44,156,45,158,43,158,44,158,43,159,43,159,43,160,43,159,42,160,41,160,42,161,42,161,43,160,43,162,43,160,44,162,45,161,47,162,47,161,47,161,48,162,48,161,49,159,49,157,48,157,49,156,49,157,49,156,50,157,51,156,52,158,51,158,53,160,53,161,52,162,52,162,52,161,52,161,53,171,53,171,53,168,54,167,55,164,55,158,55,158,55,156,57,155,57,152,60,149,61,157,57,160,57,161,58,159,58,155,58,153,60,152,62,151,63,146,63",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Montserrat",
-        "country": "MS",
-        "pin": "164,102",
-        "offset": -4,
-        "points": "164,102,164,102,164,102",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Nassau",
-        "country": "BS",
-        "pin": "143,90",
-        "offset": -5,
-        "points": "143,90,143,90,143,90",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/New_York",
-        "country": "US",
-        "pin": "147,68",
-        "offset": -5,
-        "points": "132,82,131,76,132,75,133,74,130,72,132,71,132,71,132,67,136,67,140,66,140,65,144,65,144,64,146,63,152,62,154,59,156,60,156,62,157,63,155,64,154,63,154,64,152,64,151,66,152,67,153,67,153,67,151,67,151,67,151,68,148,68,146,71,145,70,146,72,145,73,145,72,144,71,145,70,144,70,144,72,143,72,144,72,143,72,144,74,143,73,144,74,145,75,144,74,145,75,143,75,145,76,143,76,144,76,143,76,144,76,144,77,138,80,137,82,139,88,138,90,137,90,136,88,136,88,136,88,135,87,136,86,135,86,135,84,133,83,131,84,132,82",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Nipigon",
-        "country": "CA",
-        "pin": "127,57",
-        "offset": -5,
-        "points": "127,57,127,57,127,57",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Nome",
-        "country": "US",
-        "pin": "20,35",
-        "offset": -9,
-        "points": "25,32,23,32,22,31,18,30,19,29,23,29,25,27,25,32",
-        "zoneName": "AKST"
-    }, {
-        "timezone": "America/Nome",
-        "country": "US",
-        "pin": "20,35",
-        "offset": -9,
-        "points": "25,35,24,36,19,35,18,35,19,34,16,34,23,33,22,33,25,33,25,35",
-        "zoneName": "AKST"
-    }, {
-        "timezone": "America/Nome",
-        "country": "US",
-        "pin": "20,35",
-        "offset": -9,
-        "points": "25,42,22,42,20,41,21,40,19,39,22,37,23,37,25,37,25,42",
-        "zoneName": "AKST"
-    }, {
-        "timezone": "America/Noronha",
-        "country": "BR",
-        "pin": "205,130",
-        "offset": -2,
-        "points": "205,130,205,130,205,130",
-        "zoneName": "FNT"
-    }, {
-        "timezone": "America/North_Dakota/Beulah",
-        "country": "US",
-        "pin": "109,59",
-        "offset": -6,
-        "points": "109,59,108,60,108,59,109,59",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/North_Dakota/Center",
-        "country": "US",
-        "pin": "109,60",
-        "offset": -6,
-        "points": "110,60,109,60,110,60",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/North_Dakota/New_Salem",
-        "country": "US",
-        "pin": "109,60",
-        "offset": -6,
-        "points": "110,60,110,60,110,61,108,60,110,60",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Ojinaga",
-        "country": "MX",
-        "pin": "105,84",
-        "offset": -7,
-        "points": "102,81,106,85,105,84,104,83,102,81,99,82,100,81,100,81,102,81",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Panama",
-        "country": "PA",
-        "pin": "140,113",
-        "offset": -5,
-        "points": "142,113,143,114,142,115,141,114,141,113,142,114,140,112,138,114,139,115,138,115,138,115,137,114,137,114,136,113,135,114,135,113,135,112,137,113,140,112,142,113",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Pangnirtung",
-        "country": "CA",
-        "pin": "159,33",
-        "offset": -5,
-        "points": "156,10,160,10,165,11,156,12,156,10",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Pangnirtung",
-        "country": "CA",
-        "pin": "159,33",
-        "offset": -5,
-        "points": "156,34,157,34,157,35,157,35,160,35,159,36,160,36,160,36,160,37,159,36,160,38,159,37,159,38,158,37,158,37,156,37,156,34",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Pangnirtung",
-        "country": "CA",
-        "pin": "159,33",
-        "offset": -5,
-        "points": "156,30,157,30,156,30,158,30,157,31,158,31,158,31,158,31,160,31,159,31,160,31,161,31,160,31,161,32,160,32,162,31,161,32,163,32,163,32,164,32,165,32,163,33,164,33,162,33,163,33,163,33,163,34,162,33,162,35,159,34,161,33,159,33,159,33,158,33,156,32,157,33,156,33,157,33,156,33,156,30",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Paramaribo",
-        "country": "SR",
-        "pin": "173,117",
-        "offset": -3,
-        "points": "175,118,175,120,174,122,172,121,172,122,171,122,169,119,170,118,171,118,171,117,175,117,175,118",
-        "zoneName": "SRT"
-    }, {
-        "timezone": "America/Phoenix",
-        "country": "US",
-        "pin": "94,79",
-        "offset": -7,
-        "points": "99,80,99,81,96,81,91,80,91,77,91,75,91,75,92,74,95,74,95,74,96,76,99,76,99,80",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Port-au-Prince",
-        "country": "HT",
-        "pin": "150,99",
-        "offset": -5,
-        "points": "148,99,149,99,148,99",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Port_of_Spain",
-        "country": "TT",
-        "pin": "165,110",
-        "offset": -4,
-        "points": "164,110,164,110,164,110",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Porto_Velho",
-        "country": "BR",
-        "pin": "161,137",
-        "offset": -4,
-        "points": "167,142,166,144,164,144,160,142,159,138,157,139,158,138,160,138,161,137,162,136,163,136,165,137,165,140,167,140,167,142",
-        "zoneName": "AMT"
-    }, {
-        "timezone": "America/Puerto_Rico",
-        "country": "PR",
-        "pin": "158,99",
-        "offset": -4,
-        "points": "158,99,158,99,158,99",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Rainy_River",
-        "country": "CA",
-        "pin": "119,57",
-        "offset": -6,
-        "points": "119,57,119,57,119,57",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Rankin_Inlet",
-        "country": "CA",
-        "pin": "122,38",
-        "offset": -6,
-        "points": "132,12,125,12,125,12,129,12,122,12,132,11,132,12",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Rankin_Inlet",
-        "country": "CA",
-        "pin": "122,38",
-        "offset": -6,
-        "points": "113,19,114,19,114,20,115,20,111,21,110,20,111,20,108,20,108,20,109,20,108,19,111,20,111,19,112,19,110,19,113,19",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Rankin_Inlet",
-        "country": "CA",
-        "pin": "122,38",
-        "offset": -6,
-        "points": "125,16,126,16,122,16,121,16,123,16,119,15,124,15,118,15,117,15,119,14,116,14,119,14,118,14,119,14,116,13,120,13,117,13,121,12,119,12,120,12,127,14,128,13,128,14,129,14,129,15,132,15,128,16,128,15,127,16,128,16,127,16,127,16,125,16",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Rankin_Inlet",
-        "country": "CA",
-        "pin": "122,38",
-        "offset": -6,
-        "points": "132,21,122,21,122,21,122,20,121,19,118,19,118,19,115,18,117,18,121,18,120,19,124,19,124,19,123,19,126,19,123,19,126,20,132,20,132,21",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Rankin_Inlet",
-        "country": "CA",
-        "pin": "122,38",
-        "offset": -6,
-        "points": "132,19,125,19,130,18,127,17,129,17,132,18,132,19",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Rankin_Inlet",
-        "country": "CA",
-        "pin": "122,38",
-        "offset": -6,
-        "points": "132,28,127,27,126,26,129,26,125,26,125,25,126,25,125,24,128,23,132,23,130,24,130,24,130,25,132,26,129,26,132,26,132,28",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Rankin_Inlet",
-        "country": "CA",
-        "pin": "122,38",
-        "offset": -6,
-        "points": "125,36,124,37,119,36,123,37,124,37,122,38,122,38,120,39,120,39,119,40,120,40,118,42,108,42,108,32,126,32,126,29,128,30,128,30,127,31,129,32,130,31,131,30,132,30,132,33,130,33,131,33,129,34,123,33,129,35,128,36,125,36",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Rankin_Inlet",
-        "country": "CA",
-        "pin": "122,38",
-        "offset": -6,
-        "points": "118,22,120,22,125,22,122,24,119,24,120,24,120,25,117,24,117,23,119,23,118,22",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Recife",
-        "country": "BR",
-        "pin": "202,136",
-        "offset": -3,
-        "points": "196,136,197,136,198,135,199,137,201,135,202,136,201,137,199,138,198,137,197,138,195,137,194,138,193,137,194,136,194,135,196,136",
-        "zoneName": "BRT"
-    }, {
-        "timezone": "America/Regina",
-        "country": "CA",
-        "pin": "105,55",
-        "offset": -6,
-        "points": "104,57,97,57,97,52,99,51,97,51,97,42,108,42,108,48,108,49,109,50,109,57,104,57",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Resolute",
-        "country": "CA",
-        "pin": "118,21",
-        "offset": -6,
-        "points": "118,20,120,20,120,21,116,21,118,20",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Rio_Branco",
-        "country": "BR",
-        "pin": "156,139",
-        "offset": -4,
-        "points": "148,135,152,136,157,139,155,140,152,140,152,138,150,139,150,138,148,138,149,137,147,135,148,135",
-        "zoneName": "ACT"
-    }, {
-        "timezone": "America/Santa_Isabel",
-        "country": "MX",
-        "pin": "90,83",
-        "offset": -8,
-        "points": "91,80,91,83,93,86,91,86,92,85,89,84,88,81,88,80,91,80",
-        "zoneName": "PST"
-    }, {
-        "timezone": "America/Santarem",
-        "country": "BR",
-        "pin": "174,128",
-        "offset": -3,
-        "points": "176,125,177,126,178,127,177,127,178,129,177,130,177,132,178,134,177,136,178,138,177,138,171,138,170,137,169,134,172,128,168,126,168,123,170,122,172,122,172,121,174,121,174,123,176,123,176,125",
-        "zoneName": "BRT"
-    }, {
-        "timezone": "America/Santiago",
-        "country": "CL",
-        "pin": "152,171",
-        "offset": -3,
-        "points": "152,199,154,198,155,198,155,201,150,201,153,201,152,200,154,201,154,201,154,201,153,200,154,199,152,199,152,199",
-        "zoneName": "CLT"
-    }, {
-        "timezone": "America/Santiago",
-        "country": "CL",
-        "pin": "152,171",
-        "offset": -3,
-        "points": "148,193,148,195,148,196,150,195,149,197,150,197,155,198,152,198,151,200,149,199,150,199,151,198,151,198,149,198,149,199,148,199,149,198,148,198,148,197,149,198,149,197,149,198,149,198,149,198,149,197,148,196,148,197,149,197,148,197,149,197,148,197,148,197,148,197,147,197,148,196,147,196,148,195,148,195,147,196,147,195,146,195,147,195,147,194,148,194,147,193,147,194,147,193,147,193,147,193,147,192,146,192,148,192,148,191,146,191,147,191,147,191,147,191,147,190,145,190,146,189,147,189,147,190,148,188,148,189,148,188,149,188,148,188,149,187,148,186,149,184,149,184,149,184,149,183,149,183,150,183,148,183,147,182,148,180,148,177,148,177,151,172,151,165,152,162,152,157,153,155,152,150,154,149,155,152,155,153,156,157,157,157,156,158,155,159,155,162,153,164,153,167,152,168,153,173,152,174,152,175,151,176,152,179,150,180,150,183,150,184,151,186,150,187,151,187,150,187,151,188,150,188,150,190,149,191,149,193,148,193",
-        "zoneName": "CLT"
-    }, {
-        "timezone": "America/Santo_Domingo",
-        "country": "DO",
-        "pin": "153,99",
-        "offset": -4,
-        "points": "151,100,150,100,150,99,150,97,153,98,154,98,153,98,155,99,155,100,151,100",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Scoresbysund",
-        "country": "GL",
-        "pin": "219,27",
-        "offset": -1,
-        "points": "216,25,219,25,218,26,220,25,219,26,220,26,220,26,219,26,220,26,219,26,220,27,217,27,216,26,216,25",
-        "zoneName": "EGT"
-    }, {
-        "timezone": "America/Sao_Paulo",
-        "country": "BR",
-        "pin": "185,158",
-        "offset": -2,
-        "points": "181,166,179,168,178,170,180,167,179,167,179,168,176,172,176,171,176,170,175,170,173,168,172,168,171,167,170,167,173,164,175,162,175,161,174,161,175,159,176,157,178,155,179,152,177,151,176,149,179,146,180,142,181,143,182,142,182,143,184,143,186,143,186,146,189,145,195,147,194,149,195,150,195,152,193,155,193,156,192,157,188,157,183,160,182,160,183,161,182,161,183,161,182,164,181,166",
-        "zoneName": "BRST"
-    }, {
-        "timezone": "America/Sitka",
-        "country": "US",
-        "pin": "62,46",
-        "offset": -9,
-        "points": "66,45,67,46,65,46,66,45,66,45",
-        "zoneName": "AKST"
-    }, {
-        "timezone": "America/St_Barthelemy",
-        "country": "BL",
-        "pin": "163,100",
-        "offset": -4,
-        "points": "163,100,163,100,163,100",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/St_Johns",
-        "country": "CA",
-        "pin": "177,59",
-        "offset": -3.5,
-        "points": "173,53,172,54,173,54,172,54,171,56,172,55,173,56,172,56,173,56,173,57,174,56,176,57,175,58,176,57,175,58,175,59,177,58,176,59,177,59,176,60,176,60,176,59,175,60,175,59,175,58,173,60,174,59,172,59,173,59,173,58,171,59,168,59,169,58,168,58,169,57,170,57,169,57,170,56,169,56,170,55,173,53",
-        "zoneName": "NST"
-    }, {
-        "timezone": "America/Thule",
-        "country": "GL",
-        "pin": "154,19",
-        "offset": -4,
-        "points": "161,19,155,19,153,19,156,18,151,18,158,17,153,17,153,17,149,16,158,15,161,19",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/St_Kitts",
-        "country": "KN",
-        "pin": "163,101",
-        "offset": -4,
-        "points": "163,101,163,101,163,101",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/St_Lucia",
-        "country": "LC",
-        "pin": "165,106",
-        "offset": -4,
-        "points": "165,105,165,106,165,105",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/St_Thomas",
-        "country": "VI",
-        "pin": "160,100",
-        "offset": -4,
-        "points": "160,99,160,99,160,99",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/St_Vincent",
-        "country": "VC",
-        "pin": "165,107",
-        "offset": -4,
-        "points": "165,106,165,107,165,106",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Swift_Current",
-        "country": "CA",
-        "pin": "100,55",
-        "offset": -6,
-        "points": "100,55,100,55,100,55",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Tegucigalpa",
-        "country": "HN",
-        "pin": "129,105",
-        "offset": -6,
-        "points": "129,106,129,107,128,106,126,105,126,104,128,103,131,103,133,103,135,104,132,104,131,106,129,106",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Thunder_Bay",
-        "country": "CA",
-        "pin": "126,58",
-        "offset": -5,
-        "points": "126,58,126,58,126,58",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Tijuana",
-        "country": "MX",
-        "pin": "87,80",
-        "offset": -8,
-        "points": "87,80,87,80,87,80",
-        "zoneName": "PST"
-    }, {
-        "timezone": "America/Toronto",
-        "country": "CA",
-        "pin": "140,64",
-        "offset": -5,
-        "points": "146,62,147,62,143,64,142,63,143,64,143,64,140,64,139,65,140,65,135,67,137,65,137,63,137,62,138,63,139,63,138,61,137,61,136,62,133,61,133,60,132,58,131,58,130,57,127,57,128,58,126,58,126,58,124,58,124,57,125,56,125,55,124,53,125,53,125,52,126,52,127,51,126,50,125,50,125,47,127,46,128,47,132,48,136,48,136,51,138,54,140,54,140,60,141,61,144,62,146,62",
-        "zoneName": "EST"
-    }, {
-        "timezone": "America/Tortola",
-        "country": "VG",
-        "pin": "160,99",
-        "offset": -4,
-        "points": "160,99,160,99,160,99",
-        "zoneName": "AST"
-    }, {
-        "timezone": "America/Vancouver",
-        "country": "CA",
-        "pin": "79,57",
-        "offset": -8,
-        "points": "72,54,76,55,79,58,76,57,77,57,76,57,75,56,74,56,75,56,72,55,73,55,72,54",
-        "zoneName": "PST"
-    }, {
-        "timezone": "America/Vancouver",
-        "country": "CA",
-        "pin": "79,57",
-        "offset": -8,
-        "points": "63,43,62,42,59,43,57,42,83,42,83,45,78,46,79,48,86,52,86,52,85,53,88,55,88,57,79,57,81,56,81,57,80,56,81,57,80,57,80,56,79,57,79,56,79,56,79,55,79,56,78,56,78,56,78,56,78,55,77,56,77,55,77,55,76,55,77,54,76,54,76,55,75,55,76,54,75,55,74,54,75,54,73,54,74,54,73,54,74,53,73,53,72,53,73,52,74,53,74,52,75,52,73,52,73,52,73,52,72,53,72,52,72,52,72,52,71,51,73,51,71,51,71,50,70,51,69,50,70,50,69,49,69,50,69,49,70,48,69,49,70,48,70,48,69,49,69,47,67,46,65,44,63,43",
-        "zoneName": "PST"
-    }, {
-        "timezone": "America/Whitehorse",
-        "country": "CA",
-        "pin": "62,41",
-        "offset": -8,
-        "points": "57,29,60,29,61,32,64,32,64,33,66,33,66,35,69,36,70,37,69,37,70,37,70,39,73,40,74,41,77,40,78,42,54,41,54,28,57,29",
-        "zoneName": "PST"
-    }, {
-        "timezone": "America/Winnipeg",
-        "country": "CA",
-        "pin": "115,56",
-        "offset": -6,
-        "points": "122,58,119,57,118,56,118,57,109,57,109,50,108,49,108,48,108,42,118,42,118,43,121,43,122,45,121,46,124,45,126,46,125,47,125,50,126,50,127,51,126,52,125,52,125,53,124,53,125,55,125,56,123,57,122,58",
-        "zoneName": "CST"
-    }, {
-        "timezone": "America/Yakutat",
-        "country": "US",
-        "pin": "56,42",
-        "offset": -9,
-        "points": "56,42,56,42,56,42",
-        "zoneName": "AKST"
-    }, {
-        "timezone": "America/Yellowknife",
-        "country": "CA",
-        "pin": "91,38",
-        "offset": -7,
-        "points": "83,31,92,34,95,34,97,35,108,36,108,42,78,42,77,40,74,41,73,40,70,39,70,37,69,37,70,37,69,36,66,35,66,33,64,33,64,32,61,32,60,29,62,30,61,29,63,28,64,28,64,29,70,28,67,28,67,29,68,28,68,29,69,28,73,27,72,27,76,29,77,28,78,28,77,29,79,28,82,28,81,28,81,30,83,31",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Yellowknife",
-        "country": "CA",
-        "pin": "91,38",
-        "offset": -7,
-        "points": "88,17,90,18,88,18,89,18,87,19,86,19,86,18,83,20,79,19,84,18,88,17",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Yellowknife",
-        "country": "CA",
-        "pin": "91,38",
-        "offset": -7,
-        "points": "84,22,87,22,90,23,85,24,83,25,83,26,79,26,75,25,78,23,77,22,81,21,84,22",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Yellowknife",
-        "country": "CA",
-        "pin": "91,38",
-        "offset": -7,
-        "points": "91,19,97,20,97,21,93,22,91,21,96,20,87,20,90,20,87,20,91,20,88,20,91,19",
-        "zoneName": "MST"
-    }, {
-        "timezone": "America/Yellowknife",
-        "country": "CA",
-        "pin": "91,38",
-        "offset": -7,
-        "points": "90,23,92,23,91,24,93,24,96,24,95,25,97,24,97,28,87,28,87,28,87,28,95,27,87,27,86,26,90,26,86,26,87,25,85,25,86,25,86,24,90,23",
-        "zoneName": "MST"
-    }, {
-        "timezone": "Antarctica/Macquarie",
-        "country": "AU",
-        "pin": "471,201",
-        "offset": 11,
-        "points": "471,201,471,201,471,201",
-        "zoneName": "MIST"
-    }, {
-        "timezone": "Arctic/Longyearbyen",
-        "country": "SJ",
-        "pin": "272,17",
-        "offset": 1,
-        "points": "275,14,275,14,275,15,275,14,280,16,276,16,276,17,274,18,274,19,273,19,272,18,273,18,269,17,273,17,270,17,274,17,269,17,269,17,274,16,273,16,273,16,271,16,271,15,270,16,271,16,268,16,267,16,268,16,266,15,267,15,266,15,267,15,266,15,265,15,269,14,267,14,269,15,269,15,270,14,273,15,272,14,275,14",
-        "zoneName": "CET"
-    }, {
-        "timezone": "Arctic/Longyearbyen",
-        "country": "SJ",
-        "pin": "272,17",
-        "offset": 1,
-        "points": "285,14,288,14,283,15,275,14,277,14,276,13,278,14,277,13,281,14,282,13,282,13,282,14,285,14",
-        "zoneName": "CET"
-    }, {
-        "timezone": "Asia/Aden",
-        "country": "YE",
-        "pin": "313,107",
-        "offset": 3,
-        "points": "313,107,310,107,309,104,310,101,314,102,314,103,318,100,322,99,324,102,323,102,322,103,313,107",
-        "zoneName": "AST"
-    }, {
-        "timezone": "Asia/Almaty",
-        "country": "KZ",
-        "pin": "357,65",
-        "offset": 6,
-        "points": "348,66,345,68,343,68,342,66,344,65,345,64,344,63,343,61,337,60,339,58,339,58,340,57,342,57,345,55,344,54,344,52,342,52,342,51,342,51,342,51,342,49,346,48,348,48,349,50,352,50,352,51,357,49,356,50,358,51,361,55,362,54,363,55,366,54,368,56,371,56,371,57,369,58,369,60,365,59,364,62,365,62,363,62,361,63,362,63,362,65,361,66,359,65,355,66,353,65,352,65,352,66,350,66,348,66",
-        "zoneName": "ALMT"
-    }, {
-        "timezone": "Asia/Amman",
-        "country": "JO",
-        "pin": "300,81",
-        "offset": 2,
-        "points": "302,82,303,83,302,83,300,84,299,84,299,80,301,80,304,79,305,80,301,81,302,82",
-        "zoneName": "EET"
-    }, {
-        "timezone": "Asia/Anadyr",
-        "country": "RU",
-        "pin": "497,35",
-        "offset": 12,
-        "points": "10,32,14,33,13,34,12,34,12,34,10,34,11,34,11,35,9,35,11,36,10,36,6,35,6,34,2,34,2,33,2,33,0,33,1,34,0,35,0,29,7,31,8,33,9,33,7,32,10,32",
-        "zoneName": "ANAT"
-    }, {
-        "timezone": "Asia/Anadyr",
-        "country": "RU",
-        "pin": "497,35",
-        "offset": 12,
-        "points": "497,35,493,35,498,36,499,38,499,39,496,38,492,39,491,38,487,39,484,37,486,37,484,36,473,35,471,34,471,33,470,33,471,32,469,31,470,30,476,30,476,29,475,28,476,28,483,28,486,30,488,29,486,28,487,28,495,28,500,29,500,35,498,35,497,35",
-        "zoneName": "ANAT"
-    }, {
-        "timezone": "Asia/Aqtau",
-        "country": "KZ",
-        "pin": "320,63",
-        "offset": 5,
-        "points": "328,63,328,68,325,66,323,67,323,66,321,65,320,63,322,63,321,63,321,62,324,62,323,60,321,60,319,61,317,60,318,60,318,59,315,58,319,58,325,57,325,57,326,57,327,60,329,61,329,62,328,63",
-        "zoneName": "AQTT"
-    }, {
-        "timezone": "Asia/Aqtobe",
-        "country": "KZ",
-        "pin": "329,55",
-        "offset": 5,
-        "points": "326,55,326,54,327,55,328,54,331,54,333,55,335,54,336,54,337,56,337,57,339,58,337,60,335,59,331,62,329,62,328,60,326,59,326,57,324,57,326,56,326,55",
-        "zoneName": "AQTT"
-    }, {
-        "timezone": "Asia/Ashgabat",
-        "country": "TM",
-        "pin": "331,72",
-        "offset": 5,
-        "points": "340,74,340,75,337,76,335,75,335,74,334,74,332,73,329,72,325,73,325,71,324,71,324,70,325,70,323,69,324,68,323,67,325,66,327,68,329,68,329,67,331,66,331,66,331,66,331,66,333,66,334,68,336,68,337,70,343,72,342,73,341,73,340,74",
-        "zoneName": "TMT"
-    }, {
-        "timezone": "Asia/Baghdad",
-        "country": "IQ",
-        "pin": "312,79",
-        "offset": 3,
-        "points": "315,83

<TRUNCATED>

[13/51] [abbrv] ambari git commit: AMBARI-19816. Agent heartbeat lost due to dead service check process - addendum fix (Attila Doroszlai via smohanty)

Posted by rz...@apache.org.
AMBARI-19816. Agent heartbeat lost due to dead service check process - addendum fix (Attila Doroszlai via smohanty)

(cherry picked from commit 8832146e96be59ea117e155b46936b4d28e1d7e0)

Change-Id: If2f9cc2caefa6accf00b1e3ac00e280ecac695c2


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: ffaa961f8c165af745b562c2d1c49e4cdee0bb8f
Parents: dc51287
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Wed Feb 1 16:29:30 2017 -0800
Committer: Zuul <re...@hortonworks.com>
Committed: Mon Feb 6 22:04:02 2017 -0800

----------------------------------------------------------------------
 .../src/main/python/ambari_agent/Hardware.py    | 10 ++-
 .../test/python/ambari_agent/TestHardware.py    | 84 +++++++++-----------
 2 files changed, 44 insertions(+), 50 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ffaa961f/ambari-agent/src/main/python/ambari_agent/Hardware.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/Hardware.py b/ambari-agent/src/main/python/ambari_agent/Hardware.py
index 2233b0a..8cb8a28 100644
--- a/ambari-agent/src/main/python/ambari_agent/Hardware.py
+++ b/ambari-agent/src/main/python/ambari_agent/Hardware.py
@@ -21,6 +21,7 @@ limitations under the License.
 import os.path
 import logging
 import subprocess
+from resource_management.core import shell
 from resource_management.core.shell import call
 from resource_management.core.exceptions import ExecuteTimeoutException, Fail
 from ambari_commons.shell import shellRunner
@@ -136,8 +137,13 @@ class Hardware:
     if not cls._check_remote_mounts(config):
       command.append("-l")
 
-    df = subprocess.Popen(command, stdout=subprocess.PIPE)
-    dfdata = df.communicate()[0]
+    try:
+      code, out, err = shell.call(command, stdout = subprocess.PIPE, stderr = subprocess.PIPE, timeout = int(timeout), quiet = True)
+      dfdata = out
+    except Exception as ex:
+      logger.warn("Checking disk usage failed: " + str(ex))
+      dfdata = ''
+
     mounts = [cls._parse_df_line(line) for line in dfdata.splitlines() if line]
     result_mounts = []
     ignored_mounts = []

http://git-wip-us.apache.org/repos/asf/ambari/blob/ffaa961f/ambari-agent/src/test/python/ambari_agent/TestHardware.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/ambari_agent/TestHardware.py b/ambari-agent/src/test/python/ambari_agent/TestHardware.py
index 79205cf..d30020c 100644
--- a/ambari-agent/src/test/python/ambari_agent/TestHardware.py
+++ b/ambari-agent/src/test/python/ambari_agent/TestHardware.py
@@ -25,6 +25,7 @@ from mock.mock import patch, MagicMock, Mock
 import unittest
 import platform
 import socket
+import subprocess
 import os
 from only_for_platform import not_for_platform, PLATFORM_WINDOWS
 from ambari_agent import hostname
@@ -32,6 +33,7 @@ from ambari_agent.Hardware import Hardware
 from ambari_agent.AmbariConfig import AmbariConfig
 from ambari_agent.Facter import Facter, FacterLinux
 from ambari_commons import OSCheck
+from resource_management.core import shell
 
 
 @not_for_platform(PLATFORM_WINDOWS)
@@ -85,7 +87,8 @@ class TestHardware(TestCase):
 
   @patch.object(Hardware, "_chk_writable_mount")
   @patch("ambari_agent.Hardware.path_isfile")
-  def test_osdisks_parsing(self, isfile_mock, chk_writable_mount_mock):
+  @patch("resource_management.core.shell.call")
+  def test_osdisks_parsing(self, shell_call_mock, isfile_mock, chk_writable_mount_mock):
     df_output =\
                 """Filesystem                                                                                        Type  1024-blocks     Used Available Capacity Mounted on
                 /dev/mapper/docker-253:0-4980899-d45c264d37ab18c8ed14f890f4d59ac2b81e1c52919eb36a79419787209515f3 xfs      31447040  1282384  30164656       5% /
@@ -108,18 +111,9 @@ class TestHardware(TestCase):
 
     isfile_mock.side_effect = isfile_side_effect
     chk_writable_mount_mock.side_effect = chk_writable_mount_side_effect
+    shell_call_mock.return_value = (0, df_output, '')
 
-    with patch("subprocess.Popen") as open_mock:
-      proc_mock = Mock()
-      attr = {
-        'communicate.return_value': [
-          df_output
-        ]
-      }
-      proc_mock.configure_mock(**attr)
-      open_mock.return_value = proc_mock
-
-      result = Hardware.osdisks()
+    result = Hardware.osdisks()
 
     self.assertEquals(1, len(result))
 
@@ -130,39 +124,40 @@ class TestHardware(TestCase):
 
   @patch.object(OSCheck, "get_os_type")
   @patch.object(OSCheck, "get_os_version")
-  @patch("subprocess.Popen")
-  @patch("subprocess.Popen.communicate")
-  def test_osdisks_remote(self, communicate_mock, popen_mock,
-                          get_os_version_mock, get_os_type_mock):
+  @patch("resource_management.core.shell.call")
+  def test_osdisks_remote(self, shell_call_mock, get_os_version_mock, get_os_type_mock):
     get_os_type_mock.return_value = "suse"
     get_os_version_mock.return_value = "11"
     Hardware.osdisks()
-    popen_mock.assert_called_with(['timeout', '10', "df", "-kPT"], stdout=-1)
+    timeout = 10
+    shell_call_mock.assert_called_with(['timeout', str(timeout), "df", "-kPT"], stdout = subprocess.PIPE, stderr = subprocess.PIPE, timeout = timeout, quiet = True)
 
     config = AmbariConfig()
     Hardware.osdisks(config)
-    popen_mock.assert_called_with(['timeout', '10', "df", "-kPT"], stdout=-1)
+    shell_call_mock.assert_called_with(['timeout', str(timeout), "df", "-kPT"], stdout = subprocess.PIPE, stderr = subprocess.PIPE, timeout = timeout, quiet = True)
 
     config.add_section(AmbariConfig.AMBARI_PROPERTIES_CATEGORY)
     config.set(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, Hardware.CHECK_REMOTE_MOUNTS_KEY, "true")
     Hardware.osdisks(config)
-    popen_mock.assert_called_with(['timeout', '10', "df", "-kPT"], stdout=-1)
+    shell_call_mock.assert_called_with(['timeout', str(timeout), "df", "-kPT"], stdout = subprocess.PIPE, stderr = subprocess.PIPE, timeout = timeout, quiet = True)
 
     config.set(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, Hardware.CHECK_REMOTE_MOUNTS_KEY, "false")
     Hardware.osdisks(config)
-    popen_mock.assert_called_with(['timeout', '10', "df", "-kPT", "-l"], stdout=-1)
+    shell_call_mock.assert_called_with(['timeout', str(timeout), "df", "-kPT", "-l"], stdout = subprocess.PIPE, stderr = subprocess.PIPE, timeout = timeout, quiet = True)
 
     config.set(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY, "0")
     Hardware.osdisks(config)
-    popen_mock.assert_called_with(['timeout', '10', "df", "-kPT", "-l"], stdout=-1)
+    shell_call_mock.assert_called_with(['timeout', str(timeout), "df", "-kPT", "-l"], stdout = subprocess.PIPE, stderr = subprocess.PIPE, timeout = timeout, quiet = True)
 
-    config.set(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY, "1")
+    timeout = 1
+    config.set(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY, str(timeout))
     Hardware.osdisks(config)
-    popen_mock.assert_called_with(["timeout", "1", "df", "-kPT", "-l"], stdout=-1)
+    shell_call_mock.assert_called_with(['timeout', str(timeout), "df", "-kPT", "-l"], stdout = subprocess.PIPE, stderr = subprocess.PIPE, timeout = timeout, quiet = True)
 
-    config.set(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY, "2")
+    timeout = 2
+    config.set(AmbariConfig.AMBARI_PROPERTIES_CATEGORY, Hardware.CHECK_REMOTE_MOUNTS_TIMEOUT_KEY, str(timeout))
     Hardware.osdisks(config)
-    popen_mock.assert_called_with(["timeout", "2", "df", "-kPT", "-l"], stdout=-1)
+    shell_call_mock.assert_called_with(['timeout', str(timeout), "df", "-kPT", "-l"], stdout = subprocess.PIPE, stderr = subprocess.PIPE, timeout = timeout, quiet = True)
 
   def test_parse_df_line(self):
     df_line_sample = "device type size used available percent mountpoint"
@@ -382,7 +377,8 @@ SwapFree:        1598676 kB
 
   @patch.object(Hardware, "_chk_writable_mount")
   @patch("ambari_agent.Hardware.path_isfile")
-  def test_osdisks_blacklist(self, isfile_mock, chk_writable_mount_mock):
+  @patch("resource_management.core.shell.call")
+  def test_osdisks_blacklist(self, shell_call_mock, isfile_mock, chk_writable_mount_mock):
     df_output = \
       """Filesystem                                                                                        Type  1024-blocks     Used Available Capacity Mounted on
       /dev/mapper/docker-253:0-4980899-d45c264d37ab18c8ed14f890f4d59ac2b81e1c52919eb36a79419787209515f3 xfs      31447040  1282384  30164656       5% /
@@ -414,33 +410,25 @@ SwapFree:        1598676 kB
       }
     }
 
-    with patch("subprocess.Popen") as open_mock:
-      proc_mock = Mock()
-      attr = {
-        'communicate.return_value': [
-          df_output
-        ]
-      }
-      proc_mock.configure_mock(**attr)
-      open_mock.return_value = proc_mock
+    shell_call_mock.return_value = (0, df_output, '')
 
-      def conf_get(section, key, default=""):
-        if section in config_dict and key in config_dict[section]:
-          return config_dict[section][key]
+    def conf_get(section, key, default=""):
+      if section in config_dict and key in config_dict[section]:
+        return config_dict[section][key]
 
-        return default
+      return default
 
-      def has_option(section, key):
-        return section in config_dict and key in config_dict[section]
+    def has_option(section, key):
+      return section in config_dict and key in config_dict[section]
 
-      conf = Mock()
-      attr = {
-        'get.side_effect': conf_get,
-        'has_option.side_effect': has_option
-      }
-      conf.configure_mock(**attr)
+    conf = Mock()
+    attr = {
+      'get.side_effect': conf_get,
+      'has_option.side_effect': has_option
+    }
+    conf.configure_mock(**attr)
 
-      result = Hardware.osdisks(conf)
+    result = Hardware.osdisks(conf)
 
     self.assertEquals(1, len(result))
 


[30/51] [abbrv] ambari git commit: AMBARI-19878 Log Search Portal time zone selection bug (mgergely)

Posted by rz...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/e3b9ef3c/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/timezone/jstz-1.0.4.min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/timezone/jstz-1.0.4.min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/timezone/jstz-1.0.4.min.js
new file mode 100644
index 0000000..96e3dd8
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/timezone/jstz-1.0.4.min.js
@@ -0,0 +1,2 @@
+/*! jstz - v1.0.4 - 2012-12-12 */
+(function(e){var t=function(){"use strict";var e="s",n=function(e){var t=-e.getTimezoneOffset();return t!==null?t:0},r=function(e,t,n){var r=new Date;return e!==undefined&&r.setFullYear(e),r.setDate(n),r.setMonth(t),r},i=function(e){return n(r(e,0,2))},s=function(e){return n(r(e,5,2))},o=function(e){var t=e.getMonth()>7?s(e.getFullYear()):i(e.getFullYear()),r=n(e);return t-r!==0},u=function(){var t=i(),n=s(),r=i()-s();return r<0?t+",1":r>0?n+",1,"+e:t+",0"},a=function(){var e=u();return new t.TimeZone(t.olson.timezones[e])};return{determine:a,date_is_dst:o}}();t.TimeZone=function(e){"use strict";var n=null,r=function(){return n},i=function(){var e=t.olson.ambiguity_list[n],r=e.length,i=0,s=e[0];for(;i<r;i+=1){s=e[i];if(t.date_is_dst(t.olson.dst_start_dates[s])){n=s;return}}},s=function(){return typeof t.olson.ambiguity_list[n]!="undefined"};return n=e,s()&&i(),{name:r}},t.olson={},t.olson.timezones={"-720,0":"Etc/GMT+12","-660,0":"Pacific/Pago_Pago","-600,1":"America/Adak","-600,0":
 "Pacific/Honolulu","-570,0":"Pacific/Marquesas","-540,0":"Pacific/Gambier","-540,1":"America/Anchorage","-480,1":"America/Los_Angeles","-480,0":"Pacific/Pitcairn","-420,0":"America/Phoenix","-420,1":"America/Denver","-360,0":"America/Guatemala","-360,1":"America/Chicago","-360,1,s":"Pacific/Easter","-300,0":"America/Bogota","-300,1":"America/New_York","-270,0":"America/Caracas","-240,1":"America/Halifax","-240,0":"America/Santo_Domingo","-240,1,s":"America/Santiago","-210,1":"America/St_Johns","-180,1":"America/Godthab","-180,0":"America/Argentina/Buenos_Aires","-180,1,s":"America/Montevideo","-120,0":"Etc/GMT+2","-120,1":"Etc/GMT+2","-60,1":"Atlantic/Azores","-60,0":"Atlantic/Cape_Verde","0,0":"Etc/UTC","0,1":"Europe/London","60,1":"Europe/Berlin","60,0":"Africa/Lagos","60,1,s":"Africa/Windhoek","120,1":"Asia/Beirut","120,0":"Africa/Johannesburg","180,0":"Asia/Baghdad","180,1":"Europe/Moscow","210,1":"Asia/Tehran","240,0":"Asia/Dubai","240,1":"Asia/Baku","270,0":"Asia/Kabul","300,1
 ":"Asia/Yekaterinburg","300,0":"Asia/Karachi","330,0":"Asia/Kolkata","345,0":"Asia/Kathmandu","360,0":"Asia/Dhaka","360,1":"Asia/Omsk","390,0":"Asia/Rangoon","420,1":"Asia/Krasnoyarsk","420,0":"Asia/Jakarta","480,0":"Asia/Shanghai","480,1":"Asia/Irkutsk","525,0":"Australia/Eucla","525,1,s":"Australia/Eucla","540,1":"Asia/Yakutsk","540,0":"Asia/Tokyo","570,0":"Australia/Darwin","570,1,s":"Australia/Adelaide","600,0":"Australia/Brisbane","600,1":"Asia/Vladivostok","600,1,s":"Australia/Sydney","630,1,s":"Australia/Lord_Howe","660,1":"Asia/Kamchatka","660,0":"Pacific/Noumea","690,0":"Pacific/Norfolk","720,1,s":"Pacific/Auckland","720,0":"Pacific/Tarawa","765,1,s":"Pacific/Chatham","780,0":"Pacific/Tongatapu","780,1,s":"Pacific/Apia","840,0":"Pacific/Kiritimati"},t.olson.dst_start_dates=function(){"use strict";var e=new Date(2010,6,15,1,0,0,0);return{"America/Denver":new Date(2011,2,13,3,0,0,0),"America/Mazatlan":new Date(2011,3,3,3,0,0,0),"America/Chicago":new Date(2011,2,13,3,0,0,0),"A
 merica/Mexico_City":new Date(2011,3,3,3,0,0,0),"America/Asuncion":new Date(2012,9,7,3,0,0,0),"America/Santiago":new Date(2012,9,3,3,0,0,0),"America/Campo_Grande":new Date(2012,9,21,5,0,0,0),"America/Montevideo":new Date(2011,9,2,3,0,0,0),"America/Sao_Paulo":new Date(2011,9,16,5,0,0,0),"America/Los_Angeles":new Date(2011,2,13,8,0,0,0),"America/Santa_Isabel":new Date(2011,3,5,8,0,0,0),"America/Havana":new Date(2012,2,10,2,0,0,0),"America/New_York":new Date(2012,2,10,7,0,0,0),"Asia/Beirut":new Date(2011,2,27,1,0,0,0),"Europe/Helsinki":new Date(2011,2,27,4,0,0,0),"Europe/Istanbul":new Date(2011,2,28,5,0,0,0),"Asia/Damascus":new Date(2011,3,1,2,0,0,0),"Asia/Jerusalem":new Date(2011,3,1,6,0,0,0),"Asia/Gaza":new Date(2009,2,28,0,30,0,0),"Africa/Cairo":new Date(2009,3,25,0,30,0,0),"Pacific/Auckland":new Date(2011,8,26,7,0,0,0),"Pacific/Fiji":new Date(2010,11,29,23,0,0,0),"America/Halifax":new Date(2011,2,13,6,0,0,0),"America/Goose_Bay":new Date(2011,2,13,2,1,0,0),"America/Miquelon":new Date
 (2011,2,13,5,0,0,0),"America/Godthab":new Date(2011,2,27,1,0,0,0),"Europe/Moscow":e,"Asia/Yekaterinburg":e,"Asia/Omsk":e,"Asia/Krasnoyarsk":e,"Asia/Irkutsk":e,"Asia/Yakutsk":e,"Asia/Vladivostok":e,"Asia/Kamchatka":e,"Europe/Minsk":e,"Australia/Perth":new Date(2008,10,1,1,0,0,0)}}(),t.olson.ambiguity_list={"America/Denver":["America/Denver","America/Mazatlan"],"America/Chicago":["America/Chicago","America/Mexico_City"],"America/Santiago":["America/Santiago","America/Asuncion","America/Campo_Grande"],"America/Montevideo":["America/Montevideo","America/Sao_Paulo"],"Asia/Beirut":["Asia/Beirut","Europe/Helsinki","Europe/Istanbul","Asia/Damascus","Asia/Jerusalem","Asia/Gaza"],"Pacific/Auckland":["Pacific/Auckland","Pacific/Fiji"],"America/Los_Angeles":["America/Los_Angeles","America/Santa_Isabel"],"America/New_York":["America/Havana","America/New_York"],"America/Halifax":["America/Goose_Bay","America/Halifax"],"America/Godthab":["America/Miquelon","America/Godthab"],"Asia/Dubai":["Europe/
 Moscow"],"Asia/Dhaka":["Asia/Yekaterinburg"],"Asia/Jakarta":["Asia/Omsk"],"Asia/Shanghai":["Asia/Krasnoyarsk","Australia/Perth"],"Asia/Tokyo":["Asia/Irkutsk"],"Australia/Brisbane":["Asia/Yakutsk"],"Pacific/Noumea":["Asia/Vladivostok"],"Pacific/Tarawa":["Asia/Kamchatka"],"Africa/Johannesburg":["Asia/Gaza","Africa/Cairo"],"Asia/Baghdad":["Europe/Minsk"]},typeof exports!="undefined"?exports.jstz=t:e.jstz=t})(this);
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/e3b9ef3c/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/daterangepicker/css/daterangepicker.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/daterangepicker/css/daterangepicker.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/daterangepicker/css/daterangepicker.css
deleted file mode 100644
index 7f1ef54..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/daterangepicker/css/daterangepicker.css
+++ /dev/null
@@ -1,415 +0,0 @@
-.daterangepicker {
-    position: absolute;
-    color: inherit;
-    background: #fff;
-    border-radius: 4px;
-    width: 278px;
-    padding: 4px;
-    margin-top: 1px;
-    top: 100px;
-    left: 20px;
-    /* Calendars */
-}
-
-.daterangepicker:before,
-.daterangepicker:after {
-    position: absolute;
-    display: inline-block;
-    border-bottom-color: rgba(0, 0, 0, 0.2);
-    content: '';
-}
-
-.daterangepicker:before {
-    top: -7px;
-    border-right: 7px solid transparent;
-    border-left: 7px solid transparent;
-    border-bottom: 7px solid #ccc;
-}
-
-.daterangepicker:after {
-    top: -6px;
-    border-right: 6px solid transparent;
-    border-bottom: 6px solid #fff;
-    border-left: 6px solid transparent;
-}
-
-.daterangepicker.opensleft:before {
-    right: 9px;
-}
-
-.daterangepicker.opensleft:after {
-    right: 10px;
-}
-
-.daterangepicker.openscenter:before {
-    left: 0;
-    right: 0;
-    width: 0;
-    margin-left: auto;
-    margin-right: auto;
-}
-
-.daterangepicker.openscenter:after {
-    left: 0;
-    right: 0;
-    width: 0;
-    margin-left: auto;
-    margin-right: auto;
-}
-
-.daterangepicker.opensright:before {
-    left: 9px;
-}
-
-.daterangepicker.opensright:after {
-    left: 10px;
-}
-
-.daterangepicker.dropup {
-    margin-top: -5px;
-}
-
-.daterangepicker.dropup:before {
-    top: initial;
-    bottom: -7px;
-    border-bottom: initial;
-    border-top: 7px solid #ccc;
-}
-
-.daterangepicker.dropup:after {
-    top: initial;
-    bottom: -6px;
-    border-bottom: initial;
-    border-top: 6px solid #fff;
-}
-
-.daterangepicker.dropdown-menu {
-    max-width: none;
-    z-index: 3001;
-}
-
-.daterangepicker.single .ranges,
-.daterangepicker.single .calendar {
-    float: none;
-}
-
-.daterangepicker.show-calendar .calendar {
-    display: block;
-}
-
-.daterangepicker .calendar {
-    display: none;
-    max-width: 270px;
-    margin: 4px;
-}
-
-.daterangepicker .calendar.single .calendar-table {
-    border: none;
-}
-
-.daterangepicker .calendar th,
-.daterangepicker .calendar td {
-    white-space: nowrap;
-    text-align: center;
-    min-width: 32px;
-}
-
-.daterangepicker .calendar-table {
-    border: 1px solid #fff;
-    padding: 4px;
-    border-radius: 4px;
-    background: #fff;
-}
-
-.daterangepicker table {
-    width: 100%;
-    margin: 0;
-}
-
-.daterangepicker td,
-.daterangepicker th {
-    text-align: center;
-    width: 20px;
-    height: 20px;
-    border-radius: 4px;
-    border: 1px solid transparent;
-    white-space: nowrap;
-    cursor: pointer;
-}
-
-.daterangepicker td.available:hover,
-.daterangepicker th.available:hover {
-    background-color: #eee;
-    border-color: transparent;
-    color: inherit;
-}
-
-.daterangepicker td.week,
-.daterangepicker th.week {
-    font-size: 80%;
-    color: #ccc;
-}
-
-.daterangepicker td.off,
-.daterangepicker td.off.in-range,
-.daterangepicker td.off.start-date,
-.daterangepicker td.off.end-date {
-    background-color: #fff;
-    border-color: transparent;
-    color: #999;
-}
-
-.daterangepicker td.in-range {
-    background-color: #ebf4f8;
-    border-color: transparent;
-    color: #000;
-    border-radius: 0;
-}
-
-.daterangepicker td.start-date {
-    border-radius: 4px 0 0 4px;
-}
-
-.daterangepicker td.end-date {
-    border-radius: 0 4px 4px 0;
-}
-
-.daterangepicker td.start-date.end-date {
-    border-radius: 4px;
-}
-
-.daterangepicker td.active,
-.daterangepicker td.active:hover {
-    background-color: #357ebd;
-    border-color: transparent;
-    color: #fff;
-}
-
-.daterangepicker th.month {
-    width: auto;
-}
-
-.daterangepicker td.disabled,
-.daterangepicker option.disabled {
-    color: #999;
-    cursor: not-allowed;
-    text-decoration: line-through;
-}
-
-.daterangepicker select.monthselect,
-.daterangepicker select.yearselect {
-    font-size: 12px;
-    padding: 1px;
-    height: auto;
-    margin: 0;
-    cursor: default;
-}
-
-.daterangepicker select.monthselect {
-    margin-right: 2%;
-    width: 56%;
-}
-
-.daterangepicker select.yearselect {
-    width: 40%;
-}
-
-.daterangepicker select.hourselect,
-.daterangepicker select.minuteselect,
-.daterangepicker select.secondselect,
-.daterangepicker select.ampmselect {
-    width: 50px;
-    margin-bottom: 0;
-}
-
-.daterangepicker .input-mini {
-    border: 1px solid #ccc;
-    border-radius: 4px;
-    color: #555;
-    height: 30px;
-    line-height: 30px;
-    display: block;
-    vertical-align: middle;
-    margin: 0 0 5px 0;
-    padding: 0 6px 0 28px;
-    width: 100%;
-}
-
-.daterangepicker .input-mini.active {
-    border: 1px solid #08c;
-    border-radius: 4px;
-}
-
-.daterangepicker .daterangepicker_input {
-    position: relative;
-}
-
-.daterangepicker .daterangepicker_input i {
-    position: absolute;
-    left: 8px;
-    top: 8px;
-}
-
-.daterangepicker.rtl .input-mini {
-    padding-right: 28px;
-    padding-left: 6px;
-}
-
-.daterangepicker.rtl .daterangepicker_input i {
-    left: auto;
-    right: 8px;
-}
-
-.daterangepicker .calendar-time {
-    text-align: center;
-    margin: 5px auto;
-    line-height: 30px;
-    position: relative;
-    padding-left: 28px;
-}
-
-.daterangepicker .calendar-time select.disabled {
-    color: #ccc;
-    cursor: not-allowed;
-}
-
-.ranges {
-    font-size: 11px;
-    float: none;
-    margin: 4px;
-    text-align: left;
-}
-
-.ranges ul {
-    list-style: none;
-    margin: 0 auto;
-    padding: 0;
-    width: 100%;
-}
-
-.ranges li {
-    font-size: 13px;
-    background: #f5f5f5;
-    border: 1px solid #f5f5f5;
-    border-radius: 4px;
-    color: #08c;
-    padding: 3px 12px;
-    margin-bottom: 8px;
-    cursor: pointer;
-}
-
-.ranges li:hover {
-    background: #08c;
-    border: 1px solid #08c;
-    color: #fff;
-}
-
-.ranges li.active {
-    background: #08c;
-    border: 1px solid #08c;
-    color: #fff;
-}
-
-
-/*  Larger Screen Styling */
-
-@media (min-width: 564px) {
-    .daterangepicker {
-        width: auto;
-    }
-    .daterangepicker .ranges ul {
-        width: 160px;
-    }
-    .daterangepicker.single .ranges ul {
-        width: 100%;
-    }
-    .daterangepicker.single .calendar.left {
-        clear: none;
-    }
-    .daterangepicker.single.ltr .ranges,
-    .daterangepicker.single.ltr .calendar {
-        float: left;
-    }
-    .daterangepicker.single.rtl .ranges,
-    .daterangepicker.single.rtl .calendar {
-        float: right;
-    }
-    .daterangepicker.ltr {
-        direction: ltr;
-        text-align: left;
-    }
-    .daterangepicker.ltr .calendar.left {
-        clear: left;
-        margin-right: 0;
-    }
-    .daterangepicker.ltr .calendar.left .calendar-table {
-        border-right: none;
-        border-top-right-radius: 0;
-        border-bottom-right-radius: 0;
-    }
-    .daterangepicker.ltr .calendar.right {
-        margin-left: 0;
-    }
-    .daterangepicker.ltr .calendar.right .calendar-table {
-        border-left: none;
-        border-top-left-radius: 0;
-        border-bottom-left-radius: 0;
-    }
-    .daterangepicker.ltr .left .daterangepicker_input {
-        padding-right: 12px;
-    }
-    .daterangepicker.ltr .calendar.left .calendar-table {
-        padding-right: 12px;
-    }
-    .daterangepicker.ltr .ranges,
-    .daterangepicker.ltr .calendar {
-        float: left;
-    }
-    .daterangepicker.rtl {
-        direction: rtl;
-        text-align: right;
-    }
-    .daterangepicker.rtl .calendar.left {
-        clear: right;
-        margin-left: 0;
-    }
-    .daterangepicker.rtl .calendar.left .calendar-table {
-        border-left: none;
-        border-top-left-radius: 0;
-        border-bottom-left-radius: 0;
-    }
-    .daterangepicker.rtl .calendar.right {
-        margin-right: 0;
-    }
-    .daterangepicker.rtl .calendar.right .calendar-table {
-        border-right: none;
-        border-top-right-radius: 0;
-        border-bottom-right-radius: 0;
-    }
-    .daterangepicker.rtl .left .daterangepicker_input {
-        padding-left: 12px;
-    }
-    .daterangepicker.rtl .calendar.left .calendar-table {
-        padding-left: 12px;
-    }
-    .daterangepicker.rtl .ranges,
-    .daterangepicker.rtl .calendar {
-        text-align: right;
-        float: right;
-    }
-}
-
-@media (min-width: 730px) {
-    .daterangepicker .ranges {
-        width: auto;
-    }
-    .daterangepicker.ltr .ranges {
-        float: left;
-    }
-    .daterangepicker.rtl .ranges {
-        float: right;
-    }
-    .daterangepicker .calendar.left {
-        clear: none !important;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/e3b9ef3c/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/daterangepicker/js/daterangepicker.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/daterangepicker/js/daterangepicker.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/daterangepicker/js/daterangepicker.js
deleted file mode 100644
index e88b45f..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/daterangepicker/js/daterangepicker.js
+++ /dev/null
@@ -1,1560 +0,0 @@
-/**
-* @version: 2.1.24
-* @author: Dan Grossman http://www.dangrossman.info/
-* @copyright: Copyright (c) 2012-2016 Dan Grossman. All rights reserved.
-* @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
-* @website: https://www.improvely.com/
-*/
-// Follow the UMD template https://github.com/umdjs/umd/blob/master/templates/returnExportsGlobal.js
-(function (root, factory) {
-    if (typeof define === 'function' && define.amd) {
-        // AMD. Make globaly available as well
-        define(['moment', 'jquery'], function (moment, jquery) {
-            return (root.daterangepicker = factory(moment, jquery));
-        });
-    } else if (typeof module === 'object' && module.exports) {
-        // Node / Browserify
-        //isomorphic issue
-        var jQuery = (typeof window != 'undefined') ? window.jQuery : undefined;
-        if (!jQuery) {
-            jQuery = require('jquery');
-            if (!jQuery.fn) jQuery.fn = {};
-        }
-        module.exports = factory(require('moment'), jQuery);
-    } else {
-        // Browser globals
-        root.daterangepicker = factory(root.moment, root.jQuery);
-    }
-}(this, function(moment, $) {
-    var DateRangePicker = function(element, options, cb) {
-
-        //default settings for options
-        this.parentEl = 'body';
-        this.element = $(element);
-        this.startDate = moment().startOf('day');
-        this.endDate = moment().endOf('day');
-        this.minDate = false;
-        this.maxDate = false;
-        this.dateLimit = false;
-        this.autoApply = false;
-        this.singleDatePicker = false;
-        this.showDropdowns = false;
-        this.showWeekNumbers = false;
-        this.showISOWeekNumbers = false;
-        this.showCustomRangeLabel = true;
-        this.timePicker = false;
-        this.timePicker24Hour = false;
-        this.timePickerIncrement = 1;
-        this.timePickerSeconds = false;
-        this.linkedCalendars = true;
-        this.autoUpdateInput = true;
-        this.alwaysShowCalendars = false;
-
-        this.opens = 'right';
-        if (this.element.hasClass('pull-right'))
-            this.opens = 'left';
-
-        this.drops = 'down';
-        if (this.element.hasClass('dropup'))
-            this.drops = 'up';
-
-        this.buttonClasses = 'btn btn-sm';
-        this.applyClass = 'btn-success';
-        this.cancelClass = 'btn-default';
-
-        this.locale = {
-            direction: 'ltr',
-            format: 'MM/DD/YYYY',
-            separator: ' - ',
-            applyLabel: 'Apply',
-            cancelLabel: 'Cancel',
-            weekLabel: 'W',
-            customRangeLabel: 'Custom Range',
-            daysOfWeek: moment.weekdaysMin(),
-            monthNames: moment.monthsShort(),
-            firstDay: moment.localeData().firstDayOfWeek()
-        };
-
-        this.callback = function() { };
-
-        //some state information
-        this.isShowing = false;
-        this.leftCalendar = {};
-        this.rightCalendar = {};
-
-        //custom options from user
-        if (typeof options !== 'object' || options === null)
-            options = {};
-
-        //allow setting options with data attributes
-        //data-api options will be overwritten with custom javascript options
-        options = $.extend(this.element.data(), options);
-
-        //html template for the picker UI
-        if (typeof options.template !== 'string' && !(options.template instanceof $))
-            options.template = '<div class="daterangepicker dropdown-menu">' +
-                '<div class="calendar left">' +
-                    '<div class="daterangepicker_input">' +
-                      '<input class="input-mini form-control" type="text" name="daterangepicker_start" value="" />' +
-                      '<i class="fa fa-calendar glyphicon glyphicon-calendar"></i>' +
-                      '<div class="calendar-time">' +
-                        '<div></div>' +
-                        '<i class="fa fa-clock-o glyphicon glyphicon-time"></i>' +
-                      '</div>' +
-                    '</div>' +
-                    '<div class="calendar-table"></div>' +
-                '</div>' +
-                '<div class="calendar right">' +
-                    '<div class="daterangepicker_input">' +
-                      '<input class="input-mini form-control" type="text" name="daterangepicker_end" value="" />' +
-                      '<i class="fa fa-calendar glyphicon glyphicon-calendar"></i>' +
-                      '<div class="calendar-time">' +
-                        '<div></div>' +
-                        '<i class="fa fa-clock-o glyphicon glyphicon-time"></i>' +
-                      '</div>' +
-                    '</div>' +
-                    '<div class="calendar-table"></div>' +
-                '</div>' +
-                '<div class="ranges">' +
-                    '<div class="range_inputs">' +
-                        '<button class="applyBtn" disabled="disabled" type="button"></button> ' +
-                        '<button class="cancelBtn" type="button"></button>' +
-                    '</div>' +
-                '</div>' +
-            '</div>';
-
-        this.parentEl = (options.parentEl && $(options.parentEl).length) ? $(options.parentEl) : $(this.parentEl);
-        this.container = $(options.template).appendTo(this.parentEl);
-
-        //
-        // handle all the possible options overriding defaults
-        //
-
-        if (typeof options.locale === 'object') {
-
-            if (typeof options.locale.direction === 'string')
-                this.locale.direction = options.locale.direction;
-
-            if (typeof options.locale.format === 'string')
-                this.locale.format = options.locale.format;
-
-            if (typeof options.locale.separator === 'string')
-                this.locale.separator = options.locale.separator;
-
-            if (typeof options.locale.daysOfWeek === 'object')
-                this.locale.daysOfWeek = options.locale.daysOfWeek.slice();
-
-            if (typeof options.locale.monthNames === 'object')
-              this.locale.monthNames = options.locale.monthNames.slice();
-
-            if (typeof options.locale.firstDay === 'number')
-              this.locale.firstDay = options.locale.firstDay;
-
-            if (typeof options.locale.applyLabel === 'string')
-              this.locale.applyLabel = options.locale.applyLabel;
-
-            if (typeof options.locale.cancelLabel === 'string')
-              this.locale.cancelLabel = options.locale.cancelLabel;
-
-            if (typeof options.locale.weekLabel === 'string')
-              this.locale.weekLabel = options.locale.weekLabel;
-
-            if (typeof options.locale.customRangeLabel === 'string')
-              this.locale.customRangeLabel = options.locale.customRangeLabel;
-
-        }
-        this.container.addClass(this.locale.direction);
-
-        if (typeof options.startDate === 'string')
-            this.startDate = moment(options.startDate, this.locale.format);
-
-        if (typeof options.endDate === 'string')
-            this.endDate = moment(options.endDate, this.locale.format);
-
-        if (typeof options.minDate === 'string')
-            this.minDate = moment(options.minDate, this.locale.format);
-
-        if (typeof options.maxDate === 'string')
-            this.maxDate = moment(options.maxDate, this.locale.format);
-
-        if (typeof options.startDate === 'object')
-            this.startDate = moment(options.startDate);
-
-        if (typeof options.endDate === 'object')
-            this.endDate = moment(options.endDate);
-
-        if (typeof options.minDate === 'object')
-            this.minDate = moment(options.minDate);
-
-        if (typeof options.maxDate === 'object')
-            this.maxDate = moment(options.maxDate);
-
-        // sanity check for bad options
-        if (this.minDate && this.startDate.isBefore(this.minDate))
-            this.startDate = this.minDate.clone();
-
-        // sanity check for bad options
-        if (this.maxDate && this.endDate.isAfter(this.maxDate))
-            this.endDate = this.maxDate.clone();
-
-        if (typeof options.applyClass === 'string')
-            this.applyClass = options.applyClass;
-
-        if (typeof options.cancelClass === 'string')
-            this.cancelClass = options.cancelClass;
-
-        if (typeof options.dateLimit === 'object')
-            this.dateLimit = options.dateLimit;
-
-        if (typeof options.opens === 'string')
-            this.opens = options.opens;
-
-        if (typeof options.drops === 'string')
-            this.drops = options.drops;
-
-        if (typeof options.showWeekNumbers === 'boolean')
-            this.showWeekNumbers = options.showWeekNumbers;
-
-        if (typeof options.showISOWeekNumbers === 'boolean')
-            this.showISOWeekNumbers = options.showISOWeekNumbers;
-
-        if (typeof options.buttonClasses === 'string')
-            this.buttonClasses = options.buttonClasses;
-
-        if (typeof options.buttonClasses === 'object')
-            this.buttonClasses = options.buttonClasses.join(' ');
-
-        if (typeof options.showDropdowns === 'boolean')
-            this.showDropdowns = options.showDropdowns;
-
-        if (typeof options.showCustomRangeLabel === 'boolean')
-            this.showCustomRangeLabel = options.showCustomRangeLabel;
-
-        if (typeof options.singleDatePicker === 'boolean') {
-            this.singleDatePicker = options.singleDatePicker;
-            if (this.singleDatePicker)
-                this.endDate = this.startDate.clone();
-        }
-
-        if (typeof options.timePicker === 'boolean')
-            this.timePicker = options.timePicker;
-
-        if (typeof options.timePickerSeconds === 'boolean')
-            this.timePickerSeconds = options.timePickerSeconds;
-
-        if (typeof options.timePickerIncrement === 'number')
-            this.timePickerIncrement = options.timePickerIncrement;
-
-        if (typeof options.timePicker24Hour === 'boolean')
-            this.timePicker24Hour = options.timePicker24Hour;
-
-        if (typeof options.autoApply === 'boolean')
-            this.autoApply = options.autoApply;
-
-        if (typeof options.autoUpdateInput === 'boolean')
-            this.autoUpdateInput = options.autoUpdateInput;
-
-        if (typeof options.linkedCalendars === 'boolean')
-            this.linkedCalendars = options.linkedCalendars;
-
-        if (typeof options.isInvalidDate === 'function')
-            this.isInvalidDate = options.isInvalidDate;
-
-        if (typeof options.isCustomDate === 'function')
-            this.isCustomDate = options.isCustomDate;
-
-        if (typeof options.alwaysShowCalendars === 'boolean')
-            this.alwaysShowCalendars = options.alwaysShowCalendars;
-
-        // update day names order to firstDay
-        if (this.locale.firstDay != 0) {
-            var iterator = this.locale.firstDay;
-            while (iterator > 0) {
-                this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift());
-                iterator--;
-            }
-        }
-
-        var start, end, range;
-
-        //if no start/end dates set, check if an input element contains initial values
-        if (typeof options.startDate === 'undefined' && typeof options.endDate === 'undefined') {
-            if ($(this.element).is('input[type=text]')) {
-                var val = $(this.element).val(),
-                    split = val.split(this.locale.separator);
-
-                start = end = null;
-
-                if (split.length == 2) {
-                    start = moment(split[0], this.locale.format);
-                    end = moment(split[1], this.locale.format);
-                } else if (this.singleDatePicker && val !== "") {
-                    start = moment(val, this.locale.format);
-                    end = moment(val, this.locale.format);
-                }
-                if (start !== null && end !== null) {
-                    this.setStartDate(start);
-                    this.setEndDate(end);
-                }
-            }
-        }
-
-        if (typeof options.ranges === 'object') {
-            var list = '<ul>';
-            for (range of options.ranges) {
-                list += '<li data-range-key="' + range + '">' + range + '</li>';
-            }
-            if (this.showCustomRangeLabel) {
-                list += '<li data-range-key="' + this.locale.customRangeLabel + '">' + this.locale.customRangeLabel + '</li>';
-            }
-            list += '</ul>';
-            this.container.find('.ranges').prepend(list);
-        }
-
-        if (typeof cb === 'function') {
-            this.callback = cb;
-        }
-
-        if (!this.timePicker) {
-            this.startDate = this.startDate.startOf('day');
-            this.endDate = this.endDate.endOf('day');
-            this.container.find('.calendar-time').hide();
-        }
-
-        //can't be used together for now
-        if (this.timePicker && this.autoApply)
-            this.autoApply = false;
-
-        if (this.autoApply && typeof options.ranges !== 'object') {
-            this.container.find('.ranges').hide();
-        } else if (this.autoApply) {
-            this.container.find('.applyBtn, .cancelBtn').addClass('hide');
-        }
-
-        if (this.singleDatePicker) {
-            this.container.addClass('single');
-            this.container.find('.calendar.left').addClass('single');
-            this.container.find('.calendar.left').show();
-            this.container.find('.calendar.right').hide();
-            this.container.find('.daterangepicker_input input, .daterangepicker_input > i').hide();
-            if (this.timePicker) {
-                this.container.find('.ranges ul').hide();
-            } else {
-                this.container.find('.ranges').hide();
-            }
-        }
-
-        if ((typeof options.ranges === 'undefined' && !this.singleDatePicker) || this.alwaysShowCalendars) {
-            this.container.addClass('show-calendar');
-        }
-
-        this.container.addClass('opens' + this.opens);
-
-        //swap the position of the predefined ranges if opens right
-        if (typeof options.ranges !== 'undefined' && this.opens == 'right') {
-            this.container.find('.ranges').prependTo( this.container.find('.calendar.left').parent() );
-        }
-
-        //apply CSS classes and labels to buttons
-        this.container.find('.applyBtn, .cancelBtn').addClass(this.buttonClasses);
-        if (this.applyClass.length)
-            this.container.find('.applyBtn').addClass(this.applyClass);
-        if (this.cancelClass.length)
-            this.container.find('.cancelBtn').addClass(this.cancelClass);
-        this.container.find('.applyBtn').html(this.locale.applyLabel);
-        this.container.find('.cancelBtn').html(this.locale.cancelLabel);
-
-        //
-        // event listeners
-        //
-
-        this.container.find('.calendar')
-            .on('click.daterangepicker', '.prev', $.proxy(this.clickPrev, this))
-            .on('click.daterangepicker', '.next', $.proxy(this.clickNext, this))
-            .on('mousedown.daterangepicker', 'td.available', $.proxy(this.clickDate, this))
-            .on('mouseenter.daterangepicker', 'td.available', $.proxy(this.hoverDate, this))
-            .on('mouseleave.daterangepicker', 'td.available', $.proxy(this.updateFormInputs, this))
-            .on('change.daterangepicker', 'select.yearselect', $.proxy(this.monthOrYearChanged, this))
-            .on('change.daterangepicker', 'select.monthselect', $.proxy(this.monthOrYearChanged, this))
-            .on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.secondselect,select.ampmselect', $.proxy(this.timeChanged, this))
-            .on('click.daterangepicker', '.daterangepicker_input input', $.proxy(this.showCalendars, this))
-            .on('focus.daterangepicker', '.daterangepicker_input input', $.proxy(this.formInputsFocused, this))
-            .on('blur.daterangepicker', '.daterangepicker_input input', $.proxy(this.formInputsBlurred, this))
-            .on('change.daterangepicker', '.daterangepicker_input input', $.proxy(this.formInputsChanged, this));
-
-        this.container.find('.ranges')
-            .on('click.daterangepicker', 'button.applyBtn', $.proxy(this.clickApply, this))
-            .on('click.daterangepicker', 'button.cancelBtn', $.proxy(this.clickCancel, this))
-            .on('click.daterangepicker', 'li', $.proxy(this.clickRange, this))
-            .on('mouseenter.daterangepicker', 'li', $.proxy(this.hoverRange, this))
-            .on('mouseleave.daterangepicker', 'li', $.proxy(this.updateFormInputs, this));
-
-        if (this.element.is('input') || this.element.is('button')) {
-            this.element.on({
-                'click.daterangepicker': $.proxy(this.show, this),
-                'focus.daterangepicker': $.proxy(this.show, this),
-                'keyup.daterangepicker': $.proxy(this.elementChanged, this),
-                'keydown.daterangepicker': $.proxy(this.keydown, this)
-            });
-        } else {
-            this.element.on('click.daterangepicker', $.proxy(this.toggle, this));
-        }
-
-        //
-        // if attached to a text input, set the initial value
-        //
-
-        if (this.element.is('input') && !this.singleDatePicker && this.autoUpdateInput) {
-            this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
-            this.element.trigger('change');
-        } else if (this.element.is('input') && this.autoUpdateInput) {
-            this.element.val(this.startDate.format(this.locale.format));
-            this.element.trigger('change');
-        }
-
-    };
-
-    DateRangePicker.prototype = {
-
-        constructor: DateRangePicker,
-
-        setStartDate: function(startDate) {
-            if (typeof startDate === 'string')
-                this.startDate = moment(startDate, this.locale.format);
-
-            if (typeof startDate === 'object')
-                this.startDate = moment(startDate);
-
-            if (!this.timePicker)
-                this.startDate = this.startDate.startOf('day');
-
-            if (this.timePicker && this.timePickerIncrement)
-                this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
-
-            if (this.minDate && this.startDate.isBefore(this.minDate)) {
-                this.startDate = this.minDate;
-                if (this.timePicker && this.timePickerIncrement)
-                    this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
-            }
-
-            if (this.maxDate && this.startDate.isAfter(this.maxDate)) {
-                this.startDate = this.maxDate;
-                if (this.timePicker && this.timePickerIncrement)
-                    this.startDate.minute(Math.floor(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
-            }
-
-            if (!this.isShowing)
-                this.updateElement();
-
-            this.updateMonthsInView();
-        },
-
-        setEndDate: function(endDate) {
-            if (typeof endDate === 'string')
-                this.endDate = moment(endDate, this.locale.format);
-
-            if (typeof endDate === 'object')
-                this.endDate = moment(endDate);
-
-            if (!this.timePicker)
-                this.endDate = this.endDate.endOf('day');
-
-            if (this.timePicker && this.timePickerIncrement)
-                this.endDate.minute(Math.round(this.endDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
-
-            if (this.endDate.isBefore(this.startDate))
-                this.endDate = this.startDate.clone();
-
-            if (this.maxDate && this.endDate.isAfter(this.maxDate))
-                this.endDate = this.maxDate;
-
-            if (this.dateLimit && this.startDate.clone().add(this.dateLimit).isBefore(this.endDate))
-                this.endDate = this.startDate.clone().add(this.dateLimit);
-
-            this.previousRightTime = this.endDate.clone();
-
-            if (!this.isShowing)
-                this.updateElement();
-
-            this.updateMonthsInView();
-        },
-
-        isInvalidDate: function() {
-            return false;
-        },
-
-        isCustomDate: function() {
-            return false;
-        },
-
-        updateView: function() {
-            if (this.timePicker) {
-                this.renderTimePicker('left');
-                this.renderTimePicker('right');
-                if (!this.endDate) {
-                    this.container.find('.right .calendar-time select').attr('disabled', 'disabled').addClass('disabled');
-                } else {
-                    this.container.find('.right .calendar-time select').removeAttr('disabled').removeClass('disabled');
-                }
-            }
-            if (this.endDate) {
-                this.container.find('input[name="daterangepicker_end"]').removeClass('active');
-                this.container.find('input[name="daterangepicker_start"]').addClass('active');
-            } else {
-                this.container.find('input[name="daterangepicker_end"]').addClass('active');
-                this.container.find('input[name="daterangepicker_start"]').removeClass('active');
-            }
-            this.updateMonthsInView();
-            this.updateCalendars();
-            this.updateFormInputs();
-        },
-
-        updateMonthsInView: function() {
-            if (this.endDate) {
-
-                //if both dates are visible already, do nothing
-                if (!this.singleDatePicker && this.leftCalendar.month && this.rightCalendar.month &&
-                    (this.startDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.startDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM'))
-                    &&
-                    (this.endDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.endDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM'))
-                    ) {
-                    return;
-                }
-
-                this.leftCalendar.month = this.startDate.clone().date(2);
-                if (!this.linkedCalendars && (this.endDate.month() != this.startDate.month() || this.endDate.year() != this.startDate.year())) {
-                    this.rightCalendar.month = this.endDate.clone().date(2);
-                } else {
-                    this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month');
-                }
-
-            } else {
-                if (this.leftCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM') && this.rightCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM')) {
-                    this.leftCalendar.month = this.startDate.clone().date(2);
-                    this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month');
-                }
-            }
-            if (this.maxDate && this.linkedCalendars && !this.singleDatePicker && this.rightCalendar.month > this.maxDate) {
-              this.rightCalendar.month = this.maxDate.clone().date(2);
-              this.leftCalendar.month = this.maxDate.clone().date(2).subtract(1, 'month');
-            }
-        },
-
-        updateCalendars: function() {
-
-            if (this.timePicker) {
-                var hour, minute, second;
-                if (this.endDate) {
-                    hour = parseInt(this.container.find('.left .hourselect').val(), 10);
-                    minute = parseInt(this.container.find('.left .minuteselect').val(), 10);
-                    second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0;
-                    if (!this.timePicker24Hour) {
-                        var ampm = this.container.find('.left .ampmselect').val();
-                        if (ampm === 'PM' && hour < 12)
-                            hour += 12;
-                        if (ampm === 'AM' && hour === 12)
-                            hour = 0;
-                    }
-                } else {
-                    hour = parseInt(this.container.find('.right .hourselect').val(), 10);
-                    minute = parseInt(this.container.find('.right .minuteselect').val(), 10);
-                    second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0;
-                    if (!this.timePicker24Hour) {
-                        var ampm = this.container.find('.right .ampmselect').val();
-                        if (ampm === 'PM' && hour < 12)
-                            hour += 12;
-                        if (ampm === 'AM' && hour === 12)
-                            hour = 0;
-                    }
-                }
-                this.leftCalendar.month.hour(hour).minute(minute).second(second);
-                this.rightCalendar.month.hour(hour).minute(minute).second(second);
-            }
-
-            this.renderCalendar('left');
-            this.renderCalendar('right');
-
-            //highlight any predefined range matching the current start and end dates
-            this.container.find('.ranges li').removeClass('active');
-            this.chosenLabel = this.container.find('.ranges li:last').addClass('active').html();
-            if (this.endDate == null) return;
-            this.showCalendars();
-        },
-
-        renderCalendar: function(side) {
-
-            //
-            // Build the matrix of dates that will populate the calendar
-            //
-
-            var calendar = side == 'left' ? this.leftCalendar : this.rightCalendar;
-            var month = calendar.month.month();
-            var year = calendar.month.year();
-            var hour = calendar.month.hour();
-            var minute = calendar.month.minute();
-            var second = calendar.month.second();
-            var daysInMonth = moment([year, month]).daysInMonth();
-            var firstDay = moment([year, month, 1]);
-            var lastDay = moment([year, month, daysInMonth]);
-            var lastMonth = moment(firstDay).subtract(1, 'month').month();
-            var lastYear = moment(firstDay).subtract(1, 'month').year();
-            var daysInLastMonth = moment([lastYear, lastMonth]).daysInMonth();
-            var dayOfWeek = firstDay.day();
-
-            //initialize a 6 rows x 7 columns array for the calendar
-            var calendar = [];
-            calendar.firstDay = firstDay;
-            calendar.lastDay = lastDay;
-
-            for (var i = 0; i < 6; i++) {
-                calendar[i] = [];
-            }
-
-            //populate the calendar with date objects
-            var curDate;
-            var startDay = daysInLastMonth - dayOfWeek + this.locale.firstDay + 1;
-            if (startDay == daysInLastMonth + 1)
-                curDate = moment([year, month, 1, 12, minute, second]);
-            else if (startDay > daysInLastMonth )
-                curDate = moment([lastYear, lastMonth, startDay-7, 12, minute, second]);
-            else
-                curDate = moment([lastYear, lastMonth, startDay, 12, minute, second]);
-
-            var col, row;
-            for (var i = 0, col = 0, row = 0; i < 42; i++, col++, curDate = moment(curDate).add(24, 'hour')) {
-                if (i > 0 && col % 7 === 0) {
-                    col = 0;
-                    row++;
-                    if (curDate.month() != month)
-                        break
-                }
-                calendar[row][col] = curDate.clone().hour(hour).minute(minute).second(second);
-                curDate.hour(12);
-
-                if (this.minDate && calendar[row][col].format('YYYY-MM-DD') == this.minDate.format('YYYY-MM-DD') && calendar[row][col].isBefore(this.minDate) && side == 'left') {
-                    calendar[row][col] = this.minDate.clone();
-                }
-
-                if (this.maxDate && calendar[row][col].format('YYYY-MM-DD') == this.maxDate.format('YYYY-MM-DD') && calendar[row][col].isAfter(this.maxDate) && side == 'right') {
-                    calendar[row][col] = this.maxDate.clone();
-                }
-
-            }
-
-            //make the calendar object available to hoverDate/clickDate
-            if (side == 'left') {
-                this.leftCalendar.calendar = calendar;
-            } else {
-                this.rightCalendar.calendar = calendar;
-            }
-
-            //
-            // Display the calendar
-            //
-
-            var minDate = side == 'left' ? this.minDate : this.startDate;
-            var maxDate = this.maxDate;
-            var selected = side == 'left' ? this.startDate : this.endDate;
-            var arrow = this.locale.direction == 'ltr' ? {left: 'chevron-left', right: 'chevron-right'} : {left: 'chevron-right', right: 'chevron-left'};
-
-            var html = '<table class="table-condensed">';
-            html += '<thead>';
-            html += '<tr>';
-
-            // add empty cell for week number
-            if (this.showWeekNumbers || this.showISOWeekNumbers)
-                html += '<th></th>';
-
-            if ((!minDate || minDate.isBefore(calendar.firstDay)) && (!this.linkedCalendars || side == 'left')) {
-                html += '<th class="prev available"><i class="fa fa-' + arrow.left + ' glyphicon glyphicon-' + arrow.left + '"></i></th>';
-            } else {
-                html += '<th></th>';
-            }
-
-            var dateHtml = this.locale.monthNames[calendar[1][1].month()] + " " + calendar[1][1].year();
-
-            if (this.showDropdowns) {
-                var currentMonth = calendar[1][1].month();
-                var currentYear = calendar[1][1].year();
-                var maxYear = (maxDate && maxDate.year()) || (currentYear + 5);
-                var minYear = (minDate && minDate.year()) || (currentYear - 50);
-                var inMinYear = currentYear == minYear;
-                var inMaxYear = currentYear == maxYear;
-
-                var monthHtml = '<select class="monthselect">';
-                for (var m = 0; m < 12; m++) {
-                    if ((!inMinYear || m >= minDate.month()) && (!inMaxYear || m <= maxDate.month())) {
-                        monthHtml += "<option value='" + m + "'" +
-                            (m === currentMonth ? " selected='selected'" : "") +
-                            ">" + this.locale.monthNames[m] + "</option>";
-                    } else {
-                        monthHtml += "<option value='" + m + "'" +
-                            (m === currentMonth ? " selected='selected'" : "") +
-                            " disabled='disabled'>" + this.locale.monthNames[m] + "</option>";
-                    }
-                }
-                monthHtml += "</select>";
-
-                var yearHtml = '<select class="yearselect">';
-                for (var y = minYear; y <= maxYear; y++) {
-                    yearHtml += '<option value="' + y + '"' +
-                        (y === currentYear ? ' selected="selected"' : '') +
-                        '>' + y + '</option>';
-                }
-                yearHtml += '</select>';
-
-                dateHtml = monthHtml + yearHtml;
-            }
-
-            html += '<th colspan="5" class="month">' + dateHtml + '</th>';
-            if ((!maxDate || maxDate.isAfter(calendar.lastDay)) && (!this.linkedCalendars || side == 'right' || this.singleDatePicker)) {
-                html += '<th class="next available"><i class="fa fa-' + arrow.right + ' glyphicon glyphicon-' + arrow.right + '"></i></th>';
-            } else {
-                html += '<th></th>';
-            }
-
-            html += '</tr>';
-            html += '<tr>';
-
-            // add week number label
-            if (this.showWeekNumbers || this.showISOWeekNumbers)
-                html += '<th class="week">' + this.locale.weekLabel + '</th>';
-
-            $.each(this.locale.daysOfWeek, function(index, dayOfWeek) {
-                html += '<th>' + dayOfWeek + '</th>';
-            });
-
-            html += '</tr>';
-            html += '</thead>';
-            html += '<tbody>';
-
-            //adjust maxDate to reflect the dateLimit setting in order to
-            //grey out end dates beyond the dateLimit
-            if (this.endDate == null && this.dateLimit) {
-                var maxLimit = this.startDate.clone().add(this.dateLimit).endOf('day');
-                if (!maxDate || maxLimit.isBefore(maxDate)) {
-                    maxDate = maxLimit;
-                }
-            }
-
-            for (var row = 0; row < 6; row++) {
-                if (calendar[row].length == 0)
-                    continue
-
-                html += '<tr>';
-
-                // add week number
-                if (this.showWeekNumbers)
-                    html += '<td class="week">' + calendar[row][0].week() + '</td>';
-                else if (this.showISOWeekNumbers)
-                    html += '<td class="week">' + calendar[row][0].isoWeek() + '</td>';
-
-                for (var col = 0; col < 7; col++) {
-
-                    var classes = [];
-
-                    //highlight today's date
-                    if (calendar[row][col].isSame(new Date(), "day"))
-                        classes.push('today');
-
-                    //highlight weekends
-                    if (calendar[row][col].isoWeekday() > 5)
-                        classes.push('weekend');
-
-                    //grey out the dates in other months displayed at beginning and end of this calendar
-                    if (calendar[row][col].month() != calendar[1][1].month())
-                        classes.push('off');
-
-                    //don't allow selection of dates before the minimum date
-                    if (this.minDate && calendar[row][col].isBefore(this.minDate, 'day'))
-                        classes.push('off', 'disabled');
-
-                    //don't allow selection of dates after the maximum date
-                    if (maxDate && calendar[row][col].isAfter(maxDate, 'day'))
-                        classes.push('off', 'disabled');
-
-                    //don't allow selection of date if a custom function decides it's invalid
-                    if (this.isInvalidDate(calendar[row][col]))
-                        classes.push('off', 'disabled');
-
-                    //highlight the currently selected start date
-                    if (calendar[row][col].format('YYYY-MM-DD') == this.startDate.format('YYYY-MM-DD'))
-                        classes.push('active', 'start-date');
-
-                    //highlight the currently selected end date
-                    if (this.endDate != null && calendar[row][col].format('YYYY-MM-DD') == this.endDate.format('YYYY-MM-DD'))
-                        classes.push('active', 'end-date');
-
-                    //highlight dates in-between the selected dates
-                    if (this.endDate != null && calendar[row][col] > this.startDate && calendar[row][col] < this.endDate)
-                        classes.push('in-range');
-
-                    //apply custom classes for this date
-                    var isCustom = this.isCustomDate(calendar[row][col]);
-                    if (isCustom !== false) {
-                        if (typeof isCustom === 'string')
-                            classes.push(isCustom);
-                        else
-                            Array.prototype.push.apply(classes, isCustom);
-                    }
-
-                    var cname = '', disabled = false;
-                    for (var i = 0; i < classes.length; i++) {
-                        cname += classes[i] + ' ';
-                        if (classes[i] == 'disabled')
-                            disabled = true;
-                    }
-                    if (!disabled)
-                        cname += 'available';
-
-                    html += '<td class="' + cname.replace(/^\s+|\s+$/g, '') + '" data-title="' + 'r' + row + 'c' + col + '">' + calendar[row][col].date() + '</td>';
-
-                }
-                html += '</tr>';
-            }
-
-            html += '</tbody>';
-            html += '</table>';
-
-            this.container.find('.calendar.' + side + ' .calendar-table').html(html);
-
-        },
-
-        renderTimePicker: function(side) {
-
-            // Don't bother updating the time picker if it's currently disabled
-            // because an end date hasn't been clicked yet
-            if (side == 'right' && !this.endDate) return;
-
-            var html, selected, minDate, maxDate = this.maxDate;
-
-            if (this.dateLimit && (!this.maxDate || this.startDate.clone().add(this.dateLimit).isAfter(this.maxDate)))
-                maxDate = this.startDate.clone().add(this.dateLimit);
-
-            if (side == 'left') {
-                selected = this.startDate.clone();
-                minDate = this.minDate;
-            } else if (side == 'right') {
-                selected = this.endDate.clone();
-                minDate = this.startDate;
-
-                //Preserve the time already selected
-                var timeSelector = this.container.find('.calendar.right .calendar-time div');
-                if (!this.endDate && timeSelector.html() != '') {
-
-                    selected.hour(timeSelector.find('.hourselect option:selected').val() || selected.hour());
-                    selected.minute(timeSelector.find('.minuteselect option:selected').val() || selected.minute());
-                    selected.second(timeSelector.find('.secondselect option:selected').val() || selected.second());
-
-                    if (!this.timePicker24Hour) {
-                        var ampm = timeSelector.find('.ampmselect option:selected').val();
-                        if (ampm === 'PM' && selected.hour() < 12)
-                            selected.hour(selected.hour() + 12);
-                        if (ampm === 'AM' && selected.hour() === 12)
-                            selected.hour(0);
-                    }
-
-                }
-
-                if (selected.isBefore(this.startDate))
-                    selected = this.startDate.clone();
-
-                if (maxDate && selected.isAfter(maxDate))
-                    selected = maxDate.clone();
-
-            }
-
-            //
-            // hours
-            //
-
-            html = '<select class="hourselect">';
-
-            var start = this.timePicker24Hour ? 0 : 1;
-            var end = this.timePicker24Hour ? 23 : 12;
-
-            for (var i = start; i <= end; i++) {
-                var i_in_24 = i;
-                if (!this.timePicker24Hour)
-                    i_in_24 = selected.hour() >= 12 ? (i == 12 ? 12 : i + 12) : (i == 12 ? 0 : i);
-
-                var time = selected.clone().hour(i_in_24);
-                var disabled = false;
-                if (minDate && time.minute(59).isBefore(minDate))
-                    disabled = true;
-                if (maxDate && time.minute(0).isAfter(maxDate))
-                    disabled = true;
-
-                if (i_in_24 == selected.hour() && !disabled) {
-                    html += '<option value="' + i + '" selected="selected">' + i + '</option>';
-                } else if (disabled) {
-                    html += '<option value="' + i + '" disabled="disabled" class="disabled">' + i + '</option>';
-                } else {
-                    html += '<option value="' + i + '">' + i + '</option>';
-                }
-            }
-
-            html += '</select> ';
-
-            //
-            // minutes
-            //
-
-            html += ': <select class="minuteselect">';
-
-            for (var i = 0; i < 60; i += this.timePickerIncrement) {
-                var padded = i < 10 ? '0' + i : i;
-                var time = selected.clone().minute(i);
-
-                var disabled = false;
-                if (minDate && time.second(59).isBefore(minDate))
-                    disabled = true;
-                if (maxDate && time.second(0).isAfter(maxDate))
-                    disabled = true;
-
-                if (selected.minute() == i && !disabled) {
-                    html += '<option value="' + i + '" selected="selected">' + padded + '</option>';
-                } else if (disabled) {
-                    html += '<option value="' + i + '" disabled="disabled" class="disabled">' + padded + '</option>';
-                } else {
-                    html += '<option value="' + i + '">' + padded + '</option>';
-                }
-            }
-
-            html += '</select> ';
-
-            //
-            // seconds
-            //
-
-            if (this.timePickerSeconds) {
-                html += ': <select class="secondselect">';
-
-                for (var i = 0; i < 60; i++) {
-                    var padded = i < 10 ? '0' + i : i;
-                    var time = selected.clone().second(i);
-
-                    var disabled = false;
-                    if (minDate && time.isBefore(minDate))
-                        disabled = true;
-                    if (maxDate && time.isAfter(maxDate))
-                        disabled = true;
-
-                    if (selected.second() == i && !disabled) {
-                        html += '<option value="' + i + '" selected="selected">' + padded + '</option>';
-                    } else if (disabled) {
-                        html += '<option value="' + i + '" disabled="disabled" class="disabled">' + padded + '</option>';
-                    } else {
-                        html += '<option value="' + i + '">' + padded + '</option>';
-                    }
-                }
-
-                html += '</select> ';
-            }
-
-            //
-            // AM/PM
-            //
-
-            if (!this.timePicker24Hour) {
-                html += '<select class="ampmselect">';
-
-                var am_html = '';
-                var pm_html = '';
-
-                if (minDate && selected.clone().hour(12).minute(0).second(0).isBefore(minDate))
-                    am_html = ' disabled="disabled" class="disabled"';
-
-                if (maxDate && selected.clone().hour(0).minute(0).second(0).isAfter(maxDate))
-                    pm_html = ' disabled="disabled" class="disabled"';
-
-                if (selected.hour() >= 12) {
-                    html += '<option value="AM"' + am_html + '>AM</option><option value="PM" selected="selected"' + pm_html + '>PM</option>';
-                } else {
-                    html += '<option value="AM" selected="selected"' + am_html + '>AM</option><option value="PM"' + pm_html + '>PM</option>';
-                }
-
-                html += '</select>';
-            }
-
-            this.container.find('.calendar.' + side + ' .calendar-time div').html(html);
-
-        },
-
-        updateFormInputs: function() {
-
-            //ignore mouse movements while an above-calendar text input has focus
-            if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus"))
-                return;
-
-            this.container.find('input[name=daterangepicker_start]').val(this.startDate.format(this.locale.format));
-            if (this.endDate)
-                this.container.find('input[name=daterangepicker_end]').val(this.endDate.format(this.locale.format));
-
-            if (this.singleDatePicker || (this.endDate && (this.startDate.isBefore(this.endDate) || this.startDate.isSame(this.endDate)))) {
-                this.container.find('button.applyBtn').removeAttr('disabled');
-            } else {
-                this.container.find('button.applyBtn').attr('disabled', 'disabled');
-            }
-
-        },
-
-        move: function() {
-            var parentOffset = { top: 0, left: 0 },
-                containerTop;
-            var parentRightEdge = $(window).width();
-            if (!this.parentEl.is('body')) {
-                parentOffset = {
-                    top: this.parentEl.offset().top - this.parentEl.scrollTop(),
-                    left: this.parentEl.offset().left - this.parentEl.scrollLeft()
-                };
-                parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left;
-            }
-
-            if (this.drops == 'up')
-                containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;
-            else
-                containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;
-            this.container[this.drops == 'up' ? 'addClass' : 'removeClass']('dropup');
-
-            if (this.opens == 'left') {
-                this.container.css({
-                    top: containerTop,
-                    right: parentRightEdge - this.element.offset().left - this.element.outerWidth(),
-                    left: 'auto'
-                });
-                if (this.container.offset().left < 0) {
-                    this.container.css({
-                        right: 'auto',
-                        left: 9
-                    });
-                }
-            } else if (this.opens == 'center') {
-                this.container.css({
-                    top: containerTop,
-                    left: this.element.offset().left - parentOffset.left + this.element.outerWidth() / 2
-                            - this.container.outerWidth() / 2,
-                    right: 'auto'
-                });
-                if (this.container.offset().left < 0) {
-                    this.container.css({
-                        right: 'auto',
-                        left: 9
-                    });
-                }
-            } else {
-                this.container.css({
-                    top: containerTop,
-                    left: this.element.offset().left - parentOffset.left,
-                    right: 'auto'
-                });
-                if (this.container.offset().left + this.container.outerWidth() > $(window).width()) {
-                    this.container.css({
-                        left: 'auto',
-                        right: 0
-                    });
-                }
-            }
-        },
-
-        show: function(e) {
-            if (this.isShowing) return;
-
-            // Create a click proxy that is private to this instance of datepicker, for unbinding
-            this._outsideClickProxy = $.proxy(function(e) { this.outsideClick(e); }, this);
-
-            // Bind global datepicker mousedown for hiding and
-            $(document)
-              .on('mousedown.daterangepicker', this._outsideClickProxy)
-              // also support mobile devices
-              .on('touchend.daterangepicker', this._outsideClickProxy)
-              // also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them
-              .on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy)
-              // and also close when focus changes to outside the picker (eg. tabbing between controls)
-              .on('focusin.daterangepicker', this._outsideClickProxy);
-
-            // Reposition the picker if the window is resized while it's open
-            $(window).on('resize.daterangepicker', $.proxy(function(e) { this.move(e); }, this));
-
-            this.oldStartDate = this.startDate.clone();
-            this.oldEndDate = this.endDate.clone();
-            this.previousRightTime = this.endDate.clone();
-
-            this.updateView();
-            this.container.show();
-            this.move();
-            this.element.trigger('show.daterangepicker', this);
-            this.isShowing = true;
-        },
-
-        hide: function(e) {
-            if (!this.isShowing) return;
-
-            //incomplete date selection, revert to last values
-            if (!this.endDate) {
-                this.startDate = this.oldStartDate.clone();
-                this.endDate = this.oldEndDate.clone();
-            }
-
-            //if a new date range was selected, invoke the user callback function
-            if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate))
-                this.callback(this.startDate, this.endDate, this.chosenLabel);
-
-            //if picker is attached to a text input, update it
-            this.updateElement();
-
-            $(document).off('.daterangepicker');
-            $(window).off('.daterangepicker');
-            this.container.hide();
-            this.element.trigger('hide.daterangepicker', this);
-            this.isShowing = false;
-        },
-
-        toggle: function(e) {
-            if (this.isShowing) {
-                this.hide();
-            } else {
-                this.show();
-            }
-        },
-
-        outsideClick: function(e) {
-            var target = $(e.target);
-            // if the page is clicked anywhere except within the daterangerpicker/button
-            // itself then call this.hide()
-            if (
-                // ie modal dialog fix
-                e.type == "focusin" ||
-                target.closest(this.element).length ||
-                target.closest(this.container).length ||
-                target.closest('.calendar-table').length
-                ) return;
-            this.hide();
-            this.element.trigger('outsideClick.daterangepicker', this);
-        },
-
-        showCalendars: function() {
-            this.container.addClass('show-calendar');
-            this.move();
-            this.element.trigger('showCalendar.daterangepicker', this);
-        },
-
-        hideCalendars: function() {
-            this.container.removeClass('show-calendar');
-            this.element.trigger('hideCalendar.daterangepicker', this);
-        },
-
-        hoverRange: function(e) {
-            //ignore mouse movements while an above-calendar text input has focus
-            if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus"))
-                return;
-
-            var label = e.target.getAttribute('data-range-key');
-
-            if (label == this.locale.customRangeLabel) {
-                this.updateView();
-            } else {
-                var Utils = require('utils/Utils');
-                var dates = Utils.dateUtil.getRelativeDateFromString(label);
-                this.container.find('input[name=daterangepicker_start]').val(dates[0].format(this.locale.format));
-                this.container.find('input[name=daterangepicker_end]').val(dates[1].format(this.locale.format));
-            }
-
-        },
-
-        clickRange: function(e) {
-            var label = e.target.getAttribute('data-range-key');
-            this.chosenLabel = label;
-            if (label == this.locale.customRangeLabel) {
-                this.showCalendars();
-            } else {
-                var Utils = require('utils/Utils');
-                var dates = Utils.dateUtil.getRelativeDateFromString(label);
-                this.startDate = dates[0];
-                this.endDate = dates[1];
-
-                if (!this.timePicker) {
-                    this.startDate.startOf('day');
-                    this.endDate.endOf('day');
-                }
-
-                if (!this.alwaysShowCalendars)
-                    this.hideCalendars();
-                this.clickApply();
-            }
-        },
-
-        clickPrev: function(e) {
-            var cal = $(e.target).parents('.calendar');
-            if (cal.hasClass('left')) {
-                this.leftCalendar.month.subtract(1, 'month');
-                if (this.linkedCalendars)
-                    this.rightCalendar.month.subtract(1, 'month');
-            } else {
-                this.rightCalendar.month.subtract(1, 'month');
-            }
-            this.updateCalendars();
-        },
-
-        clickNext: function(e) {
-            var cal = $(e.target).parents('.calendar');
-            if (cal.hasClass('left')) {
-                this.leftCalendar.month.add(1, 'month');
-            } else {
-                this.rightCalendar.month.add(1, 'month');
-                if (this.linkedCalendars)
-                    this.leftCalendar.month.add(1, 'month');
-            }
-            this.updateCalendars();
-        },
-
-        hoverDate: function(e) {
-
-            //ignore mouse movements while an above-calendar text input has focus
-            //if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus"))
-            //    return;
-
-            //ignore dates that can't be selected
-            if (!$(e.target).hasClass('available')) return;
-
-            //have the text inputs above calendars reflect the date being hovered over
-            var title = $(e.target).attr('data-title');
-            var row = title.substr(1, 1);
-            var col = title.substr(3, 1);
-            var cal = $(e.target).parents('.calendar');
-            var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col];
-
-            if (this.endDate && !this.container.find('input[name=daterangepicker_start]').is(":focus")) {
-                this.container.find('input[name=daterangepicker_start]').val(date.format(this.locale.format));
-            } else if (!this.endDate && !this.container.find('input[name=daterangepicker_end]').is(":focus")) {
-                this.container.find('input[name=daterangepicker_end]').val(date.format(this.locale.format));
-            }
-
-            //highlight the dates between the start date and the date being hovered as a potential end date
-            var leftCalendar = this.leftCalendar;
-            var rightCalendar = this.rightCalendar;
-            var startDate = this.startDate;
-            if (!this.endDate) {
-                this.container.find('.calendar td').each(function(index, el) {
-
-                    //skip week numbers, only look at dates
-                    if ($(el).hasClass('week')) return;
-
-                    var title = $(el).attr('data-title');
-                    var row = title.substr(1, 1);
-                    var col = title.substr(3, 1);
-                    var cal = $(el).parents('.calendar');
-                    var dt = cal.hasClass('left') ? leftCalendar.calendar[row][col] : rightCalendar.calendar[row][col];
-
-                    if ((dt.isAfter(startDate) && dt.isBefore(date)) || dt.isSame(date, 'day')) {
-                        $(el).addClass('in-range');
-                    } else {
-                        $(el).removeClass('in-range');
-                    }
-
-                });
-            }
-
-        },
-
-        clickDate: function(e) {
-
-            if (!$(e.target).hasClass('available')) return;
-
-            var title = $(e.target).attr('data-title');
-            var row = title.substr(1, 1);
-            var col = title.substr(3, 1);
-            var cal = $(e.target).parents('.calendar');
-            var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col];
-
-            //
-            // this function needs to do a few things:
-            // * alternate between selecting a start and end date for the range,
-            // * if the time picker is enabled, apply the hour/minute/second from the select boxes to the clicked date
-            // * if autoapply is enabled, and an end date was chosen, apply the selection
-            // * if single date picker mode, and time picker isn't enabled, apply the selection immediately
-            // * if one of the inputs above the calendars was focused, cancel that manual input
-            //
-
-            if (this.endDate || date.isBefore(this.startDate, 'day')) { //picking start
-                if (this.timePicker) {
-                    var hour = parseInt(this.container.find('.left .hourselect').val(), 10);
-                    if (!this.timePicker24Hour) {
-                        var ampm = this.container.find('.left .ampmselect').val();
-                        if (ampm === 'PM' && hour < 12)
-                            hour += 12;
-                        if (ampm === 'AM' && hour === 12)
-                            hour = 0;
-                    }
-                    var minute = parseInt(this.container.find('.left .minuteselect').val(), 10);
-                    var second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0;
-                    date = date.clone().hour(hour).minute(minute).second(second);
-                }
-                this.endDate = null;
-                this.setStartDate(date.clone());
-            } else if (!this.endDate && date.isBefore(this.startDate)) {
-                //special case: clicking the same date for start/end,
-                //but the time of the end date is before the start date
-                this.setEndDate(this.startDate.clone());
-            } else { // picking end
-                if (this.timePicker) {
-                    var hour = parseInt(this.container.find('.right .hourselect').val(), 10);
-                    if (!this.timePicker24Hour) {
-                        var ampm = this.container.find('.right .ampmselect').val();
-                        if (ampm === 'PM' && hour < 12)
-                            hour += 12;
-                        if (ampm === 'AM' && hour === 12)
-                            hour = 0;
-                    }
-                    var minute = parseInt(this.container.find('.right .minuteselect').val(), 10);
-                    var second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0;
-                    date = date.clone().hour(hour).minute(minute).second(second);
-                }
-                this.setEndDate(date.clone());
-                if (this.autoApply) {
-                  this.showCalendars();
-                  this.clickApply();
-                }
-            }
-
-            if (this.singleDatePicker) {
-                this.setEndDate(this.startDate);
-                if (!this.timePicker)
-                    this.clickApply();
-            }
-
-            this.updateView();
-
-            //This is to cancel the blur event handler if the mouse was in one of the inputs
-            e.stopPropagation();
-
-        },
-
-        clickApply: function(e) {
-            this.hide();
-            this.element.trigger('apply.daterangepicker', this);
-        },
-
-        clickCancel: function(e) {
-            this.startDate = this.oldStartDate;
-            this.endDate = this.oldEndDate;
-            this.hide();
-            this.element.trigger('cancel.daterangepicker', this);
-        },
-
-        monthOrYearChanged: function(e) {
-            var isLeft = $(e.target).closest('.calendar').hasClass('left'),
-                leftOrRight = isLeft ? 'left' : 'right',
-                cal = this.container.find('.calendar.'+leftOrRight);
-
-            // Month must be Number for new moment versions
-            var month = parseInt(cal.find('.monthselect').val(), 10);
-            var year = cal.find('.yearselect').val();
-
-            if (!isLeft) {
-                if (year < this.startDate.year() || (year == this.startDate.year() && month < this.startDate.month())) {
-                    month = this.startDate.month();
-                    year = this.startDate.year();
-                }
-            }
-
-            if (this.minDate) {
-                if (year < this.minDate.year() || (year == this.minDate.year() && month < this.minDate.month())) {
-                    month = this.minDate.month();
-                    year = this.minDate.year();
-                }
-            }
-
-            if (this.maxDate) {
-                if (year > this.maxDate.year() || (year == this.maxDate.year() && month > this.maxDate.month())) {
-                    month = this.maxDate.month();
-                    year = this.maxDate.year();
-                }
-            }
-
-            if (isLeft) {
-                this.leftCalendar.month.month(month).year(year);
-                if (this.linkedCalendars)
-                    this.rightCalendar.month = this.leftCalendar.month.clone().add(1, 'month');
-            } else {
-                this.rightCalendar.month.month(month).year(year);
-                if (this.linkedCalendars)
-                    this.leftCalendar.month = this.rightCalendar.month.clone().subtract(1, 'month');
-            }
-            this.updateCalendars();
-        },
-
-        timeChanged: function(e) {
-
-            var cal = $(e.target).closest('.calendar'),
-                isLeft = cal.hasClass('left');
-
-            var hour = parseInt(cal.find('.hourselect').val(), 10);
-            var minute = parseInt(cal.find('.minuteselect').val(), 10);
-            var second = this.timePickerSeconds ? parseInt(cal.find('.secondselect').val(), 10) : 0;
-
-            if (!this.timePicker24Hour) {
-                var ampm = cal.find('.ampmselect').val();
-                if (ampm === 'PM' && hour < 12)
-                    hour += 12;
-                if (ampm === 'AM' && hour === 12)
-                    hour = 0;
-            }
-
-            if (isLeft) {
-                var start = this.startDate.clone();
-                start.hour(hour);
-                start.minute(minute);
-                start.second(second);
-                this.setStartDate(start);
-                if (this.singleDatePicker) {
-                    this.endDate = this.startDate.clone();
-                } else if (this.endDate && this.endDate.format('YYYY-MM-DD') == start.format('YYYY-MM-DD') && this.endDate.isBefore(start)) {
-                    this.setEndDate(start.clone());
-                }
-            } else if (this.endDate) {
-                var end = this.endDate.clone();
-                end.hour(hour);
-                end.minute(minute);
-                end.second(second);
-                this.setEndDate(end);
-            }
-
-            //update the calendars so all clickable dates reflect the new time component
-            this.updateCalendars();
-
-            //update the form inputs above the calendars with the new time
-            this.updateFormInputs();
-
-            //re-render the time pickers because changing one selection can affect what's enabled in another
-            this.renderTimePicker('left');
-            this.renderTimePicker('right');
-
-        },
-
-        formInputsChanged: function(e) {
-            var isRight = $(e.target).closest('.calendar').hasClass('right');
-            var start = moment(this.container.find('input[name="daterangepicker_start"]').val(), this.locale.format);
-            var end = moment(this.container.find('input[name="daterangepicker_end"]').val(), this.locale.format);
-
-            if (start.isValid() && end.isValid()) {
-
-                if (isRight && end.isBefore(start))
-                    start = end.clone();
-
-                this.setStartDate(start);
-                this.setEndDate(end);
-
-                if (isRight) {
-                    this.container.find('input[name="daterangepicker_start"]').val(this.startDate.format(this.locale.format));
-                } else {
-                    this.container.find('input[name="daterangepicker_end"]').val(this.endDate.format(this.locale.format));
-                }
-
-            }
-
-            this.updateView();
-        },
-
-        formInputsFocused: function(e) {
-
-            // Highlight the focused input
-            this.container.find('input[name="daterangepicker_start"], input[name="daterangepicker_end"]').removeClass('active');
-            $(e.target).addClass('active');
-
-            // Set the state such that if the user goes back to using a mouse, 
-            // the calendars are aware we're selecting the end of the range, not
-            // the start. This allows someone to edit the end of a date range without
-            // re-selecting the beginning, by clicking on the end date input then
-            // using the calendar.
-            var isRight = $(e.target).closest('.calendar').hasClass('right');
-            if (isRight) {
-                this.endDate = null;
-                this.setStartDate(this.startDate.clone());
-                this.updateView();
-            }
-
-        },
-
-        formInputsBlurred: function(e) {
-
-            // this function has one purpose right now: if you tab from the first
-            // text input to the second in the UI, the endDate is nulled so that
-            // you can click another, but if you tab out without clicking anything
-            // or changing the input value, the old endDate should be retained
-
-            if (!this.endDate) {
-                var val = this.container.find('input[name="daterangepicker_end"]').val();
-                var end = moment(val, this.locale.format);
-                if (end.isValid()) {
-                    this.setEndDate(end);
-                    this.updateView();
-                }
-            }
-
-        },
-
-        elementChanged: function() {
-            if (!this.element.is('input')) return;
-            if (!this.element.val().length) return;
-            if (this.element.val().length < this.locale.format.length) return;
-
-            var dateString = this.element.val().split(this.locale.separator),
-                start = null,
-                end = null;
-
-            if (dateString.length === 2) {
-                start = moment(dateString[0], this.locale.format);
-                end = moment(dateString[1], this.locale.format);
-            }
-
-            if (this.singleDatePicker || start === null || end === null) {
-                start = moment(this.element.val(), this.locale.format);
-                end = start;
-            }
-
-            if (!start.isValid() || !end.isValid()) return;
-
-            this.setStartDate(start);
-            this.setEndDate(end);
-            this.updateView();
-        },
-
-        keydown: function(e) {
-            //hide on tab or enter
-            if ((e.keyCode === 9) || (e.keyCode === 13)) {
-                this.hide();
-            }
-        },
-
-        updateElement: function() {
-            if (this.element.is('input') && !this.singleDatePicker && this.autoUpdateInput) {
-                this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
-                this.element.trigger('change');
-            } else if (this.element.is('input') && this.autoUpdateInput) {
-                this.element.val(this.startDate.format(this.locale.format));
-                this.element.trigger('change');
-            }
-        },
-
-        remove: function() {
-            this.container.remove();
-            this.element.off('.daterangepicker');
-            this.element.removeData();
-        }
-
-    };
-
-    $.fn.daterangepicker = function(options, callback) {
-        this.each(function() {
-            var el = $(this);
-            if (el.data('daterangepicker'))
-                el.data('daterangepicker').remove();
-            el.data('daterangepicker', new DateRangePicker(el, options, callback));
-        });
-        return this;
-    };
-
-    return DateRangePicker;
-
-}));


[33/51] [abbrv] ambari git commit: AMBARI-19878 Log Search Portal time zone selection bug (mgergely)

Posted by rz...@apache.org.
AMBARI-19878 Log Search Portal time zone selection bug (mgergely)

Change-Id: I3e1ca2689f1a2ec2a7dfd58ec958bb468b15c236
(cherry picked from commit 776e0dfb19a81998ab5ce05efb611082a002e94b)


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: e3b9ef3c19dae4992b0f9fd539eb02589280394f
Parents: 53e6c8d
Author: Miklos Gergely <mg...@hortonworks.com>
Authored: Tue Feb 7 10:12:23 2017 +0100
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 05:18:55 2017 -0800

----------------------------------------------------------------------
 .../src/main/webapp/index.html                  |  211 +-
 .../daterangepicker/css/daterangepicker.css     |  415 +++
 .../daterangepicker/js/daterangepicker.js       | 1560 ++++++++
 .../libs/custom/timezone/WorldMapGenerator.js   | 3474 ++++++++++++++++++
 .../libs/custom/timezone/jstz-1.0.4.min.js      |    2 +
 .../daterangepicker/css/daterangepicker.css     |  415 ---
 .../other/daterangepicker/js/daterangepicker.js | 1560 --------
 .../libs/other/timezone/WorldMapGenerator.js    | 3471 -----------------
 .../libs/other/timezone/jstz-1.0.4.min.js       |    2 -
 .../webapp/libs/other/timezone/mapdata.json     | 3158 ----------------
 .../src/main/webapp/scripts/Init.js             |  439 ++-
 11 files changed, 5775 insertions(+), 8932 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e3b9ef3c/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/index.html b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/index.html
index 2d9ae01..b86e038 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/index.html
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/index.html
@@ -16,115 +16,114 @@
 -->
 <!DOCTYPE html>
 <html lang="en">
-	<head>
-		<meta charset="utf-8">
-		<title>LogSearch</title>
-		<meta name="viewport" content="width=device-width, initial-scale=1">
-		<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
-		
-		<link href="libs/bower/bootstrap/bootstrap.css" rel="stylesheet">
-		<link href="libs/other/font-awesome/css/font-awesome.css" rel="stylesheet">
-		<!-- <link href="libs/other/jquery-ui/css/jquery-ui-1.11.4.min.css" rel="stylesheet"> -->
-		<link rel="stylesheet" type="text/css" href="libs/other/jquery-ui/css/jquery-ui-bootstrap.css">
-		<link rel="stylesheet" type="text/css" href="styles/custom/visualsearch.css">
-		<link rel="stylesheet" type="text/css" href="libs/bower/backgrid/css/backgrid.css">
-		<link rel="stylesheet" type="text/css" href="libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.css">
-		<link rel="stylesheet" type="text/css" href="libs/bower/backgrid-paginator/css/backgrid-paginator.css">
-		<link rel="stylesheet" type="text/css" href="libs/bower/backgrid-sizeable/css/backgrid-sizeable-columns.css">
-		<link rel="stylesheet" type="text/css" href="libs/bower/backgrid-sizeable/backgrid-orderable-columns.css">
-		<link rel="stylesheet" type="text/css" href="libs/other/daterangepicker/css/daterangepicker.css">
-		<link rel="stylesheet" type="text/css" href="styles/animate.css">
-		<link rel="stylesheet" type="text/css" href="libs/bower/select2/select2.css">
-		<link rel="stylesheet" type="text/css" href="libs/other/nvd3/css/nv.d3.min.css">
-		<link rel="stylesheet" type="text/css" href="libs/other/gridster/css/jquery.gridster.css">
-		<link rel="stylesheet" type="text/css" href="libs/other/bootstrap-tour-0.10.3/css/bootstrap-tour.min.css">
-		<link href="styles/style_v2.css" rel="stylesheet">
-		<link href="styles/style.css" rel="stylesheet">
-		
-		
-		<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
-		<!--[if lt IE 9]>
-				<script src="http://getbootstrap.com/docs-assets/js/html5shiv.js"></script>
-				<script src="http://getbootstrap.com/docs-assets/js/respond.min.js"></script>
-		<![endif]-->
-	</head>
-<body>
-<!--Start Header-->
-<!-- <div id="screensaver">
-	<canvas id="canvas"></canvas>
-	<i class="fa fa-lock" id="screen_unlock"></i>
-</div> -->
+    <head>
+        <meta charset="utf-8">
+        <title>LogSearch</title>
+        <meta name="viewport" content="width=device-width, initial-scale=1">
+        <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
+        
+        <link href="libs/bower/bootstrap/bootstrap.css" rel="stylesheet">
+        <link href="libs/other/font-awesome/css/font-awesome.css" rel="stylesheet">
+        <!-- <link href="libs/other/jquery-ui/css/jquery-ui-1.11.4.min.css" rel="stylesheet"> -->
+        <link rel="stylesheet" type="text/css" href="libs/other/jquery-ui/css/jquery-ui-bootstrap.css">
+        <link rel="stylesheet" type="text/css" href="styles/custom/visualsearch.css">
+        <link rel="stylesheet" type="text/css" href="libs/bower/backgrid/css/backgrid.css">
+        <link rel="stylesheet" type="text/css" href="libs/bower/backgrid-columnmanager/Backgrid.ColumnManager.css">
+        <link rel="stylesheet" type="text/css" href="libs/bower/backgrid-paginator/css/backgrid-paginator.css">
+        <link rel="stylesheet" type="text/css" href="libs/bower/backgrid-sizeable/css/backgrid-sizeable-columns.css">
+        <link rel="stylesheet" type="text/css" href="libs/bower/backgrid-sizeable/backgrid-orderable-columns.css">
+        <link rel="stylesheet" type="text/css" href="libs/custom/daterangepicker/css/daterangepicker.css">
+        <link rel="stylesheet" type="text/css" href="styles/animate.css">
+        <link rel="stylesheet" type="text/css" href="libs/bower/select2/select2.css">
+        <link rel="stylesheet" type="text/css" href="libs/other/nvd3/css/nv.d3.min.css">
+        <link rel="stylesheet" type="text/css" href="libs/other/gridster/css/jquery.gridster.css">
+        <link rel="stylesheet" type="text/css" href="libs/other/bootstrap-tour-0.10.3/css/bootstrap-tour.min.css">
+        <link href="styles/style_v2.css" rel="stylesheet">
+        <link href="styles/style.css" rel="stylesheet">
+        
+        
+        <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
+        <!--[if lt IE 9]>
+                <script src="http://getbootstrap.com/docs-assets/js/html5shiv.js"></script>
+                <script src="http://getbootstrap.com/docs-assets/js/respond.min.js"></script>
+        <![endif]-->
+    </head>
+    <body>
+        <!--Start Header-->
+        <!-- <div id="screensaver">
+            <canvas id="canvas"></canvas>
+            <i class="fa fa-lock" id="screen_unlock"></i>
+        </div> -->
 
-<header class="navbar">
-	<div class="container-fluid expanded-panel">
-		<div class="row top-panel-right">
-			<div id="logo" class="col-xs-12 col-sm-3">
-        <div class="row">
-          <div class="col-sm-2"><img title="Apache Ambari" alt="Apache Ambari" src="images/logo-white.png" height="32px"></div>
-          <div class="col-sm-10"><a href="javascript:void(0);">Log Search</a></div>
+        <header class="navbar">
+            <div class="container-fluid expanded-panel">
+                <div class="row top-panel-right">
+                    <div id="logo" class="col-xs-12 col-sm-3">
+                        <div class="row">
+                            <div class="col-sm-2"><img title="Apache Ambari" alt="Apache Ambari" src="images/logo-white.png" height="32px"></div>
+                            <div class="col-sm-10"><a href="javascript:void(0);">Log Search</a></div>
+                        </div>
+                    </div>
+                    <div id="r_header"></div>
+                </div>
+            </div>
+        </header>
+        <!--End Header-->
+        <!--Start Container-->
+        <div id="main" class="container-fluid">
+            <div class="row">
+                <!--div id="sidebar-left" class="col-xs-2 col-sm-2">
+                    <ul class="nav main-menu">
+                        <li>
+                            <a href="javascript:void(0);" class="ajax-link">
+                                <i class="fa fa-dashboard"></i>
+                                <span class="hidden-xs">Dashboard</span>
+                            </a>
+                        </li>
+                    </ul>
+                </div-->
+                <!--Start Content-->
+                <div id="content" class="col-xs-12 col-sm-12">
+                    <div id="r_content" >
+                        <i class="icon-spinner"></i>
+                    </div>
+                    <!-- <div class="preloader">
+                        <img src="img/devoops_getdata.gif" class="devoops-getdata" alt="preloader"/>
+                    </div> -->
+                </div>
+                <!--End Content-->
+            </div>
         </div>
-			</div>
-			<div id="r_header"></div>
-		</div>
-	</div>
-</header>
-<!--End Header-->
-<!--Start Container-->
-<div id="main" class="container-fluid">
-	<div class="row">
-		<!--div id="sidebar-left" class="col-xs-2 col-sm-2">
-			<ul class="nav main-menu">
-				<li>
-					<a href="javascript:void(0);" class="ajax-link">
-						<i class="fa fa-dashboard"></i>
-						<span class="hidden-xs">Dashboard</span>
-					</a>
-				</li>
-			</ul>
-		</div-->
-		<!--Start Content-->
-		<div id="content" class="col-xs-12 col-sm-12">
-			<div id="r_content" >
-        <i class="icon-spinner"></i>
-			</div>
-			<!-- <div class="preloader">
-				<img src="img/devoops_getdata.gif" class="devoops-getdata" alt="preloader"/>
-			</div> -->
-		</div>
-		<!--End Content-->
-	</div>
-</div>
-<!--End Container-->
-<!-- build:js scripts/main.js -->
-		<script data-main="scripts/Init.js?ver=build.version" src="libs/bower/requirejs/js/require.js"></script>
-		<!-- endbuild -->
-		<script type="text/javascript">
-			require.config({
-				waitSeconds : 0
-			});
-			if (!window.console) window.console = {};
+        <!--End Container-->
+        <!-- build:js scripts/main.js -->
+        <script data-main="scripts/Init.js?ver=build.version" src="libs/bower/requirejs/js/require.js"></script>
+        <!-- endbuild -->
+        <script type="text/javascript">
+            require.config({
+                waitSeconds : 0
+            });
+            if (!window.console) window.console = {};
             if (!window.console.log) window.console.log = function () { };
 
-		</script>
-<!-- 		<script type="text/javascript" src="libs/other/d3/d3.min.js"></script> -->
-<div class="btn-group contextMenuBody dropup" style="display:none;position:absolute;z-index:9999;">
-	    <button type="button" class="btn btn-info btn-circle btn-app-sm btn-context dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
-	        <i class="fa fa-info"></i>
-	    </button>
-	    <ul class="dropdown-menu">
-	        <li><a data-id="I" href="javascript:void(0);">Include</a></li>
-	        <li><a data-id="E" href="javascript:void(0);">Exclude</a></li> 
-	     	<li><a data-id="IA" href="javascript:void(0);">*Include*</a></li>
-	        <li><a data-id="EA" href="javascript:void(0);">*Exclude*</a></li>
-	        <li role="separator" class="divider"></li>
-	        <li><a data-id="F" href="javascript:void(0);">Find</a></li>
-	    </ul>
-	</div>
-	<div class="arrowDiv">
-		<div class="bottomToTop" title="Scroll To Top"><i class="fa fa-arrow-circle-up"></i></div>
-		<div class="topToBottom" title="Scroll To bottom"><i class="fa fa-arrow-circle-down"></i></div>
-	</div>
-	
+        </script>
+        <!-- <script type="text/javascript" src="libs/other/d3/d3.min.js"></script> -->
+        <div class="btn-group contextMenuBody dropup" style="display:none;position:absolute;z-index:9999;">
+            <button type="button" class="btn btn-info btn-circle btn-app-sm btn-context dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+                <i class="fa fa-info"></i>
+            </button>
+            <ul class="dropdown-menu">
+                <li><a data-id="I" href="javascript:void(0);">Include</a></li>
+                <li><a data-id="E" href="javascript:void(0);">Exclude</a></li> 
+                <li><a data-id="IA" href="javascript:void(0);">*Include*</a></li>
+                <li><a data-id="EA" href="javascript:void(0);">*Exclude*</a></li>
+                <li role="separator" class="divider"></li>
+                <li><a data-id="F" href="javascript:void(0);">Find</a></li>
+            </ul>
+        </div>
+        <div class="arrowDiv">
+            <div class="bottomToTop" title="Scroll To Top"><i class="fa fa-arrow-circle-up"></i></div>
+            <div class="topToBottom" title="Scroll To bottom"><i class="fa fa-arrow-circle-down"></i></div>
+        </div>
 
-</body>
+    </body>
 </html>

http://git-wip-us.apache.org/repos/asf/ambari/blob/e3b9ef3c/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/daterangepicker/css/daterangepicker.css
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/daterangepicker/css/daterangepicker.css b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/daterangepicker/css/daterangepicker.css
new file mode 100644
index 0000000..7f1ef54
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/daterangepicker/css/daterangepicker.css
@@ -0,0 +1,415 @@
+.daterangepicker {
+    position: absolute;
+    color: inherit;
+    background: #fff;
+    border-radius: 4px;
+    width: 278px;
+    padding: 4px;
+    margin-top: 1px;
+    top: 100px;
+    left: 20px;
+    /* Calendars */
+}
+
+.daterangepicker:before,
+.daterangepicker:after {
+    position: absolute;
+    display: inline-block;
+    border-bottom-color: rgba(0, 0, 0, 0.2);
+    content: '';
+}
+
+.daterangepicker:before {
+    top: -7px;
+    border-right: 7px solid transparent;
+    border-left: 7px solid transparent;
+    border-bottom: 7px solid #ccc;
+}
+
+.daterangepicker:after {
+    top: -6px;
+    border-right: 6px solid transparent;
+    border-bottom: 6px solid #fff;
+    border-left: 6px solid transparent;
+}
+
+.daterangepicker.opensleft:before {
+    right: 9px;
+}
+
+.daterangepicker.opensleft:after {
+    right: 10px;
+}
+
+.daterangepicker.openscenter:before {
+    left: 0;
+    right: 0;
+    width: 0;
+    margin-left: auto;
+    margin-right: auto;
+}
+
+.daterangepicker.openscenter:after {
+    left: 0;
+    right: 0;
+    width: 0;
+    margin-left: auto;
+    margin-right: auto;
+}
+
+.daterangepicker.opensright:before {
+    left: 9px;
+}
+
+.daterangepicker.opensright:after {
+    left: 10px;
+}
+
+.daterangepicker.dropup {
+    margin-top: -5px;
+}
+
+.daterangepicker.dropup:before {
+    top: initial;
+    bottom: -7px;
+    border-bottom: initial;
+    border-top: 7px solid #ccc;
+}
+
+.daterangepicker.dropup:after {
+    top: initial;
+    bottom: -6px;
+    border-bottom: initial;
+    border-top: 6px solid #fff;
+}
+
+.daterangepicker.dropdown-menu {
+    max-width: none;
+    z-index: 3001;
+}
+
+.daterangepicker.single .ranges,
+.daterangepicker.single .calendar {
+    float: none;
+}
+
+.daterangepicker.show-calendar .calendar {
+    display: block;
+}
+
+.daterangepicker .calendar {
+    display: none;
+    max-width: 270px;
+    margin: 4px;
+}
+
+.daterangepicker .calendar.single .calendar-table {
+    border: none;
+}
+
+.daterangepicker .calendar th,
+.daterangepicker .calendar td {
+    white-space: nowrap;
+    text-align: center;
+    min-width: 32px;
+}
+
+.daterangepicker .calendar-table {
+    border: 1px solid #fff;
+    padding: 4px;
+    border-radius: 4px;
+    background: #fff;
+}
+
+.daterangepicker table {
+    width: 100%;
+    margin: 0;
+}
+
+.daterangepicker td,
+.daterangepicker th {
+    text-align: center;
+    width: 20px;
+    height: 20px;
+    border-radius: 4px;
+    border: 1px solid transparent;
+    white-space: nowrap;
+    cursor: pointer;
+}
+
+.daterangepicker td.available:hover,
+.daterangepicker th.available:hover {
+    background-color: #eee;
+    border-color: transparent;
+    color: inherit;
+}
+
+.daterangepicker td.week,
+.daterangepicker th.week {
+    font-size: 80%;
+    color: #ccc;
+}
+
+.daterangepicker td.off,
+.daterangepicker td.off.in-range,
+.daterangepicker td.off.start-date,
+.daterangepicker td.off.end-date {
+    background-color: #fff;
+    border-color: transparent;
+    color: #999;
+}
+
+.daterangepicker td.in-range {
+    background-color: #ebf4f8;
+    border-color: transparent;
+    color: #000;
+    border-radius: 0;
+}
+
+.daterangepicker td.start-date {
+    border-radius: 4px 0 0 4px;
+}
+
+.daterangepicker td.end-date {
+    border-radius: 0 4px 4px 0;
+}
+
+.daterangepicker td.start-date.end-date {
+    border-radius: 4px;
+}
+
+.daterangepicker td.active,
+.daterangepicker td.active:hover {
+    background-color: #357ebd;
+    border-color: transparent;
+    color: #fff;
+}
+
+.daterangepicker th.month {
+    width: auto;
+}
+
+.daterangepicker td.disabled,
+.daterangepicker option.disabled {
+    color: #999;
+    cursor: not-allowed;
+    text-decoration: line-through;
+}
+
+.daterangepicker select.monthselect,
+.daterangepicker select.yearselect {
+    font-size: 12px;
+    padding: 1px;
+    height: auto;
+    margin: 0;
+    cursor: default;
+}
+
+.daterangepicker select.monthselect {
+    margin-right: 2%;
+    width: 56%;
+}
+
+.daterangepicker select.yearselect {
+    width: 40%;
+}
+
+.daterangepicker select.hourselect,
+.daterangepicker select.minuteselect,
+.daterangepicker select.secondselect,
+.daterangepicker select.ampmselect {
+    width: 50px;
+    margin-bottom: 0;
+}
+
+.daterangepicker .input-mini {
+    border: 1px solid #ccc;
+    border-radius: 4px;
+    color: #555;
+    height: 30px;
+    line-height: 30px;
+    display: block;
+    vertical-align: middle;
+    margin: 0 0 5px 0;
+    padding: 0 6px 0 28px;
+    width: 100%;
+}
+
+.daterangepicker .input-mini.active {
+    border: 1px solid #08c;
+    border-radius: 4px;
+}
+
+.daterangepicker .daterangepicker_input {
+    position: relative;
+}
+
+.daterangepicker .daterangepicker_input i {
+    position: absolute;
+    left: 8px;
+    top: 8px;
+}
+
+.daterangepicker.rtl .input-mini {
+    padding-right: 28px;
+    padding-left: 6px;
+}
+
+.daterangepicker.rtl .daterangepicker_input i {
+    left: auto;
+    right: 8px;
+}
+
+.daterangepicker .calendar-time {
+    text-align: center;
+    margin: 5px auto;
+    line-height: 30px;
+    position: relative;
+    padding-left: 28px;
+}
+
+.daterangepicker .calendar-time select.disabled {
+    color: #ccc;
+    cursor: not-allowed;
+}
+
+.ranges {
+    font-size: 11px;
+    float: none;
+    margin: 4px;
+    text-align: left;
+}
+
+.ranges ul {
+    list-style: none;
+    margin: 0 auto;
+    padding: 0;
+    width: 100%;
+}
+
+.ranges li {
+    font-size: 13px;
+    background: #f5f5f5;
+    border: 1px solid #f5f5f5;
+    border-radius: 4px;
+    color: #08c;
+    padding: 3px 12px;
+    margin-bottom: 8px;
+    cursor: pointer;
+}
+
+.ranges li:hover {
+    background: #08c;
+    border: 1px solid #08c;
+    color: #fff;
+}
+
+.ranges li.active {
+    background: #08c;
+    border: 1px solid #08c;
+    color: #fff;
+}
+
+
+/*  Larger Screen Styling */
+
+@media (min-width: 564px) {
+    .daterangepicker {
+        width: auto;
+    }
+    .daterangepicker .ranges ul {
+        width: 160px;
+    }
+    .daterangepicker.single .ranges ul {
+        width: 100%;
+    }
+    .daterangepicker.single .calendar.left {
+        clear: none;
+    }
+    .daterangepicker.single.ltr .ranges,
+    .daterangepicker.single.ltr .calendar {
+        float: left;
+    }
+    .daterangepicker.single.rtl .ranges,
+    .daterangepicker.single.rtl .calendar {
+        float: right;
+    }
+    .daterangepicker.ltr {
+        direction: ltr;
+        text-align: left;
+    }
+    .daterangepicker.ltr .calendar.left {
+        clear: left;
+        margin-right: 0;
+    }
+    .daterangepicker.ltr .calendar.left .calendar-table {
+        border-right: none;
+        border-top-right-radius: 0;
+        border-bottom-right-radius: 0;
+    }
+    .daterangepicker.ltr .calendar.right {
+        margin-left: 0;
+    }
+    .daterangepicker.ltr .calendar.right .calendar-table {
+        border-left: none;
+        border-top-left-radius: 0;
+        border-bottom-left-radius: 0;
+    }
+    .daterangepicker.ltr .left .daterangepicker_input {
+        padding-right: 12px;
+    }
+    .daterangepicker.ltr .calendar.left .calendar-table {
+        padding-right: 12px;
+    }
+    .daterangepicker.ltr .ranges,
+    .daterangepicker.ltr .calendar {
+        float: left;
+    }
+    .daterangepicker.rtl {
+        direction: rtl;
+        text-align: right;
+    }
+    .daterangepicker.rtl .calendar.left {
+        clear: right;
+        margin-left: 0;
+    }
+    .daterangepicker.rtl .calendar.left .calendar-table {
+        border-left: none;
+        border-top-left-radius: 0;
+        border-bottom-left-radius: 0;
+    }
+    .daterangepicker.rtl .calendar.right {
+        margin-right: 0;
+    }
+    .daterangepicker.rtl .calendar.right .calendar-table {
+        border-right: none;
+        border-top-right-radius: 0;
+        border-bottom-right-radius: 0;
+    }
+    .daterangepicker.rtl .left .daterangepicker_input {
+        padding-left: 12px;
+    }
+    .daterangepicker.rtl .calendar.left .calendar-table {
+        padding-left: 12px;
+    }
+    .daterangepicker.rtl .ranges,
+    .daterangepicker.rtl .calendar {
+        text-align: right;
+        float: right;
+    }
+}
+
+@media (min-width: 730px) {
+    .daterangepicker .ranges {
+        width: auto;
+    }
+    .daterangepicker.ltr .ranges {
+        float: left;
+    }
+    .daterangepicker.rtl .ranges {
+        float: right;
+    }
+    .daterangepicker .calendar.left {
+        clear: none !important;
+    }
+}
\ No newline at end of file


[45/51] [abbrv] ambari git commit: AMBARI-19880. WFM: "Workflow Designer" title should be changed to "Workflow Manager" and Minor UI fixes (Venkata Sairam via pallavkul)

Posted by rz...@apache.org.
AMBARI-19880. WFM: "Workflow Designer" title should be changed to "Workflow Manager" and Minor UI fixes (Venkata Sairam via pallavkul)

(cherry picked from commit 8a9c66d8bb29b078145d28d22f31ec5b4e843d1e)

Change-Id: Ie2c5bbb73dc6590f2b2f1d0f900ce24899de2667


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 664c3ba1b5f35b39042f2075b315bd61e75c5d99
Parents: 5ab3e42
Author: pallavkul <pa...@gmail.com>
Authored: Tue Feb 7 17:42:32 2017 +0530
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 08:59:04 2017 -0800

----------------------------------------------------------------------
 .../src/main/resources/ui/app/styles/app.less   | 41 ++++++++++++--------
 .../templates/components/designer-workspace.hbs | 13 ++-----
 .../ui/app/templates/components/help-icon.hbs   |  2 +-
 .../resources/ui/app/templates/dashboard.hbs    |  2 +-
 4 files changed, 30 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/664c3ba1/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less b/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less
index 3707280..750ba62 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/styles/app.less
@@ -29,7 +29,7 @@
 @actionLinkColor: #49aebf;
 @navTabAnchorColor: #777;
 @navTabAnchorHighlightedColor: #555;
-
+@modalDialogWidth: 60%;
 body {
     background: @bgColor;
     padding: 0;
@@ -76,6 +76,9 @@ a {
 .marginright5{
   margin-right: 5px !important;
 }
+.marginright10 {
+  margin-right: 10px !important;
+}
 .padding15pcnt {
   padding:15%;
 }
@@ -568,7 +571,6 @@ input:invalid {
 }
 
 #action_properties_dialog .modal-body {
-    max-height: @defaultPropertiesEditorHeight;
     overflow-y: scroll;
     overflow-x: hidden;
 }
@@ -584,11 +586,9 @@ input:invalid {
 }
 
 #configureJob .modal-body {
-    max-height: @defaultPropertiesEditorHeight;
     overflow-y: scroll;
     overflow-x: hidden;
 }
-
 #action_properties_dialog .modal-dialog,
 #workflow_sla_dialog .modal-dialog,
 #global_properties_dialog .modal-dialog,
@@ -601,12 +601,15 @@ input:invalid {
 #asset_manager_dialog .modal-dialog,
 #asset_config_dialog .modal-dialog,
 #asset_list_dialog .modal-dialog,
-#actionDetailsModal .modal-dialog {
-    width: 800px;
-}
-#configureJob .modal-dialog{
-  width: 650px;
+#actionDetailsModal .modal-dialog,
+#configureJob .modal-dialog,
+#asset-delete-confirm-dialog .modal-dialog,
+#projectsList .modal-dialog,
+#previewModal .modal-dialog {
+    width: @modalDialogWidth;
+height: 100vh;
 }
+
 #collapseOne{
     margin: 10px;
 }
@@ -1617,9 +1620,10 @@ input:invalid {
 }
 #search-table td:first-child {
   width:5%;
+  height:40px;
 }
 #draftsTable {
-  max-height:500px;
+  max-height: @defaultPropertiesEditorHeight;
   overflow-y:scroll;
 }
 #emptyDrafts {
@@ -1665,7 +1669,6 @@ input:invalid {
   min-height: 175px;
 }
 #asset-delete-confirm-dialog .modal-dialog{
-  width: 650px;
   top: 60px;
 }
 .action-link, .action-link:hover, .action-link:focus {
@@ -1699,15 +1702,9 @@ input:invalid {
 .displayBlock {
   display : block;
 }
-#projectsList .modal-dialog {
-  width:850px;
-}
 .tab-pane #draftsTable, #projectsList #dashboard, .tab-pane .searchWorkflows {
    display : none;
  }
- #projectDeleteModal .modal-dialog {
-   width:500px;
- }
  .projects-list {
    white-space: nowrap;
    width: 100%;
@@ -1735,3 +1732,13 @@ input:invalid {
    margin-bottom: 10px;
    margin-right: 3px;
  }
+ .modal {
+   height: 90vh;
+ }
+ .modal-body {
+   max-height:70vh;
+   overflow:scroll;
+ }
+ .CodeMirror{
+   height: auto;
+ }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/664c3ba1/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs
index 0bd7195..b29ae21 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/designer-workspace.hbs
@@ -21,7 +21,7 @@
       <div class="row">
         <div class="col-sm-4">
           <div class="navbar-brand">
-            <label for="">Workflow Designer</label>
+            <label for="">Workflow Manager</label>
           </div>
         </div>
         <div class="col-sm-8">
@@ -38,11 +38,11 @@
                     <li>
                       <a id="wfs_btn" class="pointer projects-list" title={{proj.workflowDefinitionPath}} {{action "editWorkflow" proj.workflowDefinitionPath proj.type}}>
                       {{#if (eq proj.type "WORKFLOW")}}
-                          <i class="fa fa-sitemap marginright5"></i>{{proj.name}}
+                          <i class="fa fa-sitemap marginright10"></i><span class="action-link">{{proj.name}}</span>
                       {{else if  (eq proj.type "COORDINATOR")}}
-                          <i class="fa fa-history marginright5"></i>{{proj.name}}
+                          <i class="fa fa-history marginright10"></i><span class="action-link">{{proj.name}}</span>
                       {{else}}
-                          <i class="fa fa-cubes marginright5"></i>{{proj.name}}
+                          <i class="fa fa-cubes marginright10"></i><span class="action-link">{{proj.name}}</span>
                       {{/if}}
                       </a>
                     </li>
@@ -98,11 +98,6 @@
               <button {{action "showAssetManager" true}} class="btn btn-default" title="Manage Assets">
                   Manage Assets
               </button>
-              {{#if (eq isProjectManagerEnabled "true")}}
-              <button {{action "showProjectManager" true}} class="btn btn-default" title="Project Manager">
-                  <i class="fa fa-folder marginright5" aria-hidden="true"></i>Projects
-              </button>
-              {{/if}}
               {{help-icon}}
             </div>
           </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/664c3ba1/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/help-icon.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/help-icon.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/help-icon.hbs
index 61893e2..e88c197 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/help-icon.hbs
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/help-icon.hbs
@@ -15,7 +15,7 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 }}
-<a href="https://oozie.apache.org/docs/4.2.0/WorkflowFunctionalSpec.html" target="_blank">
+<a href="http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.6.0/bk_workflow-management/content/index.html" target="_blank">
   <button type="button" class="btn btn-default" title="Help">
       <i class="fa fa-question-circle"></i>
   </button>

http://git-wip-us.apache.org/repos/asf/ambari/blob/664c3ba1/contrib/views/wfmanager/src/main/resources/ui/app/templates/dashboard.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/dashboard.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/dashboard.hbs
index 41a23b1..c75d1d2 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/dashboard.hbs
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/dashboard.hbs
@@ -24,7 +24,7 @@
     <span class="navbar-brand">Workflow Dashboard</span>
     <div class="navbar-brand" id="create-new-button">
       <button type="button" {{action "launchDesign"}} class="btn btn-default whiteLabel">
-          <i class="fa fa-sitemap marginright5"></i>Workflow Designer
+          <i class="fa fa-sitemap marginright5"></i>Workflow Manager
       </button>
       {{help-icon}}
     </div>


[37/51] [abbrv] ambari git commit: AMBARI-19844. Hive View 2.0: Allow user to rename table.(dipayanb)

Posted by rz...@apache.org.
AMBARI-19844. Hive View 2.0: Allow user to rename table.(dipayanb)

(cherry picked from commit 5a9f3817eef2a163d24dee8c20598136f6dd5e1f)

Change-Id: Ib1f75fd0a31768ea031eeef3b9efccc44df6b4ea


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 52c2da12de0367972d56cfc84e7910654799c94c
Parents: 21af204
Author: Dipayan Bhowmick <di...@gmail.com>
Authored: Mon Feb 6 11:43:04 2017 +0530
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 06:59:45 2017 -0800

----------------------------------------------------------------------
 .../hive20/resources/browser/DDLService.java    | 20 +++--
 .../resources/ui/app/adapters/application.js    | 33 ++++----
 .../src/main/resources/ui/app/adapters/table.js |  9 +++
 .../ui/app/components/table-rename-form.js      | 63 +++++++++++++++
 .../resources/ui/app/controllers/application.js |  5 +-
 .../hive20/src/main/resources/ui/app/router.js  |  1 +
 .../main/resources/ui/app/routes/application.js |  3 +-
 .../databases/database/tables/table/rename.js   | 83 ++++++++++++++++++++
 .../ui/app/services/table-operations.js         | 11 +++
 .../templates/components/table-rename-form.hbs  | 31 ++++++++
 .../databases/database/tables/table.hbs         |  1 +
 .../databases/database/tables/table/rename.hbs  | 46 +++++++++++
 .../src/main/resources/ui/config/environment.js |  6 ++
 13 files changed, 290 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/52c2da12/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java
index af8e1cd..89b9d84 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/browser/DDLService.java
@@ -158,18 +158,17 @@ public class DDLService extends BaseService {
   @PUT
   @Path("databases/{database_id}/tables/{table_id}/rename")
   @Produces(MediaType.APPLICATION_JSON)
-  @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+  @Consumes(MediaType.APPLICATION_JSON)
   public Response renameTable(@PathParam("database_id") String oldDatabaseName, @PathParam("table_id") String oldTableName,
-                              @FormParam("new_database_id") String newDatabaseName, @FormParam("new_table_id")
-                                  String newTableName) {
+                              TableRenameRequest request) {
     try {
-      Job job = proxy.renameTable(oldDatabaseName, oldTableName, newDatabaseName, newTableName, getResourceManager());
+      Job job = proxy.renameTable(oldDatabaseName, oldTableName, request.newDatabase, request.newTable, getResourceManager());
       JSONObject response = new JSONObject();
       response.put("job", job);
       return Response.status(Response.Status.ACCEPTED).entity(response).build();
     } catch (ServiceException e) {
       LOG.error("Exception occurred while renaming table for oldDatabaseName {}, oldTableName: {}, newDatabaseName : {}," +
-        " newTableName : {}", oldDatabaseName, oldTableName, newDatabaseName, newTableName, e);
+        " newTableName : {}", oldDatabaseName, oldTableName, request.newDatabase, request.newTable, e);
       throw new ServiceFormattedException(e);
     }
   }
@@ -346,4 +345,15 @@ public class DDLService extends BaseService {
   public static class CreateDatabaseRequest {
     public String name;
   }
+
+  /**
+   * Wrapper class for table rename request
+   */
+  public static class TableRenameRequest {
+    /* New database name */
+    public String newDatabase;
+
+    /* New table name */
+    public String newTable;
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c2da12/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js
index 1cdab9e..9cc8658 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/application.js
@@ -21,14 +21,14 @@ import DS from 'ember-data';
 import ENV from 'ui/config/environment';
 
 export default DS.RESTAdapter.extend({
-  init: function() {
+  init: function () {
     Ember.$.ajaxSetup({
       cache: false
     });
   },
 
-  namespace: Ember.computed(function() {
-    var parts = window.location.pathname.split('/').filter(function(i) {
+  namespace: Ember.computed(function () {
+    var parts = window.location.pathname.split('/').filter(function (i) {
       return i !== "";
     });
     var view = parts[parts.length - 3];
@@ -39,19 +39,19 @@ export default DS.RESTAdapter.extend({
       instance = parts[parts.length - 2];
       version = '';
     }
-    if(ENV.environment === 'development') {
+    if (ENV.environment === 'development') {
       return 'resources';
     }
     return 'api/v1/views/' + view + version + '/instances/' + instance + '/resources';
   }),
 
-  headers: Ember.computed(function() {
+  headers: Ember.computed(function () {
     let headers = {
       'X-Requested-By': 'ambari',
       'Content-Type': 'application/json'
     };
 
-    if(ENV.environment === 'development') {
+    if (ENV.environment === 'development') {
       // In development mode when the UI is served using ember serve the xhr requests are proxied to ambari server
       // by setting the proxyurl parameter in ember serve and for ambari to authenticate the requests, it needs this
       // basic authorization. This is for default admin/admin username/password combination.
@@ -59,21 +59,24 @@ export default DS.RESTAdapter.extend({
       //headers['Authorization'] = 'Basic aGl2ZTpoaXZl';
       //headers['Authorization'] = 'Basic ZGlwYXlhbjpkaXBheWFu';
     }
-     return headers;
+    return headers;
   }),
 
   parseErrorResponse(responseText) {
     let json = this._super(responseText);
-    let error = {};
-    error.message = json.message;
-    error.trace = json.trace;
-    error.status = json.status;
+    if (Ember.isEmpty(json.errors)) {
+      let error = {};
+      error.message = json.message;
+      error.trace = json.trace;
+      error.status = json.status;
 
-    delete json.trace;
-    delete json.status;
-    delete json.message;
+      delete json.trace;
+      delete json.status;
+      delete json.message;
+
+      json.errors = error;
+    }
 
-    json.errors = error;
     return json;
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c2da12/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js
index e878899..47174e4 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/table.js
@@ -49,6 +49,15 @@ export default DDLAdapter.extend({
     return this.ajax(deletURL, 'DELETE');
   },
 
+  renameTable(database, newTableName, oldTableName) {
+    let renameUrl = this.buildURL('table', null, null, 'query', { databaseId: database, tableName: oldTableName }) + '/rename';
+    let data = {
+      newDatabase: database,
+      newTable: newTableName
+    };
+    return this.ajax(renameUrl, 'PUT', {data: data});
+  },
+
   analyseTable(databaseName, tableName, withColumns = false) {
     let analyseUrl = this.buildURL('table', null, null, 'query', { databaseId: databaseName, tableName: tableName }) +
       '/analyze' +

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c2da12/contrib/views/hive20/src/main/resources/ui/app/components/table-rename-form.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-rename-form.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-rename-form.js
new file mode 100644
index 0000000..7640dd6
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/table-rename-form.js
@@ -0,0 +1,63 @@
+/**
+ * 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.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+  classNames: ['form-horizontal'],
+
+  errorCleaner: Ember.observer('newTableName', function() {
+    if(this.get('error')) {
+      this.clearError();
+    }
+  }),
+
+  validate() {
+    if(Ember.isEmpty(this.get('newTableName'))) {
+      this.setError("Table name cannot be empty");
+      return false;
+    }
+    if(this.get('newTableName') === this.get('table.table')) {
+      this.setError("New table name cannot be same as the old table name");
+      return false;
+    }
+    return true;
+  },
+
+  setError(message) {
+    this.set('error', true);
+    this.set('errorMessage', message);
+  },
+
+  clearError() {
+    this.set('error');
+    this.set('errorMessage');
+  },
+
+  actions: {
+    rename() {
+      if(this.validate()) {
+        this.sendAction('rename', this.get('newTableName'));
+      }
+    },
+
+    cancel() {
+      this.sendAction('cancel');
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c2da12/contrib/views/hive20/src/main/resources/ui/app/controllers/application.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/application.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/application.js
index 54df442..beb97e6 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/controllers/application.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/controllers/application.js
@@ -17,9 +17,12 @@
  */
 
 import Ember from 'ember';
+import ENV from 'ui/config/environment';
 
 export default Ember.Controller.extend({
   serviceCheck: Ember.inject.service(),
 
-  serviceCheckCompleted: Ember.computed.alias('serviceCheck.transitionToApplication')
+  serviceCheckCompleted: Ember.computed('serviceCheck.transitionToApplication', function() {
+    return !ENV.APP.SHOULD_PERFORM_SERVICE_CHECK || this.get('serviceCheck.transitionToApplication');
+  })
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c2da12/contrib/views/hive20/src/main/resources/ui/app/router.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/router.js b/contrib/views/hive20/src/main/resources/ui/app/router.js
index 428cb43..52361ff 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/router.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/router.js
@@ -40,6 +40,7 @@ Router.map(function() {
         this.route('new');
         this.route('upload-table');
         this.route('table', {path: '/:name'}, function() {
+          this.route('rename');
           this.route('columns');
           this.route('partitions');
           this.route('storage');

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c2da12/contrib/views/hive20/src/main/resources/ui/app/routes/application.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/application.js b/contrib/views/hive20/src/main/resources/ui/app/routes/application.js
index 697f727..f4ceeb9 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/application.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/application.js
@@ -18,6 +18,7 @@
 
 import Ember from 'ember';
 import tabs from '../configs/top-level-tabs';
+import ENV from 'ui/config/environment';
 
 export default Ember.Route.extend({
   keepAlive: Ember.inject.service('keep-alive'),
@@ -28,7 +29,7 @@ export default Ember.Route.extend({
   },
 
   beforeModel() {
-    if (!this.get('serviceCheck.checkCompleted')) {
+    if (ENV.APP.SHOULD_PERFORM_SERVICE_CHECK && !this.get('serviceCheck.checkCompleted')) {
       this.transitionTo('service-check');
     }
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c2da12/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/rename.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/rename.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/rename.js
new file mode 100644
index 0000000..cac471e
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/table/rename.js
@@ -0,0 +1,83 @@
+/**
+ * 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.
+ */
+
+import TableMetaRouter from './table-meta-router';
+
+export default TableMetaRouter.extend({
+
+  tableOperations: Ember.inject.service(),
+
+  activate() {
+    let tableController = this.controllerFor('databases.database.tables.table');
+    this.set('existingTabs', tableController.get('tabs'));
+    tableController.set('tabs', []);
+  },
+
+  deactivate() {
+    let tableController = this.controllerFor('databases.database.tables.table');
+    tableController.set('tabs', this.get('existingTabs'));
+  },
+
+  actions: {
+    cancel() {
+      this.transitionTo('databases.database.tables');
+    },
+
+    rename(newTableName) {
+      let tableName = this.controller.get('table.table');
+      let databaseName = this.controller.get('table.database');
+      this._renameTo(newTableName, tableName, databaseName);
+    }
+  },
+
+  _renameTo(newTableName, oldTableName, databaseName) {
+    this._modalStatus(true, 'Submitting request to rename table');
+    this.get('tableOperations').renameTable(databaseName, newTableName, oldTableName).then((job) => {
+      this._modalStatus(true, 'Waiting for the table to be renamed');
+      return this.get('tableOperations').waitForJobToComplete(job.get('id'), 5 * 1000);
+    }).then((status) => {
+      this._modalStatus(true, 'Successfully renamed table');
+      this._transitionToTables();
+    }).catch((err) => {
+      this._modalStatus(true, 'Failed to rename table');
+      this._alertMessage('Failed to rename table', err);
+      this._transitionToTables();
+    });
+  },
+
+  _modalStatus(status, message) {
+    this.controller.set('showModal', status);
+    if(status) {
+      this.controller.set('modalMessage', message);
+    }
+  },
+
+  _transitionToTables() {
+    Ember.run.later(() => {
+      this._modalStatus(false);
+      this.transitionTo('databases');
+    }, 2000);
+  },
+
+  _alertMessage(message, err) {
+    console.log(message, err);
+    // TODO: user alert message here
+  }
+
+
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c2da12/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js b/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
index e442a36..d11816c 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
@@ -56,6 +56,17 @@ export default Ember.Service.extend({
     })
   },
 
+  renameTable(databaseName, newTableName, oldTableName ) {
+    return new Promise((resolve, reject) => {
+      this.get('store').adapterFor('table').renameTable(databaseName, newTableName, oldTableName).then((data) => {
+        this.get('store').pushPayload(data);
+        resolve(this.get('store').peekRecord('job', data.job.id));
+      }, (err) => {
+        reject(err);
+      });
+    })
+  },
+
   deleteDatabase(database) {
     return new Promise((resolve, reject) => {
       this.get('store').adapterFor('database').deleteDatabase(database.get('name')).then((data) => {

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c2da12/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-rename-form.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-rename-form.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-rename-form.hbs
new file mode 100644
index 0000000..b692a9c
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/table-rename-form.hbs
@@ -0,0 +1,31 @@
+{{!
+* 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.
+}}
+
+<div class="form-group">
+  <label class="col-sm-4 control-label">New Table Name</label>
+  <div class="col-sm-8 {{if error 'has-error'}}">
+    {{input value=newTableName class="form-control" placeholder="Table Name"}}
+    <span class="help-block">{{errorMessage}}</span>
+  </div>
+</div>
+<div class="form-group">
+  <div class="col-sm-offset-4 col-sm-8">
+    <button type="submit" class="btn btn-warning" {{action "rename"}}>{{fa-icon "pencil-square-o"}} Rename</button>
+    <button type="submit" class="btn btn-primary" {{action "cancel"}}>{{fa-icon "times"}} Cancel</button>
+  </div>
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c2da12/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table.hbs
index 2d1d075..e3fe400 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table.hbs
@@ -26,6 +26,7 @@
         </button>
         <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenu1">
           <li><a href="#" class="text-uppercase" {{action "editTable" model}}>{{fa-icon "edit"}} Edit</a></li>
+          <li>{{#link-to "databases.database.tables.table.rename" class="text-uppercase"}}{{fa-icon "edit"}} Rename{{/link-to}}</li>
           <li><a href="#" class="text-uppercase" {{action "deleteTable" model}}>{{fa-icon "trash"}} Delete</a></li>
         </ul>
       </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c2da12/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/rename.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/rename.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/rename.hbs
new file mode 100644
index 0000000..31da3d4
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/table/rename.hbs
@@ -0,0 +1,46 @@
+{{!
+* 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.
+}}
+
+<div class="row">
+  <div class="alert alert-info">
+    <p class="lead">{{fa-icon "pencil-square-o" size=1}} Rename table <strong class="text-uppercase">{{table.table}}</strong></p>
+  </div>
+</div>
+
+<div class="row stats-section">
+  <div class="col-md-6">
+    {{table-rename-form table=table
+                        cancel="cancel"
+                        rename="rename"}}
+  </div>
+</div>
+
+{{#if showModal}}
+  {{#modal-dialog
+    translucentOverlay=true
+    container-class="modal-dialog modal-sm"}}
+    <div class="modal-content">
+      <div class="modal-header text-danger">
+        <p class="modal-title">{{fa-icon "pencil-square-o"}}&nbsp;&nbsp;&nbsp; Rename Table</p>
+      </div>
+      <div class="modal-body text-center text-primary">
+        <p>{{modalMessage}}</p>
+      </div>
+    </div><!-- /.modal-content -->
+  {{/modal-dialog}}
+{{/if}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/52c2da12/contrib/views/hive20/src/main/resources/ui/config/environment.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/config/environment.js b/contrib/views/hive20/src/main/resources/ui/config/environment.js
index 98b3c8c..3714eb9 100644
--- a/contrib/views/hive20/src/main/resources/ui/config/environment.js
+++ b/contrib/views/hive20/src/main/resources/ui/config/environment.js
@@ -34,6 +34,7 @@ module.exports = function(environment) {
     APP: {
       // Here you can pass flags/options to your application instance
       // when it is created
+      SHOULD_PERFORM_SERVICE_CHECK: true
     }
   };
 
@@ -43,6 +44,11 @@ module.exports = function(environment) {
     // ENV.APP.LOG_TRANSITIONS = true;
     // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
     // ENV.APP.LOG_VIEW_LOOKUPS = true;
+
+
+    // Change the value to false to prevent the service checks. This is required in development mode
+    // as service checks take up time and hence increase the overall development time.
+    ENV.APP.SHOULD_PERFORM_SERVICE_CHECK = true;
   }
 
   if (environment === 'test') {


[21/51] [abbrv] ambari git commit: AMBARI-19852. Workflow name mandatory for save in Coordinator and Bundle (Venkata Sairam via pallavkul)

Posted by rz...@apache.org.
AMBARI-19852. Workflow name mandatory for save in Coordinator and Bundle (Venkata Sairam via pallavkul)

(cherry picked from commit 6231da4e873d51ba89c3dd933a6c7e03cb47d119)

Change-Id: Ie311019e9eca395a521422abf0a2847f23b5835f


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: d1c34a9ab0cc364f7d97a948ab5145ca7edd3412
Parents: 02984ff
Author: pallavkul <pa...@gmail.com>
Authored: Thu Feb 2 23:07:05 2017 +0530
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 01:54:00 2017 -0800

----------------------------------------------------------------------
 .../resources/ui/app/components/bundle-config.js   |  5 ++++-
 .../resources/ui/app/components/coord-config.js    | 17 ++++++++++-------
 .../resources/ui/app/components/flow-designer.js   |  5 +++++
 3 files changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d1c34a9a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
index 7b24d34..445b86e 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/bundle-config.js
@@ -390,9 +390,12 @@ export default Ember.Component.extend(Ember.Evented, Validations, {
       this.set('showVersionSettings', value);
     },
     save(){
+      if (Ember.isBlank(this.$('[name=bundle_title]').val())) {
+        return;
+      }
       var isDraft = false, bundleXml;
       if(this.get('validations.isInvalid')) {
-       isDraft = true;
+        isDraft = true;
       }else{
         var bundleGenerator = BundleGenerator.create({bundle:this.get("bundle")});
         bundleXml = bundleGenerator.process();

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1c34a9a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
index 57dbeb0..b045798 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/coord-config.js
@@ -147,7 +147,7 @@ export default Ember.Component.extend(Validations, Ember.Evented, {
     if(Ember.isBlank(this.get('coordinator.name'))){
       this.set('coordinator.name', Ember.copy(this.get('tabInfo.name')));
     }
-    this.schedulePersistWorkInProgress();    
+    this.schedulePersistWorkInProgress();
   },
   coordinatorFilePath : Ember.computed('tabInfo.filePath', function(){
     return this.get('tabInfo.filePath');
@@ -344,12 +344,12 @@ export default Ember.Component.extend(Validations, Ember.Evented, {
       this.set('inputLogicEnabled', true);
     }
   },
-  validateChildComponents(){
+  validateChildComponents(showErrorMessage){
     var isChildComponentsValid = true;
     this.get('childComponents').forEach((context)=>{
       if(context.get('validations') && context.get('validations.isInvalid')){
         isChildComponentsValid =  false;
-        context.set('showErrorMessage', true);
+        context.set('showErrorMessage', showErrorMessage);
       }
     }.bind(this));
     return isChildComponentsValid;
@@ -457,7 +457,7 @@ export default Ember.Component.extend(Validations, Ember.Evented, {
       this.send('submit');
     },
     submit(){
-      var isChildComponentsValid = this.validateChildComponents();
+      var isChildComponentsValid = this.validateChildComponents(true);
       if(this.get('validations.isInvalid') || !isChildComponentsValid) {
         this.set('showErrorMessage', true);
         return;
@@ -539,7 +539,7 @@ export default Ember.Component.extend(Validations, Ember.Evented, {
       this.set('inputLogicExists', false);
     },
     preview(){
-      var isChildComponentsValid = this.validateChildComponents();
+      var isChildComponentsValid = this.validateChildComponents(true);
       if(this.get('validations.isInvalid') || !isChildComponentsValid) {
         this.set('showErrorMessage', true);
         return;
@@ -637,10 +637,13 @@ export default Ember.Component.extend(Validations, Ember.Evented, {
       this.set('showVersionSettings', value);
     },
     save(){
+      if (Ember.isBlank(this.$('[name=coord_title]').val())) {
+        return;
+      }
       var isDraft = false, coordinatorXml;
-      var isChildComponentsValid = this.validateChildComponents();
+      var isChildComponentsValid = this.validateChildComponents(false);
       if(this.get('validations.isInvalid') || !isChildComponentsValid) {
-       isDraft = true;
+        isDraft = true;
       }else{
         var coordGenerator = CoordinatorGenerator.create({coordinator:this.get("coordinator")});
         coordinatorXml = coordGenerator.process();

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1c34a9a/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
index 4618ab6..90fba0d 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/flow-designer.js
@@ -695,9 +695,14 @@ export default Ember.Component.extend(FindNodeMixin, Validations, {
     }, 1000);
   },
   openSaveWorkflow() {
+    if(Ember.isBlank(this.$('[name=wf_title]').val())) {
+      this.set('errors',[{"message":"Workflow name is mandatory"}]);
+      return;
+    }
     var workflowGenerator = WorkflowGenerator.create({workflow:this.get("workflow"), workflowContext:this.get('workflowContext')});
     var workflowXml = workflowGenerator.process();
     var workflowJson = this.getWorkflowAsJson();
+    this.set('errors', []);
     var isDraft = this.get('workflowContext').hasErrors()? true: false;
     this.set("configForSave", {json : workflowJson, xml : workflowXml,isDraft : isDraft});
     this.set("showingSaveWorkflow",true);


[39/51] [abbrv] ambari git commit: AMBARI-19825 : Metrics data is not getting collected for different services when AMS HTTPS is enabled. (avijayan)

Posted by rz...@apache.org.
AMBARI-19825 : Metrics data is not getting collected for different services when AMS HTTPS is enabled. (avijayan)

(cherry picked from commit d2837f7864ddd0a961c1213761580576a772cedd)

Change-Id: I94b6416ce791cefb2345a99a0609536242a9c6c3


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: fcd422c3b63c89444fb33ba646f8524ca71c9e1c
Parents: 6999527
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Thu Feb 2 10:19:52 2017 -0800
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 07:11:05 2017 -0800

----------------------------------------------------------------------
 .../metrics2/sink/flume/FlumeTimelineMetricsSink.java     |  3 ++-
 .../metrics2/sink/timeline/HadoopTimelineMetricsSink.java |  6 +++---
 .../metrics2/sink/storm/StormTimelineMetricsReporter.java |  5 +----
 .../server/metrics/system/impl/AmbariMetricSinkImpl.java  | 10 ++++++++++
 4 files changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fcd422c3/ambari-metrics/ambari-metrics-flume-sink/src/main/java/org/apache/hadoop/metrics2/sink/flume/FlumeTimelineMetricsSink.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-flume-sink/src/main/java/org/apache/hadoop/metrics2/sink/flume/FlumeTimelineMetricsSink.java b/ambari-metrics/ambari-metrics-flume-sink/src/main/java/org/apache/hadoop/metrics2/sink/flume/FlumeTimelineMetricsSink.java
index c1b684b..86e092a 100644
--- a/ambari-metrics/ambari-metrics-flume-sink/src/main/java/org/apache/hadoop/metrics2/sink/flume/FlumeTimelineMetricsSink.java
+++ b/ambari-metrics/ambari-metrics-flume-sink/src/main/java/org/apache/hadoop/metrics2/sink/flume/FlumeTimelineMetricsSink.java
@@ -107,13 +107,14 @@ public class FlumeTimelineMetricsSink extends AbstractTimelineMetricsSink implem
     // Initialize the collector write strategy
     super.init();
 
-    collectorUri = constructTimelineMetricUri(protocol, findPreferredCollectHost(), port);
     if (protocol.contains("https")) {
       String trustStorePath = configuration.getProperty(SSL_KEYSTORE_PATH_PROPERTY).trim();
       String trustStoreType = configuration.getProperty(SSL_KEYSTORE_TYPE_PROPERTY).trim();
       String trustStorePwd = configuration.getProperty(SSL_KEYSTORE_PASSWORD_PROPERTY).trim();
       loadTruststore(trustStorePath, trustStoreType, trustStorePwd);
     }
+    collectorUri = constructTimelineMetricUri(protocol, findPreferredCollectHost(), port);
+
     pollFrequency = Long.parseLong(configuration.getProperty("collectionFrequency"));
 
     String[] metrics = configuration.getProperty(COUNTER_METRICS_PROPERTY).trim().split(",");

http://git-wip-us.apache.org/repos/asf/ambari/blob/fcd422c3/ambari-metrics/ambari-metrics-hadoop-sink/src/main/java/org/apache/hadoop/metrics2/sink/timeline/HadoopTimelineMetricsSink.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-hadoop-sink/src/main/java/org/apache/hadoop/metrics2/sink/timeline/HadoopTimelineMetricsSink.java b/ambari-metrics/ambari-metrics-hadoop-sink/src/main/java/org/apache/hadoop/metrics2/sink/timeline/HadoopTimelineMetricsSink.java
index b2ca52e..1936977 100644
--- a/ambari-metrics/ambari-metrics-hadoop-sink/src/main/java/org/apache/hadoop/metrics2/sink/timeline/HadoopTimelineMetricsSink.java
+++ b/ambari-metrics/ambari-metrics-hadoop-sink/src/main/java/org/apache/hadoop/metrics2/sink/timeline/HadoopTimelineMetricsSink.java
@@ -107,15 +107,15 @@ public class HadoopTimelineMetricsSink extends AbstractTimelineMetricsSink imple
     if (collectorHosts.isEmpty()) {
       LOG.error("No Metric collector configured.");
     } else {
-      String preferredCollectorHost = findPreferredCollectHost();
-      collectorUri = constructTimelineMetricUri(protocol, preferredCollectorHost, port);
-      containerMetricsUri = constructContainerMetricUri(protocol, preferredCollectorHost, port);
       if (protocol.contains("https")) {
         String trustStorePath = conf.getString(SSL_KEYSTORE_PATH_PROPERTY).trim();
         String trustStoreType = conf.getString(SSL_KEYSTORE_TYPE_PROPERTY).trim();
         String trustStorePwd = conf.getString(SSL_KEYSTORE_PASSWORD_PROPERTY).trim();
         loadTruststore(trustStorePath, trustStoreType, trustStorePwd);
       }
+      String preferredCollectorHost = findPreferredCollectHost();
+      collectorUri = constructTimelineMetricUri(protocol, preferredCollectorHost, port);
+      containerMetricsUri = constructContainerMetricUri(protocol, preferredCollectorHost, port);
     }
 
     LOG.info("Collector Uri: " + collectorUri);

http://git-wip-us.apache.org/repos/asf/ambari/blob/fcd422c3/ambari-metrics/ambari-metrics-storm-sink/src/main/java/org/apache/hadoop/metrics2/sink/storm/StormTimelineMetricsReporter.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-storm-sink/src/main/java/org/apache/hadoop/metrics2/sink/storm/StormTimelineMetricsReporter.java b/ambari-metrics/ambari-metrics-storm-sink/src/main/java/org/apache/hadoop/metrics2/sink/storm/StormTimelineMetricsReporter.java
index 53250ee..b716c7e 100644
--- a/ambari-metrics/ambari-metrics-storm-sink/src/main/java/org/apache/hadoop/metrics2/sink/storm/StormTimelineMetricsReporter.java
+++ b/ambari-metrics/ambari-metrics-storm-sink/src/main/java/org/apache/hadoop/metrics2/sink/storm/StormTimelineMetricsReporter.java
@@ -42,7 +42,6 @@ public class StormTimelineMetricsReporter extends AbstractTimelineMetricsSink
   public static final String DEFAULT_CLUSTER_REPORTER_APP_ID = "nimbus";
 
   private String hostname;
-  private String collectorUri;
   private String applicationId;
   private int timeoutSeconds;
   private String port;
@@ -117,9 +116,7 @@ public class StormTimelineMetricsReporter extends AbstractTimelineMetricsSink
         DEFAULT_POST_TIMEOUT_SECONDS;
       applicationId = conf.getProperty(CLUSTER_REPORTER_APP_ID, DEFAULT_CLUSTER_REPORTER_APP_ID);
 
-      collectorUri = constructTimelineMetricUri(protocol, findPreferredCollectHost(), port);
-
-      if (collectorUri.toLowerCase().startsWith("https://")) {
+      if (protocol.contains("https")) {
         String trustStorePath = conf.getProperty(SSL_KEYSTORE_PATH_PROPERTY).toString().trim();
         String trustStoreType = conf.getProperty(SSL_KEYSTORE_TYPE_PROPERTY).toString().trim();
         String trustStorePwd = conf.getProperty(SSL_KEYSTORE_PASSWORD_PROPERTY).toString().trim();

http://git-wip-us.apache.org/repos/asf/ambari/blob/fcd422c3/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java
index 358b8fa..58d36c3 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/metrics/system/impl/AmbariMetricSinkImpl.java
@@ -28,6 +28,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
 
+import org.apache.ambari.server.configuration.ComponentSSLConfiguration;
 import org.apache.ambari.server.controller.AmbariManagementController;
 import org.apache.ambari.server.controller.internal.AbstractControllerResourceProvider;
 import org.apache.ambari.server.controller.internal.ServiceConfigVersionResourceProvider;
@@ -156,6 +157,15 @@ public class AmbariMetricSinkImpl extends AbstractTimelineMetricsSink implements
 
     hostName = configuration.getProperty("ambariserver.hostname.override", getDefaultLocalHostName());
     LOG.info("Hostname used for ambari server metrics : " + hostName);
+
+    if (protocol.contains("https")) {
+      ComponentSSLConfiguration sslConfiguration = ComponentSSLConfiguration.instance();
+      String trustStorePath = sslConfiguration.getTruststorePath();
+      String trustStoreType = sslConfiguration.getTruststoreType();
+      String trustStorePwd = sslConfiguration.getTruststorePassword();
+      loadTruststore(trustStorePath, trustStoreType, trustStorePwd);
+    }
+
     collectorUri = getCollectorUri(findPreferredCollectHost());
 
     int maxRowCacheSize = Integer.parseInt(configuration.getProperty(MAX_METRIC_ROW_CACHE_SIZE,


[41/51] [abbrv] ambari git commit: AMBARI-19863 Fix Log Search User Config bugs (mgergely)

Posted by rz...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/MainLayoutView.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/MainLayoutView.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/MainLayoutView.js
index 2333c53..929ca98 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/MainLayoutView.js
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/MainLayoutView.js
@@ -17,376 +17,367 @@
 */
 
 define(['require',
-	'backbone',
-	'utils/Utils',
-	'utils/ViewUtils',
-	'utils/Globals',
-	'hbs!tmpl/dashboard/MainLayoutView_tmpl',
-	'select2',
-	'sparkline',
-	'd3.tip'
+    'backbone',
+    'utils/Utils',
+    'utils/ViewUtils',
+    'utils/Globals',
+    'hbs!tmpl/dashboard/MainLayoutView_tmpl',
+    'select2',
+    'sparkline',
+    'd3.tip'
 ],function(require,Backbone,Utils,ViewUtils,Globals,MainLayoutViewTmpl){
     'use strict';
 
-	var MainLayoutView = Backbone.Marionette.Layout.extend(
-	/** @lends MainLayoutView */
-	{
-		_viewName : 'MainLayoutView',
-
-		template: MainLayoutViewTmpl,
-
-		/** Layout sub regions */
-		regions: {
-			RLogLevel : "#r_logLevel",
-			RComponents : "#r_components",
-			RHosts : "#r_hosts",
-			RHierarchyTab : "#r_Hierarchy",
-			RHostInfoTab : "#r_HostInfo",
-			RBubbleTable : "#r_BubbleTable",
-			RAuditTab : "#r_AuditInfo",
-			RAuditDashboard:"#r_AuditDashboard",
-			RTroubleShoot:"#r_TroubleShoot"
-		},
-
-		/** ui selector cache */
-		ui: {
-//			graph : "#graphAgg",
-			searchBox : '[data-id="mainSearch"]',
-			searchBoxBtn : '[data-id="mainSearchBtn"]',
-			compare:".compare .panel-heading",
-			CompareButton:"[data-id='CompareButton']",
-			CompareClearAll:"[data-id='CompareClearAll']",
-			CloseCompareComponent:".hostCompList .closeComponent"
-			//viewType: "input[name='viewType']",
-		},
-
-		/** ui events hash */
-		events: function() {
-			var events = {};
-			//events['click #searchLog'] = 'onSearchLogClick';
-			events["click "+this.ui.searchBoxBtn] = 'onSearchLogClick';
-			events['change ' + this.ui.viewType]  = 'onViewTypeChange';
-			events['click button[data-tab-id]']  = 'onDeleteTabClick';
-			events["click "+this.ui.compare] = function(e){
-				this.togglePanelPosition(false,false);
-			}
-			events["click "+this.ui.CompareButton] = 'onCompareButtonClick';
-			events["click "+this.ui.CompareClearAll] = 'onCompareClearAllClick';
-			events["click "+this.ui.CloseCompareComponent] = function(e){
-				this.onCloseCompareComponentClick($(e.currentTarget).parents('span').data().id,true);
-			}
-			events["click .nav.nav-tabs li"] = function(e){
-				this.hideContextMenu();
-			}
-			return events;
-		},
-
-		/**
-		 * intialize a new MainLayoutView Layout
-		 * @constructs
-		 */
-		initialize: function(options) {
-			_.extend(this, _.pick(options,'globalVent'));
-			this.vent = new Backbone.Wreqr.EventAggregator();
-			this.dateUtil = Utils.dateUtil;
-			this.bindEvents();
-			this.componetList =[];
-		},
-		bindEvents : function(){
-			this.listenTo(this.globalVent,"render:tab",function(options){
-				var that = this;
-				this.hideContextMenu();
-            	this.renderLogFileTab(options);
-            	setTimeout(function(){
-            		that.reAdjustTab()
-            	},1000);
+    var MainLayoutView = Backbone.Marionette.Layout.extend(
+    /** @lends MainLayoutView */
+    {
+        _viewName : 'MainLayoutView',
+
+        template: MainLayoutViewTmpl,
+
+        /** Layout sub regions */
+        regions: {
+            RLogLevel : "#r_logLevel",
+            RComponents : "#r_components",
+            RHosts : "#r_hosts",
+            RHierarchyTab : "#r_Hierarchy",
+            RHostInfoTab : "#r_HostInfo",
+            RBubbleTable : "#r_BubbleTable",
+            RAuditTab : "#r_AuditInfo",
+            RAuditDashboard:"#r_AuditDashboard",
+            RTroubleShoot:"#r_TroubleShoot"
+        },
+
+        /** ui selector cache */
+        ui: {
+//            graph : "#graphAgg",
+            searchBox : '[data-id="mainSearch"]',
+            searchBoxBtn : '[data-id="mainSearchBtn"]',
+            compare:".compare .panel-heading",
+            CompareButton:"[data-id='CompareButton']",
+            CompareClearAll:"[data-id='CompareClearAll']",
+            CloseCompareComponent:".hostCompList .closeComponent"
+            //viewType: "input[name='viewType']",
+        },
+
+        /** ui events hash */
+        events: function() {
+            var events = {};
+            //events['click #searchLog'] = 'onSearchLogClick';
+            events["click "+this.ui.searchBoxBtn] = 'onSearchLogClick';
+            events['change ' + this.ui.viewType]  = 'onViewTypeChange';
+            events['click button[data-tab-id]']  = 'onDeleteTabClick';
+            events["click "+this.ui.compare] = function(e){
+                this.togglePanelPosition(false,false);
+            }
+            events["click "+this.ui.CompareButton] = 'onCompareButtonClick';
+            events["click "+this.ui.CompareClearAll] = 'onCompareClearAllClick';
+            events["click "+this.ui.CloseCompareComponent] = function(e){
+                this.onCloseCompareComponentClick($(e.currentTarget).parents('span').data().id,true);
+            }
+            events["click .nav.nav-tabs li"] = function(e){
+                this.hideContextMenu();
+            }
+            return events;
+        },
+
+        /**
+         * intialize a new MainLayoutView Layout
+         * @constructs
+         */
+        initialize: function(options) {
+            _.extend(this, _.pick(options,'globalVent'));
+            this.vent = new Backbone.Wreqr.EventAggregator();
+            this.dateUtil = Utils.dateUtil;
+            this.bindEvents();
+            this.componetList =[];
+        },
+        bindEvents : function(){
+            this.listenTo(this.globalVent,"render:tab",function(options){
+                var that = this;
+                this.hideContextMenu();
+                this.renderLogFileTab(options);
+                setTimeout(function(){
+                    that.reAdjustTab()
+                },1000);
 
             },this);
             this.listenTo(this.globalVent,"render:comparison:tab",function(options){
-				this.hideContextMenu();
-            	this.renderComparisonTab(options);
+                this.hideContextMenu();
+                this.renderComparisonTab(options);
             },this);
             this.listenTo(this.globalVent,"show:tab",function(tabName){
-            	this.showTab(tabName);
+                this.showTab(tabName);
             },this);
             this.listenTo(this.globalVent,"add:compare",function($el){
-            	this.quickMenuCompare = true;
-            	this.onCompareLink($el);
+                this.quickMenuCompare = true;
+                this.onCompareLink($el);
             },this);
-		},
-		onRender : function(){
-			this.renderTroubleShootTab();
-			this.renderHierarchyTab();
-			this.renderAuditTab();
-			//this.renderDashBoardTab();
-			this.togglePanelPosition(true);
-			this.bindTabCheckboxClick();
-			this.bindTabClickListener();
-			this.tabScrollBind();
-		},
-		onShow : function(){
-			//navigating to specific component tab
-			var params = ViewUtils.getDefaultParams();
-			if(params.host_name && params.component_name){
-				this.globalVent.trigger("render:tab",{
-					params:_.extend({},{
-						host_name :  params.host_name,
-						component_name : params.component_name
-					},params),
-					globalVent : this.globalVent
-				});
-			}
-		},
-		renderLogFileTab : function(view){
-			var that = this;
-			require(['views/tabs/LogFileView'], function(LogFileView){
-				var tabName = (view.params.host_name + view.params.component_name).replace(/\./g,"_");
-				if(_.isUndefined(that[tabName])){
-					var region = {};
-					region[tabName] = '#' + tabName;
-					$('<div/>', {
-						'id': tabName,
-						'class': 'tab-pane',
-						'role':"tabpanel"
-					}).appendTo(that.$('.tab-content'));
-					that.addRegions(region);
-					var region = that.getRegion(tabName);
-					region.show(new LogFileView(view));
-					that.$(".nav.nav-tabs").append('<li data-id="'+tabName+'" role="presentation">'+
-							'<a data-id="'+tabName+'" data-host="'+view.params.host_name+'" data-component="'+view.params.component_name+'" href="#'+tabName+'" aria-controls="profile" role="tab" data-toggle="tab" title="'+view.params.host_name.split(".")[0]+' >> '+view.params.component_name+' ">'+view.params.host_name.split(".")[0]+'<b> >> </b>'+view.params.component_name+'</a>'+
-	//						'<span class="air air-top-right">'+
-								'<button data-tab-id="'+tabName+'" class="btn-closeTab"><i class="fa fa-times-circle"></i></button>'+
-								'<div class="compareClick" title="Compare"><i class="fa fa-square-o"></i></div>');
-	//							'<i class="fa fa-times"></i>'+
-	//							'</button></span></li>');
-				}else{
-					if(that[tabName].currentView){
-						_.extend(that[tabName].currentView.params,view.params);
-						that[tabName].currentView.render();
-					}
-				}
-				//$("html, body").animate({ scrollTop: 0 }, 500);
-				that.showTab(tabName);
-			});
-		},
-		renderComparisonTab:function(view){
-			var that = this;
-			require(['views/tabs/ComparisonLayoutView'], function(ComparisonLayoutView){
-				var tabName = "";
-				_.each(view.componetList,function(object){
-					if(object.host_name && object.component_name){
-						tabName += (object.host_name + object.component_name).replace(/\./g,"_");
-					}
-				});
-				if(_.isUndefined(that[tabName])){
-					var region = {};
-					region[tabName] = '#' + tabName;
-					$('<div/>', {
-						'id': tabName,
-						'class': 'tab-pane',
-						'role':"tabpanel"
-					}).appendTo(that.$('.tab-content'));
-					that.addRegions(region);
-					var region = that.getRegion(tabName);
-					region.show(new ComparisonLayoutView(view));
-					that.$(".nav.nav-tabs").append('<li data-id="'+tabName+'" role="presentation">'+
-							'<a data-id="'+tabName+'"  href="#'+tabName+'" aria-controls="profile" role="tab" data-toggle="tab">Compare</a>'+
-	//						'<span class="air air-top-right">'+
-								'<button data-tab-id="'+tabName+'" class="btn-closeTab"><i class="fa fa-times-circle"></i></button>');
-	//							'<i class="fa fa-times"></i>'+
-	//							'</button></span></li>');
-				}else{
-					if(that[tabName].currentView){
-						_.extend(that[tabName].currentView.params,view.params);
-						that[tabName].currentView.render();
-					}
-				}
-				$("html, body").animate({ scrollTop: 0 }, 500);
-				that.showTab(tabName);
-			});
-
-		},
-		showTab : function(tabId){
-			this.$(".nav.nav-tabs li").removeClass("active");
-			this.$("li[data-id='"+tabId+"']").addClass("active");
-			this.$(".tab-pane").removeClass("active");
-			this.$("#"+tabId).addClass("active");
-			this.tabOpen = true;
-			this.reAdjustTab();
-		},
-		onDeleteTabClick : function(e){
-			var tabId = $(e.currentTarget).data("tab-id");
-			if(this[tabId]){
-				this[tabId].close && this[tabId].close();
-				this.removeRegion(tabId);
-				this.$("li[data-id="+tabId+"]").remove();
-				this.$("#"+tabId).remove();
-				this.showTab(this.$(".nav.nav-tabs li").last().data("id"));
-			}
-		},
-		bindDraggableEvent : function(){
-			Utils.bindDraggableEvent(this.$( "div.box").not('.no-drop'));
-		},
-		renderLogLevel : function(){
-			var that = this;
-			require(['views/dashboard/LogLevelView'], function(LogLevelView){
-			 	that.RLogLevel.show(new LogLevelView({
-					vent : that.vent,
-					globalVent:that.globalVent
-				}));
-			})
-
-		},
-		renderComponents : function(){
-			var that = this;
-			require(['views/dashboard/ComponentsView'], function(ComponentsView){
-				that.RComponents.show(new ComponentsView({
-					vent : that.vent,
-					globalVent:that.globalVent
-				}));
-			})
-		},
-		renderHosts : function(){
-			var that = this;
-			require(['views/dashboard/HostsView'], function(HostsView){
-				that.RHosts.show(new HostsView({
-					vent : that.vent,
-					globalVent:that.globalVent
-				}));
-			});
-		},
-		renderBubbleTableView : function(){
-			var that = this;
-			require(['views/dashboard/BubbleGraphTableLayoutView'], function(BubbleTableLayoutView){
-				that.RBubbleTable.show(new BubbleTableLayoutView({
-					vent : that.vent,
-					globalVent:that.globalVent
-				}));
-			});
-		},
-		renderTroubleShootTab:function(){
-			var that = this;
-			require(['views/troubleshoot/TroubleShootLayoutView'], function(TroubleShootLayoutView){
-
-				that.RTroubleShoot.show(new TroubleShootLayoutView({
-					globalVent:that.globalVent
-				}));
-			});
-		},
-		renderHierarchyTab : function(){
-			var that = this;
-			require(['views/tabs/HierarchyTabLayoutView'], function(HierarchyTabLayoutView){
-				that.RHierarchyTab.show(new HierarchyTabLayoutView({
-					globalVent:that.globalVent
-				}));
-			});
-		},
-		renderHostInfoTab : function(){
-			var that = this;
-			require(['views/tabs/HostInfoTabLayoutView'], function(HostInfoTabLayoutView){
-				that.RHostInfoTab.show(new HostInfoTabLayoutView({
-					globalVent:that.globalVent
-				}));
-			});
-		},
-		renderAuditTab : function(){
-			var that = this;
-			require(['views/audit/AuditTabLayoutView'], function(AuditTabLayoutView){
-				that.RAuditTab.show(new AuditTabLayoutView({
-					globalVent:that.globalVent
-				}));
-			});
-		},
-		renderDashBoardTab:function(){
-			var that = this;
-			require(['views/dashboard/DashboardLayoutView'], function(DashboardLayoutView){
-				that.RAuditDashboard.show(new DashboardLayoutView({
-					globalVent:that.globalVent
-				}));
-			});
-		},
-		hideContextMenu : function(){
-			$(".contextMenu").hide();
-		},
-		onSearchLogClick : function(){
-			var value = this.ui.searchBox.val();
-			if(_.isEmpty(value)){
-				this.ui.searchBox.val("*:*");
-				value = "*:*";
-			}
-//			this.fetchGraphData({q : value});
-//			this.fetchTableData(value);
-			this.vent.trigger("main:search",{q:value});
-		},
-		//Style 2
-		renderGraph : function(){
-			var root = {
-					name : "",
-					dataList : this.graphModel.get("graphData")
-			};
-			var margin = 20,
-		    diameter = 880;//this.ui.graph.width();//960;
-			this.ui.graph.empty();
-//		var color = d3.scale.linear()
-//		    .domain([-1, 5])
-//		    .range(["hsl(152,90%,90%)", "hsl(228,30%,40%)"])
-//		    .interpolate(d3.interpolateHcl);
-		var color = d3.scale.ordinal()
-		    .domain([0,1])
-		    //.range(["#ECFCBD","#ECFCBD","#ECE78F","#f4f4c8"]);
-			.range(["#dddddd","#cccccc","#F5F5F5"]);
-		var pack = d3.layout.pack()
-		    .padding(2)
-		    .size([diameter - margin, diameter - margin])
-		    .value(function(d) {
-		    	return d.count; })
-		    .children(function(d){
-		    	return d.dataList;
-		    })
-
-		var svg = d3.select(this.ui.graph[0]).append("svg")
-		    .attr("width", diameter)
-		    .attr("height", diameter)
-		  .append("g")
-		    .attr("transform", "translate(" + diameter / 2 + "," + diameter / 2 + ")");
-
-		//d3.json("flare.json", function(error, root) {
-
-		  var focus = root,
-		      nodes = pack.nodes(root),
-		      view;
-		  /*
-		   * Tip
-		   */
-		  var tipCirclePack = tip()
-	          .attr('class', 'd3-tip')
-	          .offset([-10, 0])
-	          .html(function(d) {
-	        	  var tempName = "<div>";
-	              if(d.parent){
-	            	  if(d.depth > 1)
-	            		  tempName += d.parent.name+" => ";
-	            	  tempName += d.name;
-	              }
-	              return tempName + "</div>";
-	          })
+        },
+        onRender : function(){
+            this.renderTroubleShootTab();
+            this.renderHierarchyTab();
+            this.renderAuditTab();
+            this.togglePanelPosition(true);
+            this.bindTabCheckboxClick();
+            this.bindTabClickListener();
+            this.tabScrollBind();
+        },
+        onShow : function(){
+            //navigating to specific component tab
+            var params = ViewUtils.getDefaultParams();
+            if(params.host_name && params.component_name){
+                this.globalVent.trigger("render:tab",{
+                    params:_.extend({},{
+                        host_name :  params.host_name,
+                        component_name : params.component_name
+                    },params),
+                    globalVent : this.globalVent
+                });
+            }
+        },
+        renderLogFileTab : function(view){
+            var that = this;
+            require(['views/tabs/LogFileView'], function(LogFileView){
+                var tabName = (view.params.host_name + view.params.component_name).replace(/\./g,"_");
+                if(_.isUndefined(that[tabName])){
+                    var region = {};
+                    region[tabName] = '#' + tabName;
+                    $('<div/>', {
+                        'id': tabName,
+                        'class': 'tab-pane',
+                        'role':"tabpanel"
+                    }).appendTo(that.$('.tab-content'));
+                    that.addRegions(region);
+                    var region = that.getRegion(tabName);
+                    region.show(new LogFileView(view));
+                    that.$(".nav.nav-tabs").append('<li data-id="'+tabName+'" role="presentation">'+
+                            '<a data-id="'+tabName+'" data-host="'+view.params.host_name+'" data-component="'+view.params.component_name+'" href="#'+tabName+'" aria-controls="profile" role="tab" data-toggle="tab" title="'+view.params.host_name.split(".")[0]+' >> '+view.params.component_name+' ">'+view.params.host_name.split(".")[0]+'<b> >> </b>'+view.params.component_name+'</a>'+
+    //                        '<span class="air air-top-right">'+
+                                '<button data-tab-id="'+tabName+'" class="btn-closeTab"><i class="fa fa-times-circle"></i></button>'+
+                                '<div class="compareClick" title="Compare"><i class="fa fa-square-o"></i></div>');
+    //                            '<i class="fa fa-times"></i>'+
+    //                            '</button></span></li>');
+                }else{
+                    if(that[tabName].currentView){
+                        _.extend(that[tabName].currentView.params,view.params);
+                        that[tabName].currentView.render();
+                    }
+                }
+                //$("html, body").animate({ scrollTop: 0 }, 500);
+                that.showTab(tabName);
+            });
+        },
+        renderComparisonTab:function(view){
+            var that = this;
+            require(['views/tabs/ComparisonLayoutView'], function(ComparisonLayoutView){
+                var tabName = "";
+                _.each(view.componetList,function(object){
+                    if(object.host_name && object.component_name){
+                        tabName += (object.host_name + object.component_name).replace(/\./g,"_");
+                    }
+                });
+                if(_.isUndefined(that[tabName])){
+                    var region = {};
+                    region[tabName] = '#' + tabName;
+                    $('<div/>', {
+                        'id': tabName,
+                        'class': 'tab-pane',
+                        'role':"tabpanel"
+                    }).appendTo(that.$('.tab-content'));
+                    that.addRegions(region);
+                    var region = that.getRegion(tabName);
+                    region.show(new ComparisonLayoutView(view));
+                    that.$(".nav.nav-tabs").append('<li data-id="'+tabName+'" role="presentation">'+
+                            '<a data-id="'+tabName+'"  href="#'+tabName+'" aria-controls="profile" role="tab" data-toggle="tab">Compare</a>'+
+    //                        '<span class="air air-top-right">'+
+                                '<button data-tab-id="'+tabName+'" class="btn-closeTab"><i class="fa fa-times-circle"></i></button>');
+    //                            '<i class="fa fa-times"></i>'+
+    //                            '</button></span></li>');
+                }else{
+                    if(that[tabName].currentView){
+                        _.extend(that[tabName].currentView.params,view.params);
+                        that[tabName].currentView.render();
+                    }
+                }
+                $("html, body").animate({ scrollTop: 0 }, 500);
+                that.showTab(tabName);
+            });
+
+        },
+        showTab : function(tabId){
+            this.$(".nav.nav-tabs li").removeClass("active");
+            this.$("li[data-id='"+tabId+"']").addClass("active");
+            this.$(".tab-pane").removeClass("active");
+            this.$("#"+tabId).addClass("active");
+            this.tabOpen = true;
+            this.reAdjustTab();
+        },
+        onDeleteTabClick : function(e){
+            var tabId = $(e.currentTarget).data("tab-id");
+            if(this[tabId]){
+                this[tabId].close && this[tabId].close();
+                this.removeRegion(tabId);
+                this.$("li[data-id="+tabId+"]").remove();
+                this.$("#"+tabId).remove();
+                this.showTab(this.$(".nav.nav-tabs li").last().data("id"));
+            }
+        },
+        bindDraggableEvent : function(){
+            Utils.bindDraggableEvent(this.$( "div.box").not('.no-drop'));
+        },
+        renderLogLevel : function(){
+            var that = this;
+            require(['views/dashboard/LogLevelView'], function(LogLevelView){
+                 that.RLogLevel.show(new LogLevelView({
+                    vent : that.vent,
+                    globalVent:that.globalVent
+                }));
+            })
+
+        },
+        renderComponents : function(){
+            var that = this;
+            require(['views/dashboard/ComponentsView'], function(ComponentsView){
+                that.RComponents.show(new ComponentsView({
+                    vent : that.vent,
+                    globalVent:that.globalVent
+                }));
+            })
+        },
+        renderHosts : function(){
+            var that = this;
+            require(['views/dashboard/HostsView'], function(HostsView){
+                that.RHosts.show(new HostsView({
+                    vent : that.vent,
+                    globalVent:that.globalVent
+                }));
+            });
+        },
+        renderBubbleTableView : function(){
+            var that = this;
+            require(['views/dashboard/BubbleGraphTableLayoutView'], function(BubbleTableLayoutView){
+                that.RBubbleTable.show(new BubbleTableLayoutView({
+                    vent : that.vent,
+                    globalVent:that.globalVent
+                }));
+            });
+        },
+        renderTroubleShootTab:function(){
+            var that = this;
+            require(['views/troubleshoot/TroubleShootLayoutView'], function(TroubleShootLayoutView){
+
+                that.RTroubleShoot.show(new TroubleShootLayoutView({
+                    globalVent:that.globalVent
+                }));
+            });
+        },
+        renderHierarchyTab : function(){
+            var that = this;
+            require(['views/tabs/HierarchyTabLayoutView'], function(HierarchyTabLayoutView){
+                that.RHierarchyTab.show(new HierarchyTabLayoutView({
+                    globalVent:that.globalVent
+                }));
+            });
+        },
+        renderHostInfoTab : function(){
+            var that = this;
+            require(['views/tabs/HostInfoTabLayoutView'], function(HostInfoTabLayoutView){
+                that.RHostInfoTab.show(new HostInfoTabLayoutView({
+                    globalVent:that.globalVent
+                }));
+            });
+        },
+        renderAuditTab : function(){
+            var that = this;
+            require(['views/audit/AuditTabLayoutView'], function(AuditTabLayoutView){
+                that.RAuditTab.show(new AuditTabLayoutView({
+                    globalVent:that.globalVent
+                }));
+            });
+        },
+        hideContextMenu : function(){
+            $(".contextMenu").hide();
+        },
+        onSearchLogClick : function(){
+            var value = this.ui.searchBox.val();
+            if(_.isEmpty(value)){
+                this.ui.searchBox.val("*:*");
+                value = "*:*";
+            }
+//            this.fetchGraphData({q : value});
+//            this.fetchTableData(value);
+            this.vent.trigger("main:search",{q:value});
+        },
+        //Style 2
+        renderGraph : function(){
+            var root = {
+                    name : "",
+                    dataList : this.graphModel.get("graphData")
+            };
+            var margin = 20,
+            diameter = 880;//this.ui.graph.width();//960;
+            this.ui.graph.empty();
+//        var color = d3.scale.linear()
+//            .domain([-1, 5])
+//            .range(["hsl(152,90%,90%)", "hsl(228,30%,40%)"])
+//            .interpolate(d3.interpolateHcl);
+        var color = d3.scale.ordinal()
+            .domain([0,1])
+            //.range(["#ECFCBD","#ECFCBD","#ECE78F","#f4f4c8"]);
+            .range(["#dddddd","#cccccc","#F5F5F5"]);
+        var pack = d3.layout.pack()
+            .padding(2)
+            .size([diameter - margin, diameter - margin])
+            .value(function(d) {
+                return d.count; })
+            .children(function(d){
+                return d.dataList;
+            })
+
+        var svg = d3.select(this.ui.graph[0]).append("svg")
+            .attr("width", diameter)
+            .attr("height", diameter)
+          .append("g")
+            .attr("transform", "translate(" + diameter / 2 + "," + diameter / 2 + ")");
+
+        //d3.json("flare.json", function(error, root) {
+
+          var focus = root,
+              nodes = pack.nodes(root),
+              view;
+          /*
+           * Tip
+           */
+          var tipCirclePack = tip()
+              .attr('class', 'd3-tip')
+              .offset([-10, 0])
+              .html(function(d) {
+                  var tempName = "<div>";
+                  if(d.parent){
+                      if(d.depth > 1)
+                          tempName += d.parent.name+" => ";
+                      tempName += d.name;
+                  }
+                  return tempName + "</div>";
+              })
           svg.call(tipCirclePack);
-		  var circle = svg.selectAll("circle")
-		      .data(nodes)
-		    .enter().append("circle")
-		      .attr("class", function(d) {
-		    	  return d.parent ? d.children ? "node" : "node node--leaf "+d.name : "node node--root"; })
-		      .style("fill", function(d) {
-		    	  return d.children ? color(d.depth) : null; })
-		      .on("click", function(d) {
-		    	  if(d3.event.shiftKey){
-		    		  alert("open in new tab")
-		    	  }else{
-		    		  if (focus !== d) zoom(d), d3.event.stopPropagation();
-		    	  }
-
-		      })
-		      .on('mouseover', function (d,i) {
+          var circle = svg.selectAll("circle")
+              .data(nodes)
+            .enter().append("circle")
+              .attr("class", function(d) {
+                  return d.parent ? d.children ? "node" : "node node--leaf "+d.name : "node node--root"; })
+              .style("fill", function(d) {
+                  return d.children ? color(d.depth) : null; })
+              .on("click", function(d) {
+                  if(d3.event.shiftKey){
+                      alert("open in new tab")
+                  }else{
+                      if (focus !== d) zoom(d), d3.event.stopPropagation();
+                  }
+
+              })
+              .on('mouseover', function (d,i) {
                     if (d.x) {
                         tipCirclePack.show(d);
                     }
@@ -397,283 +388,283 @@ define(['require',
                     }
                 });
 
-		  var text = svg.selectAll("text")
-		      .data(nodes)
-		    .enter().append("text")
-		      .attr("class", "label")
-		      .style("fill-opacity", function(d) { return d.parent === root ? 1 : 0; })
-		      .style("display", function(d) { return d.parent === root ? null : "none"; })
-		      .text(function(d) {
-		    	  if(d.count){
-		    		  if(d.count > 0)
-		    			  return d.name;
-		    		  else
-		    			  return "";
-		    	  }else
-		    		  return d.name;
-
-		      });
-
-		  var node = svg.selectAll("circle,text");
-
-		  d3.select(this.ui.graph[0])
-		      .style("background", color(-1))
-		      .on("click", function() { zoom(root); });
-
-		  zoomTo([root.x, root.y, root.r * 2 + margin]);
-		  function zoom(d) {
-		    var focus0 = focus; focus = d;
-
-		    var transition = d3.transition()
-		        .duration(d3.event.altKey ? 7500 : 750)
-		        .tween("zoom", function(d) {
-		          var i = d3.interpolateZoom(view, [focus.x, focus.y, focus.r * 2 + margin]);
-		          return function(t) { zoomTo(i(t)); };
-		        });
-
-		    transition.selectAll("text")
-		      .filter(function(d) { return d.parent === focus || this.style.display === "inline"; })
-		        .style("fill-opacity", function(d) { return d.parent === focus ? 1 : 0; })
-		        .each("start", function(d) { if (d.parent === focus) this.style.display = "inline"; })
-		        .each("end", function(d) { if (d.parent !== focus) this.style.display = "none"; });
-		  }
-
-		  function zoomTo(v) {
-		    var k = diameter / v[2]; view = v;
-		    node.attr("transform", function(d) { return "translate(" + (d.x - v[0]) * k + "," + (d.y - v[1]) * k + ")"; });
-		    circle.attr("r", function(d) { return d.r * k; });
-		  }
-		},
-		bindTabCheckboxClick:function(){
-			var that = this;
-			this.$('div[role="tabpanel"] ul').on('click','li div.compareClick',function(){
-				that.tabcheckBoxSelectDeselect($(this))
-			})
-		},
-		tabcheckBoxSelectDeselect:function(el,fromEvent){
-			var that = this,
-		    clickedId = this.$('div[role="tabpanel"] ul').find(el).parents('li').data('id');
-			if (el.find('i').hasClass('fa-square-o')) {
-				var idList = _.pluck(this.componetList, 'id');
-			    if (! _.contains(idList, clickedId)) {
-			    	if(this.componetList.length >= 4){
-			    		Utils.alertPopup({
-			    			msg: "Currently only four components comparison supported."
-			    		});
-			    		return;
-			    	}else{
-			    		el.find('i').removeClass('fa-square-o').addClass('fa-check-square-o');
-			    		this.quickMenuCompare = false;
-			    		this.onCompareLink(el);
-			    	}
-			    }else{
-			    	el.find('i').removeClass('fa-square-o').addClass('fa-check-square-o');
-			    }
-			} else {
-			    el.find('i').removeClass('fa-check-square-o').addClass('fa-square-o');
-			    if (!fromEvent) {
-			        this.onCloseCompareComponentClick(el.parents('li').find('a').data().id)
-			    }
-			}
-		},
-		onCompareLink:function($el){
-			this.togglePanelPosition(false, true);
-			var clickedId = "",
-			    newValue = true,
-			    dataValue;
-			if (this.quickMenuCompare) {
-			    dataValue = $el.data();
-			    if(dataValue.host){
-			    	dataValue.id = dataValue.host.replace(/\./g, '_') + dataValue.node;
-			    }
-			} else {
-			    dataValue = $el.parents('li').find('a').data();
-			}
-			if (dataValue.id) {
-			    var clickedId = dataValue.id;
-			}
-			_.each(this.componetList, function(object) {
-			    if (object.id.match(clickedId)) {
-			        newValue = false;
-			    }
-			});
-			if (this.componetList.length >= 4) {
-			    if (newValue) {
-			        Utils.alertPopup({
-			            msg: "Currently only four components comparison supported."
-			        });
-			        return;
-			    }
-			}
-			if (this.componetList.length <= 3 && newValue) {
-			    if (dataValue.host && (dataValue.component || dataValue.node)) {
-			        var host = dataValue.host;
-			        var component = dataValue.component || dataValue.node;
-			        var spanLength = this.$('.compare .panel-body span.hasNode');
-			        if (spanLength.length != 0 && spanLength.length >= 1) {
-			            this.componetList.push({ 'host_name': host, 'component_name': component, id: clickedId });
-			            this.$('.compare .panel-body .hostCompList').append('<span class="hasNode" data-id="' + clickedId + '"><i class=" closeComponent fa fa-times-circle"></i>' + host.split(".")[0] + ' <i class="fa fa-angle-double-right"></i><br> ' + component + '</span>');
-			        } else {
-			            this.componetList.push({ 'host_name': host, 'component_name': component, id: clickedId });
-			            this.$('.compare .panel-body .hostCompList').html('<span class="hasNode" data-id="' + clickedId + '"><i class=" closeComponent fa fa-times-circle"></i>' + host.split(".")[0] + ' <i class="fa fa-angle-double-right"></i><br> ' + component + '</span>');
-			        }
-			    }
-			}
-			this.quickMenuCompare = false;
-		},
-		onCompareButtonClick:function(){
-			if(this.componetList.length == 1){
-				Utils.alertPopup({
+          var text = svg.selectAll("text")
+              .data(nodes)
+            .enter().append("text")
+              .attr("class", "label")
+              .style("fill-opacity", function(d) { return d.parent === root ? 1 : 0; })
+              .style("display", function(d) { return d.parent === root ? null : "none"; })
+              .text(function(d) {
+                  if(d.count){
+                      if(d.count > 0)
+                          return d.name;
+                      else
+                          return "";
+                  }else
+                      return d.name;
+
+              });
+
+          var node = svg.selectAll("circle,text");
+
+          d3.select(this.ui.graph[0])
+              .style("background", color(-1))
+              .on("click", function() { zoom(root); });
+
+          zoomTo([root.x, root.y, root.r * 2 + margin]);
+          function zoom(d) {
+            var focus0 = focus; focus = d;
+
+            var transition = d3.transition()
+                .duration(d3.event.altKey ? 7500 : 750)
+                .tween("zoom", function(d) {
+                  var i = d3.interpolateZoom(view, [focus.x, focus.y, focus.r * 2 + margin]);
+                  return function(t) { zoomTo(i(t)); };
+                });
+
+            transition.selectAll("text")
+              .filter(function(d) { return d.parent === focus || this.style.display === "inline"; })
+                .style("fill-opacity", function(d) { return d.parent === focus ? 1 : 0; })
+                .each("start", function(d) { if (d.parent === focus) this.style.display = "inline"; })
+                .each("end", function(d) { if (d.parent !== focus) this.style.display = "none"; });
+          }
+
+          function zoomTo(v) {
+            var k = diameter / v[2]; view = v;
+            node.attr("transform", function(d) { return "translate(" + (d.x - v[0]) * k + "," + (d.y - v[1]) * k + ")"; });
+            circle.attr("r", function(d) { return d.r * k; });
+          }
+        },
+        bindTabCheckboxClick:function(){
+            var that = this;
+            this.$('div[role="tabpanel"] ul').on('click','li div.compareClick',function(){
+                that.tabcheckBoxSelectDeselect($(this))
+            })
+        },
+        tabcheckBoxSelectDeselect:function(el,fromEvent){
+            var that = this,
+            clickedId = this.$('div[role="tabpanel"] ul').find(el).parents('li').data('id');
+            if (el.find('i').hasClass('fa-square-o')) {
+                var idList = _.pluck(this.componetList, 'id');
+                if (! _.contains(idList, clickedId)) {
+                    if(this.componetList.length >= 4){
+                        Utils.alertPopup({
+                            msg: "Currently only four components comparison supported."
+                        });
+                        return;
+                    }else{
+                        el.find('i').removeClass('fa-square-o').addClass('fa-check-square-o');
+                        this.quickMenuCompare = false;
+                        this.onCompareLink(el);
+                    }
+                }else{
+                    el.find('i').removeClass('fa-square-o').addClass('fa-check-square-o');
+                }
+            } else {
+                el.find('i').removeClass('fa-check-square-o').addClass('fa-square-o');
+                if (!fromEvent) {
+                    this.onCloseCompareComponentClick(el.parents('li').find('a').data().id)
+                }
+            }
+        },
+        onCompareLink:function($el){
+            this.togglePanelPosition(false, true);
+            var clickedId = "",
+                newValue = true,
+                dataValue;
+            if (this.quickMenuCompare) {
+                dataValue = $el.data();
+                if(dataValue.host){
+                    dataValue.id = dataValue.host.replace(/\./g, '_') + dataValue.node;
+                }
+            } else {
+                dataValue = $el.parents('li').find('a').data();
+            }
+            if (dataValue.id) {
+                var clickedId = dataValue.id;
+            }
+            _.each(this.componetList, function(object) {
+                if (object.id.match(clickedId)) {
+                    newValue = false;
+                }
+            });
+            if (this.componetList.length >= 4) {
+                if (newValue) {
+                    Utils.alertPopup({
+                        msg: "Currently only four components comparison supported."
+                    });
+                    return;
+                }
+            }
+            if (this.componetList.length <= 3 && newValue) {
+                if (dataValue.host && (dataValue.component || dataValue.node)) {
+                    var host = dataValue.host;
+                    var component = dataValue.component || dataValue.node;
+                    var spanLength = this.$('.compare .panel-body span.hasNode');
+                    if (spanLength.length != 0 && spanLength.length >= 1) {
+                        this.componetList.push({ 'host_name': host, 'component_name': component, id: clickedId });
+                        this.$('.compare .panel-body .hostCompList').append('<span class="hasNode" data-id="' + clickedId + '"><i class=" closeComponent fa fa-times-circle"></i>' + host.split(".")[0] + ' <i class="fa fa-angle-double-right"></i><br> ' + component + '</span>');
+                    } else {
+                        this.componetList.push({ 'host_name': host, 'component_name': component, id: clickedId });
+                        this.$('.compare .panel-body .hostCompList').html('<span class="hasNode" data-id="' + clickedId + '"><i class=" closeComponent fa fa-times-circle"></i>' + host.split(".")[0] + ' <i class="fa fa-angle-double-right"></i><br> ' + component + '</span>');
+                    }
+                }
+            }
+            this.quickMenuCompare = false;
+        },
+        onCompareButtonClick:function(){
+            if(this.componetList.length == 1){
+                Utils.alertPopup({
                         msg: "Minimum two components are required for comparison. Please select one more component and try again."
                 });
-			}else{
-				var dateRangeLabel ='Last 1 Hour';
-				var dateObj = this.dateUtil.getRelativeDateFromString(dateRangeLabel);
-
-				if (this.RHierarchyTab.currentView && this.RHierarchyTab.currentView.defaultParams) {
-				    var dateParams = this.RHierarchyTab.currentView.defaultParams;
-				    if (!_.isUndefined(dateParams) && _.isObject(dateParams)) {
-				        dateObj = {
-				            from: dateParams.from,
-				            to: dateParams.to,
-				            dateRangeLabel: dateParams.dateRangeLabel
-				        };
-				    }
-				}
-
-				this.globalVent.trigger("render:comparison:tab",{
-					params: dateObj,
-					componetList:this.componetList,
-					globalVent : this.globalVent
-				});
-			}
-			this.togglePanelPosition(false,false)
-		},
-		togglePanelPosition:function(hideFully,clickFromLi){
-			if(hideFully){
-				this.$('.compare').css('bottom', "-136px");
-				this.$('.compare .panel-heading').addClass("down");
-				return;
-			}
-			if (this.$('.compare .panel-heading').hasClass('down')) {
-			    this.$('.compare').css('bottom', "0px");
-			    this.$('.compare .panel-heading').removeClass("down")
-			        /*   setTimeout(function() {
-			               this.$('.compare').css('bottom', (-(this.$('.compare .panel-body').height() + 39)) + "px");
-			               this.$('.compare .panel-heading').addClass("down");;
-			           }, 2000);*/
-			} else if (!clickFromLi) {
-			    this.$('.compare').css('bottom', (-(this.$('.compare .panel-body').height() + 32)) + "px");
-			    this.$('.compare .panel-heading').addClass("down");
-			}
-		},
-		onCompareClearAllClick:function(e){
-			e.stopPropagation();
-			this.componetList =[];
-			this.$('.compare .panel-body .hostCompList').html('');
-			this.$('div[role="tabpanel"] ul').find('li div.compareClick i').removeClass('fa-check-square-o').addClass('fa-square-o');
-			this.togglePanelPosition(true)
-		},
-		onCloseCompareComponentClick:function(id,fromEvent){
-			var clickedId = id,that = this;
-			if (clickedId) {
-			    var clickedIndex = undefined;
-			    _.each(this.componetList, function(object, i) {
-			        if (object.id.match(clickedId)) {
-			            that.$('.compare .panel-body .hostCompList').find('span[data-id="'+id+'"]').remove();
-			            clickedIndex = i + 1;
-			        }
-			    });
-			    if (clickedIndex) {
-			        this.componetList.splice(clickedIndex - 1, 1);
-			        if(this.componetList.length == 0){
-			        	this.togglePanelPosition(true);
-			        }else{
-			        	this.togglePanelPosition(false,true);
-			        }
-			    }
-			    if(fromEvent){
-					this.tabcheckBoxSelectDeselect(this.$('div[role="tabpanel"] ul').find('li[data-id="'+clickedId+'"] div.compareClick'),true)
-				}
-			}
-		},
-		bindTabClickListener:function(){
-			var that = this;
-			this.$("ul[role='tablist']").on('click','li',function(){
-				that.globalVent.trigger("tab:click",this);
-			});
-		},
-		tabScrollBind:function(){
-			var hidWidth;
-			var scrollBarWidths = 40;
-			var that = this;
-
-			var widthOfList = function(){
-			  var itemsWidth = 0;
-			  that.$('.list li').each(function(){
-			    var itemWidth = $(this).outerWidth();
-			    itemsWidth+=itemWidth;
-			  });
-			  return itemsWidth;
-			};
-
-			var widthOfHidden = function(){
-			  return (($('.wrapper').outerWidth())-widthOfList()-getLeftPosi())-scrollBarWidths;
-			};
-
-			var getLeftPosi = function(){
-			  return that.$('.list').position().left;
-			};
-
-			this.reAdjustTab = function(){
-			  if ((that.$('.wrapper').outerWidth()) < widthOfList()) {
-			  	if(that.tabOpen){
-			  		that.$('.list').animate({left:"+="+widthOfHidden()+"px"},'slow');
-			  		that.tabOpen = false;
-			  	}
-			    that.$('.scroller-right').show();
-			  }
-			  else {
-			    that.$('.scroller-right').hide();
-			  }
-
-			  if (getLeftPosi()<0) {
-			    that.$('.scroller-left').show();
-			  }
-			  else {
-			    that.$('.item').animate({left:"-="+(-200)+"px"},'slow');
-			  	that.$('.scroller-left').hide();
-			  }
-			}
-
-
-			this.$('.scroller-right').click(function(e) {
-
-			 /* that.$('.scroller-left').fadeIn('slow');
-			  that.$('.scroller-right').fadeOut('slow');*/
-			  //console.log(widthOfHidden())
-			  if(widthOfHidden()+55 < 0){
-			  	 that.$('.list').animate({left:"+="+(-43)+"px"},0,function(){
-			  		that.reAdjustTab();
-			 	 });
-			  }
-
-			});
-
-			this.$('.scroller-left').click(function() {
-
-				/*that.$('.scroller-right').fadeIn('slow');
-				that.$('.scroller-left').fadeOut('slow');*/
-			  	//console.log(getLeftPosi())
-			  	if(getLeftPosi() < 0){
-			  		that.$('.list').animate({left:"-="+(-40)+"px"},0,function(){
-			  		that.reAdjustTab();
-			  	});
-			  	}
-
-			});
-		},
-	});
-	return MainLayoutView;
+            }else{
+                var dateRangeLabel ='Last 1 Hour';
+                var dateObj = this.dateUtil.getRelativeDateFromString(dateRangeLabel);
+
+                if (this.RHierarchyTab.currentView && this.RHierarchyTab.currentView.defaultParams) {
+                    var dateParams = this.RHierarchyTab.currentView.defaultParams;
+                    if (!_.isUndefined(dateParams) && _.isObject(dateParams)) {
+                        dateObj = {
+                            from: dateParams.from,
+                            to: dateParams.to,
+                            dateRangeLabel: dateParams.dateRangeLabel
+                        };
+                    }
+                }
+
+                this.globalVent.trigger("render:comparison:tab",{
+                    params: dateObj,
+                    componetList:this.componetList,
+                    globalVent : this.globalVent
+                });
+            }
+            this.togglePanelPosition(false,false)
+        },
+        togglePanelPosition:function(hideFully,clickFromLi){
+            if(hideFully){
+                this.$('.compare').css('bottom', "-136px");
+                this.$('.compare .panel-heading').addClass("down");
+                return;
+            }
+            if (this.$('.compare .panel-heading').hasClass('down')) {
+                this.$('.compare').css('bottom', "0px");
+                this.$('.compare .panel-heading').removeClass("down")
+                    /*   setTimeout(function() {
+                           this.$('.compare').css('bottom', (-(this.$('.compare .panel-body').height() + 39)) + "px");
+                           this.$('.compare .panel-heading').addClass("down");;
+                       }, 2000);*/
+            } else if (!clickFromLi) {
+                this.$('.compare').css('bottom', (-(this.$('.compare .panel-body').height() + 32)) + "px");
+                this.$('.compare .panel-heading').addClass("down");
+            }
+        },
+        onCompareClearAllClick:function(e){
+            e.stopPropagation();
+            this.componetList =[];
+            this.$('.compare .panel-body .hostCompList').html('');
+            this.$('div[role="tabpanel"] ul').find('li div.compareClick i').removeClass('fa-check-square-o').addClass('fa-square-o');
+            this.togglePanelPosition(true)
+        },
+        onCloseCompareComponentClick:function(id,fromEvent){
+            var clickedId = id,that = this;
+            if (clickedId) {
+                var clickedIndex = undefined;
+                _.each(this.componetList, function(object, i) {
+                    if (object.id.match(clickedId)) {
+                        that.$('.compare .panel-body .hostCompList').find('span[data-id="'+id+'"]').remove();
+                        clickedIndex = i + 1;
+                    }
+                });
+                if (clickedIndex) {
+                    this.componetList.splice(clickedIndex - 1, 1);
+                    if(this.componetList.length == 0){
+                        this.togglePanelPosition(true);
+                    }else{
+                        this.togglePanelPosition(false,true);
+                    }
+                }
+                if(fromEvent){
+                    this.tabcheckBoxSelectDeselect(this.$('div[role="tabpanel"] ul').find('li[data-id="'+clickedId+'"] div.compareClick'),true)
+                }
+            }
+        },
+        bindTabClickListener:function(){
+            var that = this;
+            this.$("ul[role='tablist']").on('click','li',function(){
+                that.globalVent.trigger("tab:click",this);
+            });
+        },
+        tabScrollBind:function(){
+            var hidWidth;
+            var scrollBarWidths = 40;
+            var that = this;
+
+            var widthOfList = function(){
+              var itemsWidth = 0;
+              that.$('.list li').each(function(){
+                var itemWidth = $(this).outerWidth();
+                itemsWidth+=itemWidth;
+              });
+              return itemsWidth;
+            };
+
+            var widthOfHidden = function(){
+              return (($('.wrapper').outerWidth())-widthOfList()-getLeftPosi())-scrollBarWidths;
+            };
+
+            var getLeftPosi = function(){
+              return that.$('.list').position().left;
+            };
+
+            this.reAdjustTab = function(){
+              if ((that.$('.wrapper').outerWidth()) < widthOfList()) {
+                  if(that.tabOpen){
+                      that.$('.list').animate({left:"+="+widthOfHidden()+"px"},'slow');
+                      that.tabOpen = false;
+                  }
+                that.$('.scroller-right').show();
+              }
+              else {
+                that.$('.scroller-right').hide();
+              }
+
+              if (getLeftPosi()<0) {
+                that.$('.scroller-left').show();
+              }
+              else {
+                that.$('.item').animate({left:"-="+(-200)+"px"},'slow');
+                  that.$('.scroller-left').hide();
+              }
+            }
+
+
+            this.$('.scroller-right').click(function(e) {
+
+             /* that.$('.scroller-left').fadeIn('slow');
+              that.$('.scroller-right').fadeOut('slow');*/
+              //console.log(widthOfHidden())
+              if(widthOfHidden()+55 < 0){
+                   that.$('.list').animate({left:"+="+(-43)+"px"},0,function(){
+                      that.reAdjustTab();
+                  });
+              }
+
+            });
+
+            this.$('.scroller-left').click(function() {
+
+                /*that.$('.scroller-right').fadeIn('slow');
+                that.$('.scroller-left').fadeOut('slow');*/
+                  //console.log(getLeftPosi())
+                  if(getLeftPosi() < 0){
+                      that.$('.list').animate({left:"-="+(-40)+"px"},0,function(){
+                      that.reAdjustTab();
+                  });
+                  }
+
+            });
+        },
+    });
+    return MainLayoutView;
 
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dialog/ApplySearchFilterView.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dialog/ApplySearchFilterView.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dialog/ApplySearchFilterView.js
index 16a37ad..62b74c8 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dialog/ApplySearchFilterView.js
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dialog/ApplySearchFilterView.js
@@ -75,7 +75,6 @@ define(['require',
 
                 var that = this;
                 $.extend(this.collection.queryParams, {
-                    userId: "admin",
                     rowType:"history"
                 });
                 this.collection.getFirstPage({
@@ -142,31 +141,32 @@ define(['require',
             },
             showParams: function(params, id) {
                
-                return '<pre class="applyFilter"><button class="btn btn-primary btn-app-sm pull-right" data-nameId="' + id + '" data-id="applyFilter">' +
-                    '<i class="fa fa-check"></i></button> <button style="display:none"class="btn btn-primary btn-app-sm pull-right" data-nameId="' + id + '" data-id="deleteFilter">' +
-                     '<i class="fa fa-times"></i></button><strong>Range:</strong>' + (this.createInnerSpan(params, "from")) +
-                    '<strong>&nbsp:To:&nbsp:</strong>' + (this.createInnerSpan(params, "to")) +
-                    '<br><strong>Level:</strong>' + (this.createInnerSpan(params, "level")) +
-                    '<br><strong>Include Components:</strong>' + (this.createInnerSpan(params, "mustBe")) +
-                    '<br><strong>Exclude Components:</strong>' + (this.createInnerSpan(params, "mustNot")) +
-                    '<br><strong>Include Columns:</strong>' + (this.createInnerSpan(params, "includeQuery")) +
-                    '<br><strong>Exclude Columns:</strong>' + (this.createInnerSpan(params, "excludeQuery")) + '</pre>';
-                
+                return '<pre class="applyFilter">' +
+                       '<button class="btn btn-primary btn-app-sm pull-right" data-nameId="' + id + '" data-id="applyFilter"><i class="fa fa-check"></i></button>' +
+                       '<button class="btn btn-primary btn-app-sm pull-right" data-nameId="' + id + '" data-id="deleteFilter"><i class="fa fa-times"></i></button>' +
+                       '<strong>Range:</strong>' + (this.createInnerSpan(params, "from")) + '<strong>&nbsp:To:&nbsp:</strong>' + (this.createInnerSpan(params, "to")) + '<br>' +
+                       '<strong>Level:</strong>' + (this.createInnerSpan(params, "level")) + '<br>' +
+                       '<strong>Include Components:</strong>' + (this.createInnerSpan(params, "mustBe")) + '<br>' +
+                       '<strong>Exclude Components:</strong>' + (this.createInnerSpan(params, "mustNot")) + '<br>' +
+                       '<strong>Include Columns:</strong>' + (this.createInnerSpan(params, "includeQuery")) + '<br>' +
+                       '<strong>Exclude Columns:</strong>' + (this.createInnerSpan(params, "excludeQuery")) +
+                       '</pre>';
+
             },
             createInnerSpan: function(params, type) {
                 var typeString = "",
                     that = this;
                 if (params[type]) {
-                	if(type == "includeQuery" || type == "excludeQuery"){
-                		typeString += "<span>"+params[type].replace("},{",",").replace("[{","").replace("}]","")+"</span>";
-                	}else{
-                		Utils.encodeIncludeExcludeStr(params[type], false, ((type == "iMessage" || type == "eMessage") ? ("|i::e|") : (","))).map(function(typeName) {
+                    if(type == "includeQuery" || type == "excludeQuery"){
+                        typeString += "<span>"+params[type].replace("},{",",").replace("[{","").replace("}]","")+"</span>";
+                    }else{
+                        Utils.encodeIncludeExcludeStr(params[type], false, ((type == "iMessage" || type == "eMessage") ? ("|i::e|") : (","))).map(function(typeName) {
                             typeString += '<span class="' + ((type != "level") ? (type) : (typeName)) + '">' +
                                 ((type == "from" || type == "to") ? (that.dateUtil.getTimeZone(params[type])) : (Utils.escapeHtmlChar(typeName))) + '</span>' +
                                 ((type == "level") ? (",") : (""));
                         });
-                	}
-                    
+                    }
+
                 }
                 return ((typeString.length == 0) ? ("-") : ((type == "level") ? ((typeString).slice(0, -1)) : (typeString)))
             },
@@ -178,11 +178,8 @@ define(['require',
             },
             onDeleteClick: function(e) {
                 var that = this;
-                var deleteModel = this.collection.findWhere({
-                    id: parseInt($(arguments[0].currentTarget).attr('data-nameId'))
-                });
                 var postObject = {
-                    id: deleteModel.get('id')
+                    id: parseInt($(arguments[0].currentTarget).attr('data-nameId'))
                 }
                 this.collection.deleteEventHistory(postObject, {
                     success: function(data, textStatus, jqXHR) {
@@ -202,7 +199,7 @@ define(['require',
             onSearchFilterClick: function() {
                 var filterName = this.$("[data-id='filterName']").val();
                 $.extend(this.collection.queryParams, {
-                	filterName: filterName
+                    filterName: filterName
                 });
                 this.fetchFilters();
             },

http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/EventHistoryLayoutView.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/EventHistoryLayoutView.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/EventHistoryLayoutView.js
index b30dd50..1eda79b 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/EventHistoryLayoutView.js
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/tabs/EventHistoryLayoutView.js
@@ -438,7 +438,6 @@ define(['require',
 
                 content.selectedCollectionObject.get("params")["time"] = timeType;
                 var postObject = {
-                    userName: "admin",
                     filtername: content.ui.filterName.val(),
                     rowType: "history",
                     values: JSON.stringify(content.selectedCollectionObject.get('params'))

http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/dashboard/DashboardLayoutView_tmpl.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/dashboard/DashboardLayoutView_tmpl.html b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/dashboard/DashboardLayoutView_tmpl.html
deleted file mode 100644
index e00896f..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/templates/dashboard/DashboardLayoutView_tmpl.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!-- 
-  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.
--->
-<div class="row dashboard">
-    <div class="pull-right">
-    	 <label class="btn"><input class="" data-id="enableHelp" value="true" checked type="checkbox">Enable Help</label>
-        <button class="btn" data-id="save">Save</button>
-      <!--   <button class="btn" data-id="load">Load</button> -->
-    </div>
-    <div class="col-md-12">
-    	<div class="loader" style="display:none"></div>
-        <div class="gridster">
-        </div>
-    </div>
-</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/UserConfigRequestQueryConverterTest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/UserConfigRequestQueryConverterTest.java b/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/UserConfigRequestQueryConverterTest.java
index 66c172a..a126df8 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/UserConfigRequestQueryConverterTest.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/UserConfigRequestQueryConverterTest.java
@@ -18,7 +18,9 @@
  */
 package org.apache.ambari.logsearch.converter;
 
+import org.apache.ambari.logsearch.common.LogSearchContext;
 import org.apache.ambari.logsearch.model.request.impl.UserConfigRequest;
+import org.apache.ambari.logsearch.web.model.User;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.junit.Before;
 import org.junit.Test;
@@ -39,8 +41,13 @@ public class UserConfigRequestQueryConverterTest extends AbstractRequestConverte
     // GIVEN
     UserConfigRequest request = new UserConfigRequest();
     request.setRowType("myRowType"); // TODO: validate these 3 fields @Valid on UserConfigRequest object -> not null
-    request.setUserId("myUserId");
     request.setFilterName("myFilterName");
+    
+    LogSearchContext context = new LogSearchContext();
+    User user = new User();
+    user.setUsername("myUserId");
+    context.setUser(user);
+    LogSearchContext.setContext(context);
     // WHEN
     SolrQuery queryResult = underTest.convert(request);
     // THEN


[40/51] [abbrv] ambari git commit: AMBARI-19881. Ambari Web UI is unusably irresponsive on a 1000-node perf cluster after adding AMS (restart indicator loading is too heavy). (atkach via yusaku)

Posted by rz...@apache.org.
AMBARI-19881. Ambari Web UI is unusably irresponsive on a 1000-node perf cluster after adding AMS (restart indicator loading is too heavy). (atkach via yusaku)

(cherry picked from commit c066fa889d76c2240d2ba9b86b35ea48021e266c)

Change-Id: If35ce39dbb154536f945c5954ca748eb9978a919


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 9dd0bda0d168b97957e1553d1da7080c7a7d1b35
Parents: fcd422c
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Mon Feb 6 13:36:32 2017 -0800
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 07:16:44 2017 -0800

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service.js      |  2 +-
 .../app/mappers/component_config_mapper.js      | 58 ++++----------------
 .../app/mappers/components_state_mapper.js      |  5 +-
 ambari-web/app/mappers/server_data_mapper.js    |  1 +
 ambari-web/app/models/client_component.js       |  1 +
 ambari-web/app/models/host_component.js         | 17 +++++-
 ambari-web/app/models/service.js                | 21 ++++---
 ambari-web/app/views/main/service/menu.js       |  4 +-
 .../test/controllers/main/service_test.js       | 31 +++--------
 ambari-web/test/models/service_test.js          | 27 +++++----
 10 files changed, 72 insertions(+), 95 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9dd0bda0/ambari-web/app/controllers/main/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service.js b/ambari-web/app/controllers/main/service.js
index 6e68ec5..e434d41 100644
--- a/ambari-web/app/controllers/main/service.js
+++ b/ambari-web/app/controllers/main/service.js
@@ -315,7 +315,7 @@ App.MainServiceController = Em.ArrayController.extend(App.SupportClientConfigsDo
       return App.showConfirmationPopup(function () {
             self.restartHostComponents();
           }, Em.I18n.t('services.service.refreshAll.confirmMsg').format(
-              App.HostComponent.find().filterProperty('staleConfigs').mapProperty('service.displayName').uniq().join(', ')),
+              App.Service.find().filterProperty('isRestartRequired').mapProperty('displayName').uniq().join(', ')),
           null,
           null,
           Em.I18n.t('services.service.restartAll.confirmButton')

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dd0bda0/ambari-web/app/mappers/component_config_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/component_config_mapper.js b/ambari-web/app/mappers/component_config_mapper.js
index 866f811..c1568e0 100644
--- a/ambari-web/app/mappers/component_config_mapper.js
+++ b/ambari-web/app/mappers/component_config_mapper.js
@@ -36,54 +36,20 @@ App.componentConfigMapper = App.QuickDataMapper.create({
   },
   map: function (json) {
     console.time('App.componentConfigMapper execution time');
-    var hostComponents = [];
-    var newHostComponentsMap = {};
-    var cacheServices = App.cache['services'];
-    var currentServiceComponentsMap = this.buildServiceComponentMap(cacheServices);
-    var mapConfig = this.get('config');
-    // We do not want to parse JSON if there is no need to
-    var hostComponentJsonMap = {};
-    var hostComponentJsonIds = [];
+    var staleConfigHostsMap = App.cache.staleConfigsComponentHosts;
 
-    if (json.items.length > 0 || this.get('model').find().someProperty('staleConfigs', true)) {
-      json.items.forEach(function (item) {
-        item.host_components.forEach(function (host_component) {
-          host_component.id = host_component.HostRoles.component_name + '_' + host_component.HostRoles.host_name;
-          hostComponentJsonIds.push(host_component.id);
-          hostComponentJsonMap[host_component.id] = host_component;
-        });
-      });
-      this.get('model').find().forEach(function (hostComponent) {
-        var id = hostComponent.get('id');
-        var hostComponentJson = hostComponentJsonMap[id];
-        var currentStaleConfigsState = Boolean(hostComponentJson);
-        var stateChanged = hostComponent.get('staleConfigs') !== currentStaleConfigsState;
-
-        if (stateChanged) {
-          hostComponent.set('staleConfigs', currentStaleConfigsState);
-        }
-        //delete loaded host-components, so only new ones left
-        delete hostComponentJsonMap[id];
-      });
-      hostComponentJsonIds.forEach(function (hcId) {
-        var newHostComponent = hostComponentJsonMap[hcId];
-        if (newHostComponent) {
-          var serviceName = newHostComponent.HostRoles.service_name;
-          hostComponents.push(this.parseIt(newHostComponent, mapConfig));
-          if (!newHostComponentsMap[serviceName]) {
-            newHostComponentsMap[serviceName] = [];
-          }
-          if (currentServiceComponentsMap[serviceName] && !currentServiceComponentsMap[serviceName][newHostComponent.id]) {
-            newHostComponentsMap[serviceName].push(newHostComponent.id);
-          }
-        }
-      }, this);
-      if (hostComponents.length > 0) {
-        App.store.commit();
-        App.store.loadMany(this.get('model'), hostComponents);
-        this.addNewHostComponents(newHostComponentsMap, cacheServices);
+    json.items.forEach(function(item) {
+      var componentName = item.ServiceComponentInfo.component_name;
+      var hosts = item.host_components.mapProperty('HostRoles.host_name') || [];
+      staleConfigHostsMap[componentName] = hosts;
+      if (App.HostComponent.isMaster(componentName)) {
+        App.MasterComponent.find(componentName).set('staleConfigHosts', hosts);
+      } else if (App.HostComponent.isSlave(componentName)) {
+        App.SlaveComponent.find(componentName).set('staleConfigHosts', hosts);
+      } else if (App.HostComponent.isClient(componentName)) {
+        App.ClientComponent.find(componentName).set('staleConfigHosts', hosts);
       }
-    }
+    });
     console.timeEnd('App.componentConfigMapper execution time');
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dd0bda0/ambari-web/app/mappers/components_state_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/components_state_mapper.js b/ambari-web/app/mappers/components_state_mapper.js
index b86aee5..89d5af2 100644
--- a/ambari-web/app/mappers/components_state_mapper.js
+++ b/ambari-web/app/mappers/components_state_mapper.js
@@ -36,7 +36,8 @@ App.componentsStateMapper = App.QuickDataMapper.create({
     unknown_count: 'ServiceComponentInfo.unknown_count',
     started_count: 'ServiceComponentInfo.started_count',
     total_count: 'ServiceComponentInfo.total_count',
-    host_names: 'host_names'
+    host_names: 'host_names',
+    stale_config_hosts: 'stale_config_hosts'
   },
 
   slaveModel: App.SlaveComponent,
@@ -171,6 +172,7 @@ App.componentsStateMapper = App.QuickDataMapper.create({
     var slaves = [];
     var masters = [];
     var hasNewComponents = false;
+    var staleConfigHostsMap = App.cache.staleConfigsComponentHosts;
 
     if (json.items) {
       if (!App.isEmptyObject(Em.getWithDefault(App, 'cache.services', {}))) {
@@ -184,6 +186,7 @@ App.componentsStateMapper = App.QuickDataMapper.create({
         var extendedModel = this.getExtendedModel(item.ServiceComponentInfo.service_name);
         var cacheService = App.cache['services'].findProperty('ServiceInfo.service_name', item.ServiceComponentInfo.service_name);
 
+        item.stale_config_hosts = staleConfigHostsMap[item.ServiceComponentInfo.component_name] || [];
         if (item.ServiceComponentInfo.category === 'CLIENT') {
           item.host_names = item.host_components.mapProperty('HostRoles.host_name');
           clients.push(this.parseIt(item, this.clientMap));

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dd0bda0/ambari-web/app/mappers/server_data_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/server_data_mapper.js b/ambari-web/app/mappers/server_data_mapper.js
index da25212..a99d8ae 100644
--- a/ambari-web/app/mappers/server_data_mapper.js
+++ b/ambari-web/app/mappers/server_data_mapper.js
@@ -26,6 +26,7 @@ App.cache = {
   'previousHostStatuses': {},
   'previousComponentStatuses': {},
   'previousComponentPassiveStates': {},
+  'staleConfigsComponentHosts': {},
   'services': [],
   'currentConfigVersions': {}
 };

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dd0bda0/ambari-web/app/models/client_component.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/client_component.js b/ambari-web/app/models/client_component.js
index 50a3bb6..b461b45 100644
--- a/ambari-web/app/models/client_component.js
+++ b/ambari-web/app/models/client_component.js
@@ -31,6 +31,7 @@ App.ClientComponent = DS.Model.extend({
   totalCount: DS.attr('number'),
   stackInfo: DS.belongsTo('App.StackServiceComponent'),
   hostNames: DS.attr('array'),
+  staleConfigHosts: DS.attr('array'),
 
   /**
    * Determines if component may be deleted

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dd0bda0/ambari-web/app/models/host_component.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/host_component.js b/ambari-web/app/models/host_component.js
index f31e926..b5b1bbb 100644
--- a/ambari-web/app/models/host_component.js
+++ b/ambari-web/app/models/host_component.js
@@ -51,7 +51,7 @@ App.HostComponent = DS.Model.extend({
    * @returns {bool}
    */
   isClient: function () {
-    return App.get('components.clients').contains(this.get('componentName'));
+    return App.HostComponent.isClient(this.get('componentName'));
   }.property('componentName'),
   /**
    * Determine if component is running now
@@ -73,7 +73,7 @@ App.HostComponent = DS.Model.extend({
    * @returns {bool}
    */
   isMaster: function () {
-    return App.get('components.masters').contains(this.get('componentName'));
+    return App.HostComponent.isMaster(this.get('componentName'));
   }.property('componentName', 'App.components.masters'),
 
   /**
@@ -81,7 +81,7 @@ App.HostComponent = DS.Model.extend({
    * @returns {bool}
    */
   isSlave: function () {
-    return App.get('components.slaves').contains(this.get('componentName'));
+    return App.HostComponent.isSlave(this.get('componentName'));
   }.property('componentName'),
   /**
    * Only certain components can be deleted.
@@ -164,6 +164,17 @@ App.HostComponent = DS.Model.extend({
 
 App.HostComponent.FIXTURES = [];
 
+App.HostComponent.isClient = function(componentName) {
+  return App.get('components.clients').contains(componentName);
+};
+
+App.HostComponent.isMaster = function(componentName) {
+  return App.get('components.masters').contains(componentName);
+};
+
+App.HostComponent.isSlave = function(componentName) {
+  return App.get('components.slaves').contains(componentName);
+};
 
 /**
  * get particular counter of host-component by name

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dd0bda0/ambari-web/app/models/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service.js b/ambari-web/app/models/service.js
index e9dc327..70ae917 100644
--- a/ambari-web/app/models/service.js
+++ b/ambari-web/app/models/service.js
@@ -108,18 +108,23 @@ App.Service = DS.Model.extend({
    * actual_configs, then a restart is required.
    */
   isRestartRequired: function () {
-    var rhc = this.get('hostComponents').filterProperty('staleConfigs', true);
+    var serviceComponents = this.get('clientComponents').toArray()
+      .concat(this.get('slaveComponents').toArray())
+      .concat(this.get('masterComponents').toArray());
     var hc = {};
 
-    rhc.forEach(function(_rhc) {
-      var hostName = _rhc.get('hostName');
-      if (!hc[hostName]) {
-        hc[hostName] = [];
-      }
-      hc[hostName].push(_rhc.get('displayName'));
+    serviceComponents.forEach(function(component) {
+      var displayName = component.get('displayName');
+      component.get('staleConfigHosts').forEach(function(hostName) {
+        if (!hc[hostName]) {
+          hc[hostName] = [];
+        }
+        hc[hostName].push(displayName);
+      });
     });
+
     this.set('restartRequiredHostsAndComponents', hc);
-    return (rhc.length > 0);
+    return (serviceComponents.filterProperty('staleConfigHosts.length').length > 0);
   }.property('serviceName'),
   
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dd0bda0/ambari-web/app/views/main/service/menu.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/menu.js b/ambari-web/app/views/main/service/menu.js
index 2c9ac5c..eeebc6e 100644
--- a/ambari-web/app/views/main/service/menu.js
+++ b/ambari-web/app/views/main/service/menu.js
@@ -63,7 +63,7 @@ App.MainServiceMenuView = Em.CollectionView.extend({
     templateName:require('templates/main/service/menu_item'),
     restartRequiredMessage: null,
 
-    shouldBeRestarted: Em.computed.someBy('content.hostComponents', 'staleConfigs', true),
+    shouldBeRestarted: Em.computed.equal('content.isRestartRequired'),
 
     active:function () {
       return this.get('content.id') == this.get('parentView.activeServiceId') ? 'active' : '';
@@ -164,7 +164,7 @@ App.TopNavServiceMenuView = Em.CollectionView.extend({
     templateName:require('templates/main/service/menu_item'),
     restartRequiredMessage: null,
 
-    shouldBeRestarted: Em.computed.someBy('content.hostComponents', 'staleConfigs', true),
+    shouldBeRestarted: Em.computed.equal('content.isRestartRequired'),
 
     active:function () {
       return this.get('content.id') == this.get('parentView.activeServiceId') ? 'active' : '';

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dd0bda0/ambari-web/test/controllers/main/service_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service_test.js b/ambari-web/test/controllers/main/service_test.js
index 0421a43..d8c3365 100644
--- a/ambari-web/test/controllers/main/service_test.js
+++ b/ambari-web/test/controllers/main/service_test.js
@@ -389,41 +389,26 @@ describe('App.MainServiceController', function () {
     beforeEach(function () {
       sinon.spy(App, 'showConfirmationPopup');
       sinon.spy(mainServiceController, 'restartHostComponents');
-      sinon.stub(App.HostComponent, 'find', function() {
+      sinon.stub(App.Service, 'find', function() {
         return [
           Em.Object.create({
-            componentName: 'componentName1',
-            hostName: 'hostName1',
-            service: {
-              serviceName: 'serviceName1',
-              displayName: 'displayName1'
-            },
-            staleConfigs: true
+            displayName: 'displayName1',
+            isRestartRequired: true
           }),
           Em.Object.create({
-            componentName: 'componentName2',
-            hostName: 'hostName2',
-            service: {
-              serviceName: 'serviceName2',
-              displayName: 'displayName2'
-            },
-            staleConfigs: true
+            displayName: 'displayName2',
+            isRestartRequired: true
           }),
           Em.Object.create({
-            componentName: 'componentName3',
-            hostName: 'hostName3',
-            service: {
-              serviceName: 'serviceName3',
-              displayName: 'displayName3'
-            },
-            staleConfigs: false
+            displayName: 'displayName3',
+            isRestartRequired: false
           })
         ];
       });
     });
 
     afterEach(function () {
-      App.HostComponent.find.restore();
+      App.Service.find.restore();
       App.showConfirmationPopup.restore();
       mainServiceController.restartHostComponents.restore();
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dd0bda0/ambari-web/test/models/service_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/models/service_test.js b/ambari-web/test/models/service_test.js
index e527e1e..5bd0cf8 100644
--- a/ambari-web/test/models/service_test.js
+++ b/ambari-web/test/models/service_test.js
@@ -133,20 +133,25 @@ describe('App.Service', function () {
     beforeEach(function () {
       service.reopen({
         serviceName: 'HDFS',
-        hostComponents: []
+        clientComponents: [],
+        slaveComponents: [],
+        masterComponents: []
       });
     });
-    hostComponentsDataFalse.forEach(function (item) {
-      it('should be false', function () {
-        service.set('hostComponents', item);
-        expect(service.get('isRestartRequired')).to.be.false;
-      });
+    it('should be false when no component has stale configs', function () {
+      expect(service.get('isRestartRequired')).to.be.false;
     });
-    hostComponentsDataTrue.forEach(function (item) {
-      it('should be true', function () {
-        service.set('hostComponents', item);
-        expect(service.get('isRestartRequired')).to.be.true;
-      });
+    it('should be true when clientComponents has stale configs', function () {
+      service.set('clientComponents', [Em.Object.create({staleConfigHosts: ['host1']})]);
+      expect(service.get('isRestartRequired')).to.be.true;
+    });
+    it('should be true when slaveComponents has stale configs', function () {
+      service.set('slaveComponents', [Em.Object.create({staleConfigHosts: ['host1']})]);
+      expect(service.get('isRestartRequired')).to.be.true;
+    });
+    it('should be true when masterComponents has stale configs', function () {
+      service.set('masterComponents', [Em.Object.create({staleConfigHosts: ['host1']})]);
+      expect(service.get('isRestartRequired')).to.be.true;
     });
   });
 


[11/51] [abbrv] ambari git commit: AMBARI-19802. Debug: agent randomly losing heartbeat with the server. (Attila Doroszlai via stoader)

Posted by rz...@apache.org.
AMBARI-19802. Debug: agent randomly losing heartbeat with the server. (Attila Doroszlai via stoader)

(cherry picked from commit d071727734468fd78fdf02a94f490b80cba8cdb2)

Change-Id: I12749ac0225a1c8c13a79b71e44b84b75162d770


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 44f45199abbac060767f2cda997406ef8f092f60
Parents: f04d7ba
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Wed Feb 1 19:06:29 2017 +0100
Committer: Zuul <re...@hortonworks.com>
Committed: Mon Feb 6 21:48:54 2017 -0800

----------------------------------------------------------------------
 .../src/main/python/ambari_agent/Controller.py  | 51 +++++++++++++-------
 .../ambari_agent/StatusCommandsExecutor.py      |  1 +
 2 files changed, 34 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/44f45199/ambari-agent/src/main/python/ambari_agent/Controller.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/Controller.py b/ambari-agent/src/main/python/ambari_agent/Controller.py
index 09f15de..61a74e6 100644
--- a/ambari-agent/src/main/python/ambari_agent/Controller.py
+++ b/ambari-agent/src/main/python/ambari_agent/Controller.py
@@ -274,7 +274,7 @@ class Controller(threading.Thread):
     self.DEBUG_SUCCESSFULL_HEARTBEATS = 0
     retry = False
     certVerifFailed = False
-    state_interval = self.config.get('heartbeat', 'state_interval_seconds', '60')
+    state_interval = int(self.config.get('heartbeat', 'state_interval_seconds', '60'))
 
     # last time when state was successfully sent to server
     last_state_timestamp = 0.0
@@ -289,27 +289,34 @@ class Controller(threading.Thread):
     getrecoverycommands_timestamp = 0.0
     getrecoverycommands_interval = self.netutil.HEARTBEAT_IDLE_INTERVAL_DEFAULT_MAX_SEC
 
+    heartbeat_interval = self.netutil.HEARTBEAT_IDLE_INTERVAL_DEFAULT_MAX_SEC
+
     while not self.DEBUG_STOP_HEARTBEATING:
-      heartbeat_interval = self.netutil.HEARTBEAT_IDLE_INTERVAL_DEFAULT_MAX_SEC
+      current_time = time.time()
+      logging_level = logging.DEBUG
+      if current_time - heartbeat_running_msg_timestamp > state_interval:
+        # log more steps every minute or so
+        logging_level = logging.INFO
+        heartbeat_running_msg_timestamp = current_time
 
       try:
-        crt_time = time.time()
-        if crt_time - heartbeat_running_msg_timestamp > int(state_interval):
-          logger.info("Heartbeat (response id = %s) with server is running...", self.responseId)
-          heartbeat_running_msg_timestamp = crt_time
+        logger.log(logging_level, "Heartbeat (response id = %s) with server is running...", self.responseId)
 
         send_state = False
         if not retry:
-          if crt_time - last_state_timestamp > int(state_interval):
+          if current_time - last_state_timestamp > state_interval:
             send_state = True
 
-          data = json.dumps(
-              self.heartbeat.build(self.responseId, send_state, self.hasMappedComponents))
+          logger.log(logging_level, "Building heartbeat message")
+
+          data = json.dumps(self.heartbeat.build(self.responseId, send_state, self.hasMappedComponents))
         else:
           self.DEBUG_HEARTBEAT_RETRIES += 1
 
-
-        logger.debug("Sending Heartbeat (id = %s): %s", self.responseId, data)
+        if logger.isEnabledFor(logging.DEBUG):
+          logger.log(logging_level, "Sending Heartbeat (id = %s): %s", self.responseId, data)
+        else:
+          logger.log(logging_level, "Sending Heartbeat (id = %s)", self.responseId)
 
         response = self.sendRequest(self.heartbeatUrl, data)
         exitStatus = 0
@@ -321,8 +328,7 @@ class Controller(threading.Thread):
 
         serverId = int(response['responseId'])
 
-
-        logger.debug('Heartbeat response received (id = %s)', serverId)
+        logger.log(logging_level, 'Heartbeat response received (id = %s)', serverId)
 
         cluster_size = int(response['clusterSize']) if 'clusterSize' in response.keys() else -1
 
@@ -331,8 +337,7 @@ class Controller(threading.Thread):
           if cluster_size > 0 \
           else self.netutil.HEARTBEAT_IDLE_INTERVAL_DEFAULT_MAX_SEC
 
-
-        logger.debug("Heartbeat interval is %s seconds", heartbeat_interval)
+        logger.log(logging_level, "Heartbeat interval is %s seconds", heartbeat_interval)
 
         if 'hasMappedComponents' in response.keys():
           self.hasMappedComponents = response['hasMappedComponents'] is not False
@@ -364,10 +369,11 @@ class Controller(threading.Thread):
         else:
           self.responseId = serverId
           if send_state:
-            last_state_timestamp = time.time()
+            last_state_timestamp = current_time
 
         # if the response contains configurations, update the in-memory and
         # disk-based configuration cache (execution and alert commands have this)
+        logger.log(logging_level, "Updating configurations from heartbeat")
         self.cluster_configuration.update_configurations_from_heartbeat(response)
 
         response_keys = response.keys()
@@ -375,6 +381,8 @@ class Controller(threading.Thread):
         # there's case when canceled task can be processed in Action Queue.execute before adding rescheduled task to queue
         # this can cause command failure instead result suppression
         # so canceling and putting rescheduled commands should be executed atomically
+        if 'cancelCommands' in response_keys or 'executionCommands' in response_keys:
+          logger.log(logging_level, "Adding cancel/execution commands")
         with self.actionQueue.lock:
           if 'cancelCommands' in response_keys:
             self.cancelCommandInQueue(response['cancelCommands'])
@@ -388,9 +396,10 @@ class Controller(threading.Thread):
           # try storing execution command details and desired state
           self.addToStatusQueue(response['statusCommands'])
 
-        if crt_time - getrecoverycommands_timestamp > int(getrecoverycommands_interval):
-          getrecoverycommands_timestamp = crt_time
+        if current_time - getrecoverycommands_timestamp > getrecoverycommands_interval:
+          getrecoverycommands_timestamp = current_time
           if not self.actionQueue.tasks_in_progress_or_pending():
+            logger.log(logging_level, "Adding recovery commands")
             recovery_commands = self.recovery_manager.get_recovery_commands()
             for recovery_command in recovery_commands:
               logger.info("Adding recovery command %s for component %s",
@@ -398,9 +407,11 @@ class Controller(threading.Thread):
               self.addToQueue([recovery_command])
 
         if 'alertDefinitionCommands' in response_keys:
+          logger.log(logging_level, "Updating alert definitions")
           self.alert_scheduler_handler.update_definitions(response)
 
         if 'alertExecutionCommands' in response_keys:
+          logger.log(logging_level, "Executing alert commands")
           self.alert_scheduler_handler.execute_alert(response['alertExecutionCommands'])
 
         if "true" == response['restartAgent']:
@@ -414,6 +425,7 @@ class Controller(threading.Thread):
 
         if "recoveryConfig" in response:
           # update the list of components enabled for recovery
+          logger.log(logging_level, "Updating recovery config")
           self.recovery_manager.update_configuration_from_registration(response)
 
         retry = False
@@ -455,12 +467,15 @@ class Controller(threading.Thread):
 
       # Sleep for some time
       timeout = heartbeat_interval - self.netutil.MINIMUM_INTERVAL_BETWEEN_HEARTBEATS
+      logger.log(logging_level, "Waiting %s for next heartbeat", timeout)
 
       if 0 == self.heartbeat_stop_callback.wait(timeout, self.netutil.MINIMUM_INTERVAL_BETWEEN_HEARTBEATS):
         # Stop loop when stop event received
         logger.info("Stop event received")
         self.DEBUG_STOP_HEARTBEATING=True
 
+      logger.log(logging_level, "Wait for next heartbeat over")
+
   def spawnStatusCommandsExecutorProcess(self):
     '''
     Starts a new StatusCommandExecutor child process. In case there is a running instance

http://git-wip-us.apache.org/repos/asf/ambari/blob/44f45199/ambari-agent/src/main/python/ambari_agent/StatusCommandsExecutor.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/StatusCommandsExecutor.py b/ambari-agent/src/main/python/ambari_agent/StatusCommandsExecutor.py
index fbb29f4..2f15770 100644
--- a/ambari-agent/src/main/python/ambari_agent/StatusCommandsExecutor.py
+++ b/ambari-agent/src/main/python/ambari_agent/StatusCommandsExecutor.py
@@ -47,6 +47,7 @@ class StatusCommandsExecutor(multiprocessing.Process):
   def run(self):
     try:
       bind_debug_signal_handlers()
+      logger.info("StatusCommandsExecutor starting")
       while True:
         command = self.actionQueue.statusCommandQueue.get(True) # blocks until status status command appears
         logger.debug("Running status command for {0}".format(command['componentName']))


[28/51] [abbrv] ambari git commit: AMBARI-19878 Log Search Portal time zone selection bug (mgergely)

Posted by rz...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/e3b9ef3c/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/timezone/jstz-1.0.4.min.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/timezone/jstz-1.0.4.min.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/timezone/jstz-1.0.4.min.js
deleted file mode 100644
index 96e3dd8..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/timezone/jstz-1.0.4.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! jstz - v1.0.4 - 2012-12-12 */
-(function(e){var t=function(){"use strict";var e="s",n=function(e){var t=-e.getTimezoneOffset();return t!==null?t:0},r=function(e,t,n){var r=new Date;return e!==undefined&&r.setFullYear(e),r.setDate(n),r.setMonth(t),r},i=function(e){return n(r(e,0,2))},s=function(e){return n(r(e,5,2))},o=function(e){var t=e.getMonth()>7?s(e.getFullYear()):i(e.getFullYear()),r=n(e);return t-r!==0},u=function(){var t=i(),n=s(),r=i()-s();return r<0?t+",1":r>0?n+",1,"+e:t+",0"},a=function(){var e=u();return new t.TimeZone(t.olson.timezones[e])};return{determine:a,date_is_dst:o}}();t.TimeZone=function(e){"use strict";var n=null,r=function(){return n},i=function(){var e=t.olson.ambiguity_list[n],r=e.length,i=0,s=e[0];for(;i<r;i+=1){s=e[i];if(t.date_is_dst(t.olson.dst_start_dates[s])){n=s;return}}},s=function(){return typeof t.olson.ambiguity_list[n]!="undefined"};return n=e,s()&&i(),{name:r}},t.olson={},t.olson.timezones={"-720,0":"Etc/GMT+12","-660,0":"Pacific/Pago_Pago","-600,1":"America/Adak","-600,0":
 "Pacific/Honolulu","-570,0":"Pacific/Marquesas","-540,0":"Pacific/Gambier","-540,1":"America/Anchorage","-480,1":"America/Los_Angeles","-480,0":"Pacific/Pitcairn","-420,0":"America/Phoenix","-420,1":"America/Denver","-360,0":"America/Guatemala","-360,1":"America/Chicago","-360,1,s":"Pacific/Easter","-300,0":"America/Bogota","-300,1":"America/New_York","-270,0":"America/Caracas","-240,1":"America/Halifax","-240,0":"America/Santo_Domingo","-240,1,s":"America/Santiago","-210,1":"America/St_Johns","-180,1":"America/Godthab","-180,0":"America/Argentina/Buenos_Aires","-180,1,s":"America/Montevideo","-120,0":"Etc/GMT+2","-120,1":"Etc/GMT+2","-60,1":"Atlantic/Azores","-60,0":"Atlantic/Cape_Verde","0,0":"Etc/UTC","0,1":"Europe/London","60,1":"Europe/Berlin","60,0":"Africa/Lagos","60,1,s":"Africa/Windhoek","120,1":"Asia/Beirut","120,0":"Africa/Johannesburg","180,0":"Asia/Baghdad","180,1":"Europe/Moscow","210,1":"Asia/Tehran","240,0":"Asia/Dubai","240,1":"Asia/Baku","270,0":"Asia/Kabul","300,1
 ":"Asia/Yekaterinburg","300,0":"Asia/Karachi","330,0":"Asia/Kolkata","345,0":"Asia/Kathmandu","360,0":"Asia/Dhaka","360,1":"Asia/Omsk","390,0":"Asia/Rangoon","420,1":"Asia/Krasnoyarsk","420,0":"Asia/Jakarta","480,0":"Asia/Shanghai","480,1":"Asia/Irkutsk","525,0":"Australia/Eucla","525,1,s":"Australia/Eucla","540,1":"Asia/Yakutsk","540,0":"Asia/Tokyo","570,0":"Australia/Darwin","570,1,s":"Australia/Adelaide","600,0":"Australia/Brisbane","600,1":"Asia/Vladivostok","600,1,s":"Australia/Sydney","630,1,s":"Australia/Lord_Howe","660,1":"Asia/Kamchatka","660,0":"Pacific/Noumea","690,0":"Pacific/Norfolk","720,1,s":"Pacific/Auckland","720,0":"Pacific/Tarawa","765,1,s":"Pacific/Chatham","780,0":"Pacific/Tongatapu","780,1,s":"Pacific/Apia","840,0":"Pacific/Kiritimati"},t.olson.dst_start_dates=function(){"use strict";var e=new Date(2010,6,15,1,0,0,0);return{"America/Denver":new Date(2011,2,13,3,0,0,0),"America/Mazatlan":new Date(2011,3,3,3,0,0,0),"America/Chicago":new Date(2011,2,13,3,0,0,0),"A
 merica/Mexico_City":new Date(2011,3,3,3,0,0,0),"America/Asuncion":new Date(2012,9,7,3,0,0,0),"America/Santiago":new Date(2012,9,3,3,0,0,0),"America/Campo_Grande":new Date(2012,9,21,5,0,0,0),"America/Montevideo":new Date(2011,9,2,3,0,0,0),"America/Sao_Paulo":new Date(2011,9,16,5,0,0,0),"America/Los_Angeles":new Date(2011,2,13,8,0,0,0),"America/Santa_Isabel":new Date(2011,3,5,8,0,0,0),"America/Havana":new Date(2012,2,10,2,0,0,0),"America/New_York":new Date(2012,2,10,7,0,0,0),"Asia/Beirut":new Date(2011,2,27,1,0,0,0),"Europe/Helsinki":new Date(2011,2,27,4,0,0,0),"Europe/Istanbul":new Date(2011,2,28,5,0,0,0),"Asia/Damascus":new Date(2011,3,1,2,0,0,0),"Asia/Jerusalem":new Date(2011,3,1,6,0,0,0),"Asia/Gaza":new Date(2009,2,28,0,30,0,0),"Africa/Cairo":new Date(2009,3,25,0,30,0,0),"Pacific/Auckland":new Date(2011,8,26,7,0,0,0),"Pacific/Fiji":new Date(2010,11,29,23,0,0,0),"America/Halifax":new Date(2011,2,13,6,0,0,0),"America/Goose_Bay":new Date(2011,2,13,2,1,0,0),"America/Miquelon":new Date
 (2011,2,13,5,0,0,0),"America/Godthab":new Date(2011,2,27,1,0,0,0),"Europe/Moscow":e,"Asia/Yekaterinburg":e,"Asia/Omsk":e,"Asia/Krasnoyarsk":e,"Asia/Irkutsk":e,"Asia/Yakutsk":e,"Asia/Vladivostok":e,"Asia/Kamchatka":e,"Europe/Minsk":e,"Australia/Perth":new Date(2008,10,1,1,0,0,0)}}(),t.olson.ambiguity_list={"America/Denver":["America/Denver","America/Mazatlan"],"America/Chicago":["America/Chicago","America/Mexico_City"],"America/Santiago":["America/Santiago","America/Asuncion","America/Campo_Grande"],"America/Montevideo":["America/Montevideo","America/Sao_Paulo"],"Asia/Beirut":["Asia/Beirut","Europe/Helsinki","Europe/Istanbul","Asia/Damascus","Asia/Jerusalem","Asia/Gaza"],"Pacific/Auckland":["Pacific/Auckland","Pacific/Fiji"],"America/Los_Angeles":["America/Los_Angeles","America/Santa_Isabel"],"America/New_York":["America/Havana","America/New_York"],"America/Halifax":["America/Goose_Bay","America/Halifax"],"America/Godthab":["America/Miquelon","America/Godthab"],"Asia/Dubai":["Europe/
 Moscow"],"Asia/Dhaka":["Asia/Yekaterinburg"],"Asia/Jakarta":["Asia/Omsk"],"Asia/Shanghai":["Asia/Krasnoyarsk","Australia/Perth"],"Asia/Tokyo":["Asia/Irkutsk"],"Australia/Brisbane":["Asia/Yakutsk"],"Pacific/Noumea":["Asia/Vladivostok"],"Pacific/Tarawa":["Asia/Kamchatka"],"Africa/Johannesburg":["Asia/Gaza","Africa/Cairo"],"Asia/Baghdad":["Europe/Minsk"]},typeof exports!="undefined"?exports.jstz=t:e.jstz=t})(this);
\ No newline at end of file


[23/51] [abbrv] ambari git commit: AMBARI-19810. Remove upgrade logic in UpdateCatalog250 for tez-interactive-site's 'tez.runtime.io.sort.mb' and 'tez.runtime.unordered.output.buffer.size-mb'.

Posted by rz...@apache.org.
AMBARI-19810. Remove upgrade logic in UpdateCatalog250 for tez-interactive-site's 'tez.runtime.io.sort.mb' and 'tez.runtime.unordered.output.buffer.size-mb'.

(cherry picked from commit a8887c44500d92e225d6d53774595500fc1a6c01)

Change-Id: I015a4aa278982895b0f405228e1ca66a97f73a57


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: fb265e160d1350c4b7c877259146d762099b9689
Parents: bd2674d
Author: Swapan Shridhar <ss...@hortonworks.com>
Authored: Thu Feb 2 11:23:17 2017 -0800
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 02:15:22 2017 -0800

----------------------------------------------------------------------
 .../server/upgrade/UpgradeCatalog250.java       | 27 --------------------
 .../server/upgrade/UpgradeCatalog250Test.java   |  5 ----
 2 files changed, 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fb265e16/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
index 6b9076c..ccb6b9e 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog250.java
@@ -161,7 +161,6 @@ public class UpgradeCatalog250 extends AbstractUpgradeCatalog {
     updateHadoopEnvConfigs();
     updateKafkaConfigs();
     updateHIVEInteractiveConfigs();
-    updateTEZInteractiveConfigs();
     updateHiveLlapConfigs();
     updateTablesForZeppelinViewRemoval();
     updateZeppelinConfigs();
@@ -673,32 +672,6 @@ public class UpgradeCatalog250 extends AbstractUpgradeCatalog {
   }
 
   /**
-   * Updates Tez for Hive2 Interactive's config in tez-interactive-site.
-   *
-   * @throws AmbariException
-   */
-  protected void updateTEZInteractiveConfigs() throws AmbariException {
-    AmbariManagementController ambariManagementController = injector.getInstance(AmbariManagementController.class);
-    Clusters clusters = ambariManagementController.getClusters();
-    if (clusters != null) {
-      Map<String, Cluster> clusterMap = clusters.getClusters();
-
-      if (clusterMap != null && !clusterMap.isEmpty()) {
-        for (final Cluster cluster : clusterMap.values()) {
-          Config tezInteractiveSite = cluster.getDesiredConfigByType("tez-interactive-site");
-          if (tezInteractiveSite != null) {
-
-            updateConfigurationProperties("tez-interactive-site", Collections.singletonMap("tez.runtime.io.sort.mb", "512"), true, true);
-
-            updateConfigurationProperties("tez-interactive-site", Collections.singletonMap("tez.runtime.unordered.output.buffer.size-mb",
-                "100"), true, true);
-          }
-        }
-      }
-    }
-  }
-
-  /**
    * Updates Log Search configs.
    *
    * @throws AmbariException

http://git-wip-us.apache.org/repos/asf/ambari/blob/fb265e16/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
index c80f98c..ff5f2ee 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog250Test.java
@@ -280,7 +280,6 @@ public class UpgradeCatalog250Test {
     Method updateAtlasConfigs = UpgradeCatalog250.class.getDeclaredMethod("updateAtlasConfigs");
     Method addNewConfigurationsFromXml = AbstractUpgradeCatalog.class.getDeclaredMethod("addNewConfigurationsFromXml");
     Method updateHIVEInteractiveConfigs = UpgradeCatalog250.class.getDeclaredMethod("updateHIVEInteractiveConfigs");
-    Method updateTEZInteractiveConfigs = UpgradeCatalog250.class.getDeclaredMethod("updateTEZInteractiveConfigs");
     Method updateLogSearchConfigs = UpgradeCatalog250.class.getDeclaredMethod("updateLogSearchConfigs");
     Method updateAmbariInfraConfigs = UpgradeCatalog250.class.getDeclaredMethod("updateAmbariInfraConfigs");
     Method updateRangerUrlConfigs = UpgradeCatalog250.class.getDeclaredMethod("updateRangerUrlConfigs");
@@ -292,7 +291,6 @@ public class UpgradeCatalog250Test {
       .addMockedMethod(updateHadoopEnvConfigs)
       .addMockedMethod(updateKafkaConfigs)
       .addMockedMethod(updateHIVEInteractiveConfigs)
-      .addMockedMethod(updateTEZInteractiveConfigs)
       .addMockedMethod(updateHiveLlapConfigs)
       .addMockedMethod(updateTablesForZeppelinViewRemoval)
       .addMockedMethod(updateZeppelinConfigs)
@@ -321,9 +319,6 @@ public class UpgradeCatalog250Test {
     upgradeCatalog250.updateHIVEInteractiveConfigs();
     expectLastCall().once();
 
-    upgradeCatalog250.updateTEZInteractiveConfigs();
-    expectLastCall().once();
-
     upgradeCatalog250.updateHiveLlapConfigs();
     expectLastCall().once();
 


[09/51] [abbrv] ambari git commit: AMBARI-19862. JS error on host configs page (onechiporenko)

Posted by rz...@apache.org.
AMBARI-19862. JS error on host configs page (onechiporenko)

(cherry picked from commit 5262ebeaf276fa3f2ba49ebaeabcb7ffb3c0ccf5)

Change-Id: I20448a2576a4f004aaa68b2c97d26a97b9b83d9b


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 218371c86a68ecf2171d633ede238abec709e5af
Parents: 8ffb989
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Fri Feb 3 10:47:11 2017 +0200
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Mon Feb 6 21:29:34 2017 -0800

----------------------------------------------------------------------
 .../app/views/common/configs/service_configs_by_category_view.js   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/218371c8/ambari-web/app/views/common/configs/service_configs_by_category_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/service_configs_by_category_view.js b/ambari-web/app/views/common/configs/service_configs_by_category_view.js
index d9b4409..f4f35c8 100644
--- a/ambari-web/app/views/common/configs/service_configs_by_category_view.js
+++ b/ambari-web/app/views/common/configs/service_configs_by_category_view.js
@@ -70,7 +70,7 @@ App.ServiceConfigsByCategoryView = Em.View.extend(App.UserPref, App.ConfigOverri
    */
   mainView: function () {
     //todo: Get rid of this logic. Get data from controller instead.
-    return this.get('controller.name') === 'mainServiceInfoConfigsController' ? this.get('parentView.parentView') : this.get('parentView');
+    return ['mainHostServiceConfigsController', 'mainServiceInfoConfigsController'].contains(this.get('controller.name')) ? this.get('parentView.parentView') : this.get('parentView');
   }.property('controller.name'),
 
   didInsertElement: function () {


[47/51] [abbrv] ambari git commit: AMBARI-19822. Add infra-solr-plugin for authorization (with Kerberos) (oleewere)

Posted by rz...@apache.org.
AMBARI-19822. Add infra-solr-plugin for authorization (with Kerberos) (oleewere)

(cherry picked from commit 79e676c2a86f63becc6dba0041ba11102f11cd9a)

Change-Id: I2863264c1ba8332b2398af29d291616668746454


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 0446e4b19aaf2b71f71fb197885c079f61252a70
Parents: 47d94bf
Author: oleewere <ol...@gmail.com>
Authored: Wed Feb 1 18:24:10 2017 +0100
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 12:26:55 2017 -0800

----------------------------------------------------------------------
 .../ambari-infra-solr-plugin/pom.xml            |  56 ++
 .../InfraKerberosHostValidator.java             |  54 ++
 .../InfraRuleBasedAuthorizationPlugin.java      | 542 +++++++++++++++++++
 .../InfraUserRolesLookupStrategy.java           |  49 ++
 .../InfraKerberosHostValidatorTest.java         | 114 ++++
 .../InfraRuleBasedAuthorizationPluginTest.java  | 247 +++++++++
 .../InfraUserRolesLookupStrategyTest.java       |  83 +++
 .../ambari-logsearch-assembly/pom.xml           |  15 +-
 ambari-logsearch/pom.xml                        |   1 +
 .../configuration/infra-solr-security-json.xml  |  62 ++-
 .../0.1.0/package/scripts/params.py             |  29 +-
 .../properties/infra-solr-security.json.j2      |  46 ++
 .../test/python/stacks/2.4/configs/default.json |   1 +
 13 files changed, 1296 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0446e4b1/ambari-logsearch/ambari-infra-solr-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-infra-solr-plugin/pom.xml b/ambari-logsearch/ambari-infra-solr-plugin/pom.xml
new file mode 100644
index 0000000..3d0cf00
--- /dev/null
+++ b/ambari-logsearch/ambari-infra-solr-plugin/pom.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <parent>
+    <artifactId>ambari-logsearch</artifactId>
+    <groupId>org.apache.ambari</groupId>
+    <version>2.5.0.0.0</version>
+  </parent>
+  <name>Ambari Infra Solr Plugin</name>
+  <url>http://maven.apache.org</url>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>ambari-infra-solr-plugin</artifactId>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.solr</groupId>
+      <artifactId>solr-core</artifactId>
+      <version>${solr.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.solr</groupId>
+      <artifactId>solr-test-framework</artifactId>
+      <version>${solr.version}</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.3</version>
+        <configuration>
+          <source>1.7</source>
+          <target>1.7</target>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/0446e4b1/ambari-logsearch/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraKerberosHostValidator.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraKerberosHostValidator.java b/ambari-logsearch/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraKerberosHostValidator.java
new file mode 100644
index 0000000..4a47a89
--- /dev/null
+++ b/ambari-logsearch/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraKerberosHostValidator.java
@@ -0,0 +1,54 @@
+/*
+ * 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.infra.security;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections.MapUtils;
+import org.apache.hadoop.security.authentication.server.AuthenticationToken;
+import org.apache.hadoop.security.authentication.util.KerberosName;
+
+import java.security.Principal;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Validate that the user has the right access based on the hostname in the kerberos principal
+ */
+public class InfraKerberosHostValidator {
+
+  public boolean validate(Principal principal, Map<String, Set<String>> userVsHosts, Map<String, String> userVsHostRegex) {
+    if (principal instanceof AuthenticationToken) {
+      AuthenticationToken authenticationToken = (AuthenticationToken) principal;
+      KerberosName kerberosName = new KerberosName(authenticationToken.getName());
+      String hostname = kerberosName.getHostName();
+      String serviceUserName = kerberosName.getServiceName();
+      if (MapUtils.isNotEmpty(userVsHostRegex)) {
+        String regex = userVsHostRegex.get(serviceUserName);
+        return hostname.matches(regex);
+      }
+      if (MapUtils.isNotEmpty(userVsHosts)) {
+        Set<String> hosts = userVsHosts.get(serviceUserName);
+        if (CollectionUtils.isNotEmpty(hosts)) {
+          return hosts.contains(hostname);
+        }
+      }
+    }
+    return true;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/0446e4b1/ambari-logsearch/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraRuleBasedAuthorizationPlugin.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraRuleBasedAuthorizationPlugin.java b/ambari-logsearch/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraRuleBasedAuthorizationPlugin.java
new file mode 100644
index 0000000..2f1a558
--- /dev/null
+++ b/ambari-logsearch/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraRuleBasedAuthorizationPlugin.java
@@ -0,0 +1,542 @@
+/*
+ * 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.infra.security;
+
+import com.google.common.collect.ImmutableSet;
+import java.io.IOException;
+import java.lang.invoke.MethodHandles;
+import java.security.Principal;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.params.CollectionParams;
+import org.apache.solr.common.util.Utils;
+import org.apache.solr.security.AuthorizationContext;
+import org.apache.solr.security.AuthorizationPlugin;
+import org.apache.solr.security.AuthorizationResponse;
+import org.apache.solr.security.ConfigEditablePlugin;
+import org.apache.solr.util.CommandOperation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static java.util.Collections.singleton;
+import static org.apache.solr.common.params.CommonParams.NAME;
+import static org.apache.solr.common.util.Utils.getDeepCopy;
+import static org.apache.solr.handler.admin.SecurityConfHandler.getListValue;
+import static org.apache.solr.handler.admin.SecurityConfHandler.getMapValue;
+
+/**
+ * Modified copy of solr.RuleBasedAuthorizationPlugin to handle role - permission mappings with KereberosPlugin
+ * Added 2 new JSON map: (precedence: user-host-regex > user-host)
+ * 1. "user-host": user host mappings (array) for hostname validation
+ * 2. "user-host-regex": user host regex mapping (string) for hostname validation
+ */
+public class InfraRuleBasedAuthorizationPlugin implements AuthorizationPlugin, ConfigEditablePlugin {
+
+  private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+
+  private final Map<String, Set<String>> usersVsRoles = new HashMap<>();
+  private final Map<String, WildCardSupportMap> mapping = new HashMap<>();
+  private final List<Permission> permissions = new ArrayList<>();
+  private final Map<String, Set<String>> userVsHosts = new HashMap<>();
+  private final Map<String, String> userVsHostRegex = new HashMap<>();
+
+  private final InfraUserRolesLookupStrategy infraUserRolesLookupStrategy = new InfraUserRolesLookupStrategy();
+  private final InfraKerberosHostValidator infraKerberosDomainValidator = new InfraKerberosHostValidator();
+
+  private static class WildCardSupportMap extends HashMap<String, List<Permission>> {
+    final Set<String> wildcardPrefixes = new HashSet<>();
+
+    @Override
+    public List<Permission> put(String key, List<Permission> value) {
+      if (key != null && key.endsWith("/*")) {
+        key = key.substring(0, key.length() - 2);
+        wildcardPrefixes.add(key);
+      }
+      return super.put(key, value);
+    }
+
+    @Override
+    public List<Permission> get(Object key) {
+      List<Permission> result = super.get(key);
+      if (key == null || result != null) return result;
+      if (!wildcardPrefixes.isEmpty()) {
+        for (String s : wildcardPrefixes) {
+          if (key.toString().startsWith(s)) {
+            List<Permission> l = super.get(s);
+            if (l != null) {
+              result = result == null ? new ArrayList<Permission>() : new ArrayList<Permission>(result);
+              result.addAll(l);
+            }
+          }
+        }
+      }
+      return result;
+    }
+  }
+
+  @Override
+  public AuthorizationResponse authorize(AuthorizationContext context) {
+    List<AuthorizationContext.CollectionRequest> collectionRequests = context.getCollectionRequests();
+    if (context.getRequestType() == AuthorizationContext.RequestType.ADMIN) {
+      MatchStatus flag = checkCollPerm(mapping.get(null), context);
+      return flag.rsp;
+    }
+
+    for (AuthorizationContext.CollectionRequest collreq : collectionRequests) {
+      //check permissions for each collection
+      MatchStatus flag = checkCollPerm(mapping.get(collreq.collectionName), context);
+      if (flag != MatchStatus.NO_PERMISSIONS_FOUND) return flag.rsp;
+    }
+    //check wildcard (all=*) permissions.
+    MatchStatus flag = checkCollPerm(mapping.get("*"), context);
+    return flag.rsp;
+  }
+
+  private MatchStatus checkCollPerm(Map<String, List<Permission>> pathVsPerms,
+                                    AuthorizationContext context) {
+    if (pathVsPerms == null) return MatchStatus.NO_PERMISSIONS_FOUND;
+
+    String path = context.getResource();
+    MatchStatus flag = checkPathPerm(pathVsPerms.get(path), context);
+    if (flag != MatchStatus.NO_PERMISSIONS_FOUND) return flag;
+    return checkPathPerm(pathVsPerms.get(null), context);
+  }
+
+  private MatchStatus checkPathPerm(List<Permission> permissions, AuthorizationContext context) {
+    if (permissions == null || permissions.isEmpty()) return MatchStatus.NO_PERMISSIONS_FOUND;
+    Principal principal = context.getUserPrincipal();
+    loopPermissions:
+    for (int i = 0; i < permissions.size(); i++) {
+      Permission permission = permissions.get(i);
+      if (permission.method != null && !permission.method.contains(context.getHttpMethod())) {
+        //this permissions HTTP method does not match this rule. try other rules
+        continue;
+      }
+      if(permission.predicate != null){
+        if(!permission.predicate.test(context)) continue ;
+      }
+
+      if (permission.params != null) {
+        for (Map.Entry<String, Object> e : permission.params.entrySet()) {
+          String paramVal = context.getParams().get(e.getKey());
+          Object val = e.getValue();
+          if (val instanceof List) {
+            if (!((List) val).contains(paramVal)) continue loopPermissions;
+          } else if (!Objects.equals(val, paramVal)) continue loopPermissions;
+        }
+      }
+
+      if (permission.role == null) {
+        //no role is assigned permission.That means everybody is allowed to access
+        return MatchStatus.PERMITTED;
+      }
+      if (principal == null) {
+        log.info("request has come without principal. failed permission {} ",permission);
+        //this resource needs a principal but the request has come without
+        //any credential.
+        return MatchStatus.USER_REQUIRED;
+      } else if (permission.role.contains("*")) {
+        return MatchStatus.PERMITTED;
+      }
+
+      for (String role : permission.role) {
+        Set<String> userRoles = infraUserRolesLookupStrategy.getUserRolesFromPrincipal(usersVsRoles, principal);
+        boolean validHostname = infraKerberosDomainValidator.validate(principal, userVsHosts, userVsHostRegex);
+        if (!validHostname) {
+          log.warn("Hostname is not valid for principal {}", principal);
+          return MatchStatus.FORBIDDEN;
+        }
+        if (userRoles != null && userRoles.contains(role)) return MatchStatus.PERMITTED;
+      }
+      log.info("This resource is configured to have a permission {}, The principal {} does not have the right role ", permission, principal);
+      return MatchStatus.FORBIDDEN;
+    }
+    log.debug("No permissions configured for the resource {} . So allowed to access", context.getResource());
+    return MatchStatus.NO_PERMISSIONS_FOUND;
+  }
+
+  @Override
+  public void init(Map<String, Object> initInfo) {
+    mapping.put(null, new WildCardSupportMap());
+    Map<String, Object> map = getMapValue(initInfo, "user-role");
+    for (Object o : map.entrySet()) {
+      Map.Entry e = (Map.Entry) o;
+      String roleName = (String) e.getKey();
+      usersVsRoles.put(roleName, readValueAsSet(map, roleName));
+    }
+    List<Map> perms = getListValue(initInfo, "permissions");
+    for (Map o : perms) {
+      Permission p;
+      try {
+        p = Permission.load(o);
+      } catch (Exception exp) {
+        log.error("Invalid permission ", exp);
+        continue;
+      }
+      permissions.add(p);
+      add2Mapping(p);
+    }
+    // adding user-host
+    Map<String, Object> userHostsMap = getMapValue(initInfo, "user-host");
+    for (Object userHost : userHostsMap.entrySet()) {
+      Map.Entry e = (Map.Entry) userHost;
+      String roleName = (String) e.getKey();
+      userVsHosts.put(roleName, readValueAsSet(userHostsMap, roleName));
+    }
+    // adding user-host-regex
+    Map<String, Object> userHostRegexMap = getMapValue(initInfo, "user-host-regex");
+    for (Map.Entry<String, Object> entry : userHostRegexMap.entrySet()) {
+      userVsHostRegex.put(entry.getKey(), entry.getValue().toString());
+    }
+
+  }
+
+  //this is to do optimized lookup of permissions for a given collection/path
+  private void add2Mapping(Permission permission) {
+    for (String c : permission.collections) {
+      WildCardSupportMap m = mapping.get(c);
+      if (m == null) mapping.put(c, m = new WildCardSupportMap());
+      for (String path : permission.path) {
+        List<Permission> perms = m.get(path);
+        if (perms == null) m.put(path, perms = new ArrayList<>());
+        perms.add(permission);
+      }
+    }
+  }
+
+  /**
+   * read a key value as a set. if the value is a single string ,
+   * return a singleton set
+   *
+   * @param m   the map from which to lookup
+   * @param key the key with which to do lookup
+   */
+  static Set<String> readValueAsSet(Map m, String key) {
+    Set<String> result = new HashSet<>();
+    Object val = m.get(key);
+    if (val == null) {
+      if("collection".equals(key)){
+        //for collection collection: null means a core admin/ collection admin request
+        // otherwise it means a request where collection name is ignored
+        return m.containsKey(key) ? singleton((String) null) : singleton("*");
+      }
+      return null;
+    }
+    if (val instanceof Collection) {
+      Collection list = (Collection) val;
+      for (Object o : list) result.add(String.valueOf(o));
+    } else if (val instanceof String) {
+      result.add((String) val);
+    } else {
+      throw new RuntimeException("Bad value for : " + key);
+    }
+    return result.isEmpty() ? null : Collections.unmodifiableSet(result);
+  }
+
+  @Override
+  public void close() throws IOException { }
+
+  static class Permission {
+    String name;
+    Set<String> path, role, collections, method;
+    Map<String, Object> params;
+    Predicate<AuthorizationContext> predicate;
+    Map originalConfig;
+
+    private Permission() {
+    }
+
+    static Permission load(Map m) {
+      Permission p = new Permission();
+      p.originalConfig = new LinkedHashMap<>(m);
+      String name = (String) m.get(NAME);
+      if (!m.containsKey("role")) throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "role not specified");
+      p.role = readValueAsSet(m, "role");
+      if (well_known_permissions.containsKey(name)) {
+        HashSet<String> disAllowed = new HashSet<>(knownKeys);
+        disAllowed.remove("role");//these are the only
+        disAllowed.remove(NAME);//allowed keys for well-known permissions
+        for (String s : disAllowed) {
+          if (m.containsKey(s))
+            throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, s + " is not a valid key for the permission : " + name);
+        }
+        p.predicate = (Predicate<AuthorizationContext>) ((Map) well_known_permissions.get(name)).get(Predicate.class.getName());
+        m = well_known_permissions.get(name);
+      }
+      p.name = name;
+      p.path = readSetSmart(name, m, "path");
+      p.collections = readSetSmart(name, m, "collection");
+      p.method = readSetSmart(name, m, "method");
+      p.params = (Map<String, Object>) m.get("params");
+      return p;
+    }
+
+    @Override
+    public String toString() {
+      return Utils.toJSONString(originalConfig);
+    }
+
+    static final Set<String> knownKeys = ImmutableSet.of("collection", "role", "params", "path", "method", NAME);
+  }
+
+  enum MatchStatus {
+    USER_REQUIRED(AuthorizationResponse.PROMPT),
+    NO_PERMISSIONS_FOUND(AuthorizationResponse.OK),
+    PERMITTED(AuthorizationResponse.OK),
+    FORBIDDEN(AuthorizationResponse.FORBIDDEN);
+
+    final AuthorizationResponse rsp;
+
+    MatchStatus(AuthorizationResponse rsp) {
+      this.rsp = rsp;
+    }
+  }
+
+  /**
+   * This checks for the defaults available other rules for the keys
+   */
+  private static Set<String> readSetSmart(String permissionName, Map m, String key) {
+    Set<String> set = readValueAsSet(m, key);
+    if (set == null && well_known_permissions.containsKey(permissionName)) {
+      set = readValueAsSet((Map) well_known_permissions.get(permissionName), key);
+    }
+    if ("method".equals(key)) {
+      if (set != null) {
+        for (String s : set) if (!HTTP_METHODS.contains(s)) return null;
+      }
+      return set;
+    }
+    return set == null ? singleton((String)null) : set;
+  }
+
+  @Override
+  public Map<String, Object> edit(Map<String, Object> latestConf, List<CommandOperation> commands) {
+    for (CommandOperation op : commands) {
+      OPERATION operation = null;
+      for (OPERATION o : OPERATION.values()) {
+        if (o.name.equals(op.name)) {
+          operation = o;
+          break;
+        }
+      }
+      if (operation == null) {
+        op.unknownOperation();
+        return null;
+      }
+      latestConf = operation.edit(latestConf, op);
+      if (latestConf == null) return null;
+
+    }
+    return latestConf;
+  }
+
+  enum OPERATION {
+    SET_USER_ROLE("set-user-role") {
+      @Override
+      public Map<String, Object> edit(Map<String, Object> latestConf, CommandOperation op) {
+        Map<String, Object> roleMap = getMapValue(latestConf, "user-role");
+        Map<String, Object> map = op.getDataMap();
+        if (op.hasError()) return null;
+        for (Map.Entry<String, Object> e : map.entrySet()) {
+          if (e.getValue() == null) {
+            roleMap.remove(e.getKey());
+            continue;
+          }
+          if (e.getValue() instanceof String || e.getValue() instanceof List) {
+            roleMap.put(e.getKey(), e.getValue());
+          } else {
+            op.addError("Unexpected value ");
+            return null;
+          }
+        }
+        return latestConf;
+      }
+    },
+    SET_PERMISSION("set-permission") {
+      @Override
+      public Map<String, Object> edit(Map<String, Object> latestConf, CommandOperation op) {
+        String name = op.getStr(NAME);
+        Map<String, Object> dataMap = op.getDataMap();
+        if (op.hasError()) return null;
+        dataMap = getDeepCopy(dataMap, 3);
+        String before = (String) dataMap.remove("before");
+        for (String key : dataMap.keySet()) {
+          if (!Permission.knownKeys.contains(key)) op.addError("Unknown key, " + key);
+        }
+        try {
+          Permission.load(dataMap);
+        } catch (Exception e) {
+          op.addError(e.getMessage());
+          return null;
+        }
+        List<Map> permissions = getListValue(latestConf, "permissions");
+        List<Map> permissionsCopy = new ArrayList<>();
+        boolean added = false;
+        for (Map e : permissions) {
+          Object n = e.get(NAME);
+          if (n.equals(before) || n.equals(name)) {
+            added = true;
+            permissionsCopy.add(dataMap);
+          }
+          if (!n.equals(name)) permissionsCopy.add(e);
+        }
+        if (!added && before != null) {
+          op.addError("Invalid 'before' :" + before);
+          return null;
+        }
+        if (!added) permissionsCopy.add(dataMap);
+        latestConf.put("permissions", permissionsCopy);
+        return latestConf;
+      }
+    },
+    UPDATE_PERMISSION("update-permission") {
+      @Override
+      public Map<String, Object> edit(Map<String, Object> latestConf, CommandOperation op) {
+        String name = op.getStr(NAME);
+        if (op.hasError()) return null;
+        for (Map permission : (List<Map>) getListValue(latestConf, "permissions")) {
+          if (name.equals(permission.get(NAME))) {
+            LinkedHashMap copy = new LinkedHashMap<>(permission);
+            copy.putAll(op.getDataMap());
+            op.setCommandData(copy);
+            return SET_PERMISSION.edit(latestConf, op);
+          }
+        }
+        op.addError("No such permission " + name);
+        return null;
+      }
+    },
+    DELETE_PERMISSION("delete-permission") {
+      @Override
+      public Map<String, Object> edit(Map<String, Object> latestConf, CommandOperation op) {
+        List<String> names = op.getStrs("");
+        if (names == null || names.isEmpty()) {
+          op.addError("Invalid command");
+          return null;
+        }
+        names = new ArrayList<>(names);
+        List<Map> copy = new ArrayList<>();
+        List<Map> p = getListValue(latestConf, "permissions");
+        for (Map map : p) {
+          Object n = map.get(NAME);
+          if (names.contains(n)) {
+            names.remove(n);
+            continue;
+          } else {
+            copy.add(map);
+          }
+        }
+        if (!names.isEmpty()) {
+          op.addError("Unknown permission name(s) " + names);
+          return null;
+        }
+        latestConf.put("permissions", copy);
+        return latestConf;
+      }
+    };
+
+    public abstract Map<String, Object> edit(Map<String, Object> latestConf, CommandOperation op);
+
+    public final String name;
+
+    OPERATION(String s) {
+      this.name = s;
+    }
+
+    public static OPERATION get(String name) {
+      for (OPERATION o : values()) if (o.name.equals(name)) return o;
+      return null;
+    }
+  }
+
+  public static final Set<String> HTTP_METHODS = ImmutableSet.of("GET", "POST", "DELETE", "PUT", "HEAD");
+
+  private static final Map<String, Map<String,Object>> well_known_permissions = (Map) Utils.fromJSONString(
+    "    { " +
+      "    security-edit :{" +
+      "      path:['/admin/authentication','/admin/authorization']," +
+      "      collection:null," +
+      "      method:POST }," +
+      "    security-read :{" +
+      "      path:['/admin/authentication','/admin/authorization']," +
+      "      collection:null," +
+      "      method:GET}," +
+      "    schema-edit :{" +
+      "      method:POST," +
+      "      path:'/schema/*'}," +
+      "    collection-admin-edit :{" +
+      "  collection:null," +
+      "      path:'/admin/collections'}," +
+      "    collection-admin-read :{" +
+      "      collection:null," +
+      "      path:'/admin/collections'}," +
+      "    schema-read :{" +
+      "      method:GET," +
+      "      path:'/schema/*'}," +
+      "    config-read :{" +
+      "      method:GET," +
+      "      path:'/config/*'}," +
+      "    update :{" +
+      "      path:'/update/*'}," +
+      "    read :{" +
+      "      path:['/select', '/get','/browse','/tvrh','/terms','/clustering','/elevate', '/export','/spell','/clustering']}," +
+      "    config-edit:{" +
+      "      method:POST," +
+      "      path:'/config/*'}," +
+      "    all:{collection:['*', null]}" +
+      "}");
+
+  static {
+    ((Map) well_known_permissions.get("collection-admin-edit")).put(Predicate.class.getName(), getCollectionActionPredicate(true));
+    ((Map) well_known_permissions.get("collection-admin-read")).put(Predicate.class.getName(), getCollectionActionPredicate(false));
+  }
+
+  private static Predicate<AuthorizationContext> getCollectionActionPredicate(final boolean isEdit) {
+    return new Predicate<AuthorizationContext>() {
+      @Override
+      public boolean test(AuthorizationContext context) {
+        String action = context.getParams().get("action");
+        if (action == null) return false;
+        CollectionParams.CollectionAction collectionAction = CollectionParams.CollectionAction.get(action);
+        if (collectionAction == null) return false;
+        return isEdit ? collectionAction.isWrite : !collectionAction.isWrite;
+      }
+    };
+  }
+
+
+  public static void main(String[] args) {
+    System.out.println(Utils.toJSONString(well_known_permissions));
+
+  }
+
+  public interface Predicate<T> {
+
+    boolean test(T t);
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/0446e4b1/ambari-logsearch/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraUserRolesLookupStrategy.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraUserRolesLookupStrategy.java b/ambari-logsearch/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraUserRolesLookupStrategy.java
new file mode 100644
index 0000000..a54e4ad
--- /dev/null
+++ b/ambari-logsearch/ambari-infra-solr-plugin/src/main/java/org.apache.ambari.infra.security/InfraUserRolesLookupStrategy.java
@@ -0,0 +1,49 @@
+/*
+ * 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.infra.security;
+
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.hadoop.security.authentication.server.AuthenticationToken;
+import org.apache.hadoop.security.authentication.util.KerberosName;
+
+import java.security.Principal;
+import java.util.Map;
+import java.util.Set;
+
+
+/**
+ * Strategy class to get roles with the principal name (in a specific format e.g.: 'name@DOMAIN')
+ * in case of KerberosPlugin is used for authentication
+ */
+public class InfraUserRolesLookupStrategy {
+
+  public Set<String> getUserRolesFromPrincipal(Map<String, Set<String>> usersVsRoles, Principal principal) {
+    if (principal instanceof AuthenticationToken) {
+      AuthenticationToken authenticationToken = (AuthenticationToken) principal;
+      KerberosName kerberosName = new KerberosName(authenticationToken.getName());
+      Set<String> rolesResult = usersVsRoles.get(String.format("%s@%s", kerberosName.getServiceName(), kerberosName.getRealm()));
+      if (CollectionUtils.isEmpty(rolesResult)) {
+        rolesResult = usersVsRoles.get(principal.getName());
+      }
+      return rolesResult;
+    } else {
+      return usersVsRoles.get(principal.getName());
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/0446e4b1/ambari-logsearch/ambari-infra-solr-plugin/src/test/java/org/apache/ambari/infra/security/InfraKerberosHostValidatorTest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-infra-solr-plugin/src/test/java/org/apache/ambari/infra/security/InfraKerberosHostValidatorTest.java b/ambari-logsearch/ambari-infra-solr-plugin/src/test/java/org/apache/ambari/infra/security/InfraKerberosHostValidatorTest.java
new file mode 100644
index 0000000..828f09a
--- /dev/null
+++ b/ambari-logsearch/ambari-infra-solr-plugin/src/test/java/org/apache/ambari/infra/security/InfraKerberosHostValidatorTest.java
@@ -0,0 +1,114 @@
+/*
+ * 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.infra.security;
+
+import org.apache.hadoop.security.authentication.server.AuthenticationToken;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+public class InfraKerberosHostValidatorTest {
+
+  private static final String DEFAULT_SERVICE_USER = "logsearch";
+
+  private InfraKerberosHostValidator underTest = new InfraKerberosHostValidator();
+  private AuthenticationToken principal;
+
+
+  @Before
+  public void setUp() {
+    principal = new AuthenticationToken(DEFAULT_SERVICE_USER, DEFAULT_SERVICE_USER + "/c6401.ambari.apache.org@EXAMPLE.COM", "kerberos");
+  }
+
+  @Test
+  public void testValidateHosts() {
+    // GIVEN
+    Map<String, Set<String>> userHostsMap = generateUserHostMap("c6401.ambari.apache.org");
+    // WHEN
+    boolean result = underTest.validate(principal, userHostsMap, new HashMap<String, String>());
+    // THEN
+    assertTrue(result);
+  }
+
+  @Test
+  public void testValidateHostsValid() {
+    // GIVEN
+    Map<String, Set<String>> userHostsMap = generateUserHostMap("c6402.ambari.apache.org");
+    // WHEN
+    boolean result = underTest.validate(principal, userHostsMap, new HashMap<String, String>());
+    // THEN
+    assertFalse(result);
+
+  }
+
+  @Test
+  public void testValidateHostRegex() {
+    // GIVEN
+    Map<String, String> userHostRegex = generateRegexMap("c\\d+.*.apache.org");
+    // WHEN
+    boolean result = underTest.validate(principal, new HashMap<String, Set<String>>(), userHostRegex);
+    // THEN
+    assertTrue(result);
+
+  }
+
+  @Test
+  public void testValidateHostRegexInvalid() {
+    // GIVEN
+    Map<String, String> userHostRegex = generateRegexMap("c\\d+.*.org.apache");
+    // WHEN
+    boolean result = underTest.validate(principal, new HashMap<String, Set<String>>(), userHostRegex);
+    // THEN
+    assertFalse(result);
+  }
+
+  @Test
+  public void testPrecedence() {
+    // GIVEN
+    Map<String, Set<String>> userHostsMap = generateUserHostMap("c6402.ambari.apache.org");
+    Map<String, String> userHostRegex = generateRegexMap("c\\d+.*.apache.org");
+    // WHEN
+    boolean result = underTest.validate(principal, userHostsMap, userHostRegex);
+    // THEN
+    assertTrue(result);
+  }
+
+  private Map<String, Set<String>> generateUserHostMap(String... hosts) {
+    Map<String, Set<String>> map = new HashMap<>();
+    Set<String> hostSet = new HashSet<>();
+    for (String host : hosts) {
+      hostSet.add(host);
+    }
+    map.put(DEFAULT_SERVICE_USER, hostSet);
+    return map;
+  }
+
+  private Map<String, String> generateRegexMap(String regex) {
+    Map<String, String> map = new HashMap<>();
+    map.put(DEFAULT_SERVICE_USER, regex);
+    return map;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/0446e4b1/ambari-logsearch/ambari-infra-solr-plugin/src/test/java/org/apache/ambari/infra/security/InfraRuleBasedAuthorizationPluginTest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-infra-solr-plugin/src/test/java/org/apache/ambari/infra/security/InfraRuleBasedAuthorizationPluginTest.java b/ambari-logsearch/ambari-infra-solr-plugin/src/test/java/org/apache/ambari/infra/security/InfraRuleBasedAuthorizationPluginTest.java
new file mode 100644
index 0000000..ee84969
--- /dev/null
+++ b/ambari-logsearch/ambari-infra-solr-plugin/src/test/java/org/apache/ambari/infra/security/InfraRuleBasedAuthorizationPluginTest.java
@@ -0,0 +1,247 @@
+/*
+ * 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.infra.security;
+
+import java.security.Principal;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.hadoop.security.authentication.server.AuthenticationToken;
+import org.apache.solr.common.params.MapSolrParams;
+import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.common.util.Utils;
+import org.apache.solr.security.AuthorizationContext;
+import org.apache.solr.security.AuthorizationContext.RequestType;
+import org.apache.solr.security.AuthorizationResponse;
+import org.junit.Test;
+
+import static java.util.Collections.singletonList;
+import static java.util.Collections.singletonMap;
+import static org.apache.solr.common.util.Utils.makeMap;
+import static org.junit.Assert.assertEquals;
+
+public class InfraRuleBasedAuthorizationPluginTest {
+
+  private static final String PERMISSIONS = "{" +
+    "  user-host : {" +
+    "    'infra-solr@EXAMPLE.COM': [hostname, hostname2]" +
+    "  }," +
+    "  user-role : {" +
+    "    'infra-solr@EXAMPLE.COM': [admin]," +
+    "    'logsearch@EXAMPLE.COM': [logsearch_role,dev]," +
+    "    'logfeeder@EXAMPLE.COM': [logsearch_role,dev]," +
+    "    'atlas@EXAMPLE.COM': [atlas_role, audit_role, dev]," +
+    "    'knox@EXAMPLE.COM': [audit_role,dev]," +
+    "    'hdfs@EXAMPLE.COM': [audit_role,dev]," +
+    "    'hbase@EXAMPLE.COM': [audit_role,dev]," +
+    "    'yarn@EXAMPLE.COM': [audit_role,dev]," +
+    "    'knox@EXAMPLE.COM': [audit_role,dev]," +
+    "    'kafka@EXAMPLE.COM': [audit_role,dev]," +
+    "    'kms@EXAMPLE.COM': [audit_role,dev]," +
+    "    'storm@EXAMPLE.COM': [audit_role,dev]," +
+    "    'rangeradmin@EXAMPLE.COM':[ranger_role, audit_role, dev]" +
+    "  }," +
+    "  permissions : [" +
+    "    {name:'collection-admin-read'," +
+    "    role:null}," +
+    "    {name:collection-admin-edit ," +
+    "    role:[logsearch_role, atlas_role, ranger_role, admin]}," +
+    "    {name:mycoll_update," +
+    "      collection:mycoll," +
+    "      path:'/*'," +
+    "      role:[logsearch_role,admin]" +
+    "    }," +
+    "    {name:mycoll2_update," +
+    "      collection:mycoll2," +
+    "      path:'/*'," +
+    "      role:[ranger_role, audit_role, admin]" +
+    "    }," +
+    "{name:read , role:dev }]}";
+
+  @Test
+  public void testPermissions() {
+    int STATUS_OK = 200;
+    int FORBIDDEN = 403;
+    int PROMPT_FOR_CREDENTIALS = 401;
+
+    checkRules(makeMap("resource", "/#",
+      "httpMethod", "POST",
+      "userPrincipal", "unknownuser",
+      "collectionRequests", "freeforall" )
+      , STATUS_OK);
+
+    checkRules(makeMap("resource", "/update/json/docs",
+      "httpMethod", "POST",
+      "userPrincipal", "tim",
+      "collectionRequests", "mycoll")
+      , FORBIDDEN);
+
+    checkRules(makeMap("resource", "/update/json/docs",
+      "httpMethod", "POST",
+      "userPrincipal", "logsearch",
+      "collectionRequests", "mycoll")
+      , STATUS_OK);
+
+    checkRules(makeMap("resource", "/update/json/docs",
+      "httpMethod", "GET",
+      "userPrincipal", "rangeradmin",
+      "collectionRequests", "mycoll")
+      , FORBIDDEN);
+
+    checkRules(makeMap("resource", "/update/json/docs",
+      "httpMethod", "GET",
+      "userPrincipal", "rangeradmin",
+      "collectionRequests", "mycoll2")
+      , STATUS_OK);
+
+    checkRules(makeMap("resource", "/update/json/docs",
+      "httpMethod", "GET",
+      "userPrincipal", "logsearch",
+      "collectionRequests", "mycoll2")
+      , FORBIDDEN);
+
+    checkRules(makeMap("resource", "/update/json/docs",
+      "httpMethod", "POST",
+      "userPrincipal", "kms",
+      "collectionRequests", "mycoll2")
+      , STATUS_OK);
+
+    checkRules(makeMap("resource", "/admin/collections",
+      "userPrincipal", "tim",
+      "requestType", RequestType.ADMIN,
+      "collectionRequests", null,
+      "params", new MapSolrParams(singletonMap("action", "CREATE")))
+      , FORBIDDEN);
+
+    checkRules(makeMap("resource", "/admin/collections",
+      "userPrincipal", null,
+      "requestType", RequestType.ADMIN,
+      "collectionRequests", null,
+      "params", new MapSolrParams(singletonMap("action", "CREATE")))
+      , PROMPT_FOR_CREDENTIALS);
+
+    checkRules(makeMap("resource", "/admin/collections",
+      "userPrincipal", "rangeradmin",
+      "requestType", RequestType.ADMIN,
+      "collectionRequests", null,
+      "params", new MapSolrParams(singletonMap("action", "CREATE")))
+      , STATUS_OK);
+
+    checkRules(makeMap("resource", "/admin/collections",
+      "userPrincipal", "kms",
+      "requestType", RequestType.ADMIN,
+      "collectionRequests", null,
+      "params", new MapSolrParams(singletonMap("action", "CREATE")))
+      , FORBIDDEN);
+
+    checkRules(makeMap("resource", "/admin/collections",
+      "userPrincipal", "kms",
+      "requestType", RequestType.ADMIN,
+      "collectionRequests", null,
+      "params", new MapSolrParams(singletonMap("action", "LIST")))
+      , STATUS_OK);
+
+    checkRules(makeMap("resource", "/admin/collections",
+      "userPrincipal", "rangeradmin",
+      "requestType", RequestType.ADMIN,
+      "collectionRequests", null,
+      "params", new MapSolrParams(singletonMap("action", "LIST")))
+      , STATUS_OK);
+  }
+
+  private void checkRules(Map<String, Object> values, int expected) {
+    checkRules(values,expected,(Map) Utils.fromJSONString(PERMISSIONS));
+  }
+
+  private void checkRules(Map<String, Object> values, int expected, Map<String ,Object> permissions) {
+    AuthorizationContext context = new MockAuthorizationContext(values);
+    InfraRuleBasedAuthorizationPlugin plugin = new InfraRuleBasedAuthorizationPlugin();
+    plugin.init(permissions);
+    AuthorizationResponse authResp = plugin.authorize(context);
+    assertEquals(expected, authResp.statusCode);
+  }
+
+  private static class MockAuthorizationContext extends AuthorizationContext {
+    private final Map<String,Object> values;
+
+    private MockAuthorizationContext(Map<String, Object> values) {
+      this.values = values;
+    }
+
+    @Override
+    public SolrParams getParams() {
+      SolrParams params = (SolrParams) values.get("params");
+      return params == null ?  new MapSolrParams(new HashMap<String, String>()) : params;
+    }
+
+    @Override
+    public Principal getUserPrincipal() {
+      Object userPrincipal = values.get("userPrincipal");
+      return userPrincipal == null ? null :
+        new AuthenticationToken(String.valueOf(userPrincipal), String.format("%s%s", String.valueOf(userPrincipal), "/hostname@EXAMPLE.COM"), "kerberos");
+    }
+
+    @Override
+    public String getHttpHeader(String header) {
+      return null;
+    }
+
+    @Override
+    public Enumeration getHeaderNames() {
+      return null;
+    }
+
+    @Override
+    public String getRemoteAddr() {
+      return null;
+    }
+
+    @Override
+    public String getRemoteHost() {
+      return null;
+    }
+
+    @Override
+    public List<CollectionRequest> getCollectionRequests() {
+      Object collectionRequests = values.get("collectionRequests");
+      if (collectionRequests instanceof String) {
+        return singletonList(new CollectionRequest((String)collectionRequests));
+      }
+      return (List<CollectionRequest>) collectionRequests;
+    }
+
+    @Override
+    public RequestType getRequestType() {
+      return (RequestType) values.get("requestType");
+    }
+
+    @Override
+    public String getHttpMethod() {
+      return (String) values.get("httpMethod");
+    }
+
+    @Override
+    public String getResource() {
+      return (String) values.get("resource");
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/0446e4b1/ambari-logsearch/ambari-infra-solr-plugin/src/test/java/org/apache/ambari/infra/security/InfraUserRolesLookupStrategyTest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-infra-solr-plugin/src/test/java/org/apache/ambari/infra/security/InfraUserRolesLookupStrategyTest.java b/ambari-logsearch/ambari-infra-solr-plugin/src/test/java/org/apache/ambari/infra/security/InfraUserRolesLookupStrategyTest.java
new file mode 100644
index 0000000..c1a47d1
--- /dev/null
+++ b/ambari-logsearch/ambari-infra-solr-plugin/src/test/java/org/apache/ambari/infra/security/InfraUserRolesLookupStrategyTest.java
@@ -0,0 +1,83 @@
+/*
+ * 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.infra.security;
+
+import com.google.common.collect.Sets;
+import org.apache.hadoop.security.authentication.server.AuthenticationToken;
+import org.apache.http.auth.BasicUserPrincipal;
+import org.junit.Test;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+public class InfraUserRolesLookupStrategyTest {
+
+  private InfraUserRolesLookupStrategy underTest = new InfraUserRolesLookupStrategy();
+
+  @Test
+  public void testLookupRolesForPrincipalName() {
+    // GIVEN
+    Map<String, Set<String>> usersVsRoles = generateUserRolesMap();
+    AuthenticationToken principal = new AuthenticationToken(
+      "logsearch", "logsearch/c6401.ambari.apache.org@EXAMPLE.COM", "kerberos");
+    // WHEN
+    Set<String> result = underTest.getUserRolesFromPrincipal(usersVsRoles, principal);
+    // THEN
+    assertTrue(result.contains("logsearch_user"));
+    assertTrue(result.contains("ranger_user"));
+    assertFalse(result.contains("admin"));
+  }
+
+  @Test
+  public void testLookupRolesForNonKerberosPrincipalName() {
+    // GIVEN
+    Map<String, Set<String>> usersVsRoles = generateUserRolesMap();
+    BasicUserPrincipal principal = new BasicUserPrincipal("infra-solr");
+    // WHEN
+    Set<String> result = underTest.getUserRolesFromPrincipal(usersVsRoles, principal);
+    // THEN
+    assertTrue(result.contains("admin"));
+    assertTrue(result.contains("logsearch_user"));
+  }
+
+  @Test
+  public void testLookupRolesWithNonKerberosPrincipalWithoutRoles() {
+    // GIVEN
+    Map<String, Set<String>> usersVsRoles = generateUserRolesMap();
+    BasicUserPrincipal principal = new BasicUserPrincipal("unknownuser");
+    // WHEN
+    Set<String> result = underTest.getUserRolesFromPrincipal(usersVsRoles, principal);
+    // THEN
+    assertTrue(result.isEmpty());
+  }
+
+  private Map<String, Set<String>> generateUserRolesMap() {
+    Map<String, Set<String>> usersVsRoles = new HashMap<>();
+    usersVsRoles.put("logsearch@EXAMPLE.COM", Sets.newHashSet("logsearch_user", "ranger_user"));
+    usersVsRoles.put("infra-solr@EXAMPLE.COM", Sets.newHashSet("admin"));
+    usersVsRoles.put("infra-solr", Sets.newHashSet("admin", "logsearch_user"));
+    usersVsRoles.put("unknownuser", new HashSet<String>());
+    return usersVsRoles;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/0446e4b1/ambari-logsearch/ambari-logsearch-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-assembly/pom.xml b/ambari-logsearch/ambari-logsearch-assembly/pom.xml
index 0777e17..2e68060 100644
--- a/ambari-logsearch/ambari-logsearch-assembly/pom.xml
+++ b/ambari-logsearch/ambari-logsearch-assembly/pom.xml
@@ -43,6 +43,7 @@
     <logsearch.portal.conf.mapping.path>/etc/${logsearch.portal.package.name}/conf</logsearch.portal.conf.mapping.path>
     <logsearch.logfeeder.conf.mapping.path>/etc/${logsearch.logfeeder.package.name}/conf
     </logsearch.logfeeder.conf.mapping.path>
+    <infra.solr.plugin.dir>${project.basedir}/../ambari-infra-solr-plugin</infra.solr.plugin.dir>
   </properties>
   <artifactId>ambari-logsearch-assembly</artifactId>
   <profiles>
@@ -69,7 +70,8 @@
               <description>Maven Recipe: RPM Package.</description>
               <autoRequires>false</autoRequires>
               <prefix>/</prefix>
-              <needarch>x86_64</needarch>
+              <needarch>noarch</needarch>
+              <targetOS>linux</targetOS>
 
               <version>${package-version}</version>
               <release>${package-release}</release>
@@ -108,6 +110,8 @@
                 <configuration>
                   <group>Development</group>
                   <name>${solr.client.package.name}</name>
+                  <needarch>noarch</needarch>
+                  <targetOS>linux</targetOS>
                   <mappings>
                     <mapping>
                       <directory>${solr.client.mapping.path}</directory>
@@ -236,6 +240,8 @@
                       <fileset dir="${project.build.directory}/solr-${solr.version}"/>
                     </move>
                     <copy file="${project.basedir}/src/main/resources/solr" toDir="${project.build.directory}/solr/bin/" />
+                    <copy file="${infra.solr.plugin.dir}/target/ambari-infra-solr-plugin-${project.version}.jar"
+                          toDir="${project.build.directory}/solr/server/solr-webapp/webapp/WEB-INF/lib/"/>
                     <chmod file="${project.build.directory}/solr/bin/**" perm="755"/>
                     <chmod file="${project.build.directory}/solr/server/scripts/**" perm="755"/>
                   </target>
@@ -495,6 +501,8 @@
                       <fileset dir="${project.build.directory}/solr-${solr.version}"/>
                     </move>
                     <copy file="${project.basedir}/src/main/resources/solr" toDir="${project.build.directory}/solr/bin/" />
+                    <copy file="${infra.solr.plugin.dir}/target/ambari-infra-solr-plugin-${project.version}.jar"
+                          toDir="${project.build.directory}/solr/server/solr-webapp/webapp/WEB-INF/lib/"/>
                     <chmod file="${project.build.directory}/solr/bin/**" perm="755"/>
                     <chmod file="${project.build.directory}/solr/server/scripts/**" perm="755"/>
                   </target>
@@ -523,6 +531,11 @@
       <artifactId>ambari-logsearch-solr-client</artifactId>
       <version>${project.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.ambari</groupId>
+      <artifactId>ambari-infra-solr-plugin</artifactId>
+      <version>${project.version}</version>
+    </dependency>
   </dependencies>
 
 </project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0446e4b1/ambari-logsearch/pom.xml
----------------------------------------------------------------------
diff --git a/ambari-logsearch/pom.xml b/ambari-logsearch/pom.xml
index cabb84f..6df489f 100644
--- a/ambari-logsearch/pom.xml
+++ b/ambari-logsearch/pom.xml
@@ -35,6 +35,7 @@
     <module>ambari-logsearch-logfeeder</module>
     <module>ambari-logsearch-solr-client</module>
     <module>ambari-logsearch-it</module>
+    <module>ambari-infra-solr-plugin</module>
   </modules>
   <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0446e4b1/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/configuration/infra-solr-security-json.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/configuration/infra-solr-security-json.xml b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/configuration/infra-solr-security-json.xml
index ed623df..e193a8c 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/configuration/infra-solr-security-json.xml
+++ b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/configuration/infra-solr-security-json.xml
@@ -22,8 +22,58 @@
 <!-- This is a special config file for properties used to monitor status of the service -->
 <configuration supports_adding_forbidden="true">
   <property>
+    <name>infra_solr_ranger_audit_service_users</name>
+    <display-name>Ranger audit service users</display-name>
+    <value>{default_ranger_audit_users}</value>
+    <description>
+      List of comma separated kerberos service users who can write into ranger audit collections if the cluster is secure. (atlas and rangeradmin supported by default)
+      Change values in that case of custom values are used for kerberos principals. (default_ranger_audit_users is resolved ranger-*-audit/xasecure.audit.jaas.Client.option.principal,
+      by default namenode, hbase, hive knox, kafka, ranger kms and nifi are supported, to change it you can edit the security content,
+      or add a new username next to the default value, e.g.: {default_ranger_audit_users},customuser)
+    </description>
+    <depends-on>
+      <property>
+        <type>ranger-hdfs-audit</type>
+        <name>xasecure.audit.jaas.Client.option.principal</name>
+      </property>
+      <property>
+        <type>ranger-hbase-audit</type>
+        <name>xasecure.audit.jaas.Client.option.principal</name>
+      </property>
+      <property>
+        <type>ranger-hive-audit</type>
+        <name>xasecure.audit.jaas.Client.option.principal</name>
+      </property>
+      <property>
+        <type>ranger-knox-audit</type>
+        <name>xasecure.audit.jaas.Client.option.principal</name>
+      </property>
+      <property>
+        <type>ranger-kafka-audit</type>
+        <name>xasecure.audit.jaas.Client.option.principal</name>
+      </property>
+      <property>
+        <type>ranger-kms-audit</type>
+        <name>xasecure.audit.jaas.Client.option.principal</name>
+      </property>
+      <property>
+        <type>ranger-storm-audit</type>
+        <name>xasecure.audit.jaas.Client.option.principal</name>
+      </property>
+      <property>
+        <type>ranger-yarn-audit</type>
+        <name>xasecure.audit.jaas.Client.option.principal</name>
+      </property>
+      <property>
+        <type>ranger-nifi-audit</type>
+        <name>xasecure.audit.jaas.Client.option.principal</name>
+      </property>
+    </depends-on>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
     <name>content</name>
-    <display-name>infra-solr security.json template</display-name>
+    <display-name>security.json template</display-name>
     <description>This is the jinja template for security.json file on the solr znode (only used if the cluster is secure)</description>
     <value/>
     <property-type>VALUE_FROM_PROPERTY_FILE</property-type>
@@ -31,6 +81,16 @@
       <property-file-name>infra-solr-security.json.j2</property-file-name>
       <property-file-type>text</property-file-type>
     </value-attributes>
+    <depends-on>
+      <property>
+        <type>application-properties</type>
+        <name>atlas.authentication.principal</name>
+      </property>
+      <property>
+        <type>ranger-admin-site</type>
+        <name>ranger.admin.kerberos.principal</name>
+      </property>
+    </depends-on>
     <on-ambari-upgrade add="true"/>
   </property>
 </configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/0446e4b1/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/params.py b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/params.py
index 526baea..ab9aa61 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/package/scripts/params.py
@@ -108,6 +108,7 @@ for host in config['clusterHostInfo']['zookeeper_hosts']:
   if index < len(config['clusterHostInfo']['zookeeper_hosts']):
     zookeeper_quorum += ","
 
+default_ranger_audit_users = 'nn,hbase,hive,knox,kafka,kms,storm,yarn,nifi'
 
 if security_enabled:
   kinit_path_local = status_params.kinit_path_local
@@ -119,7 +120,23 @@ if security_enabled:
   infra_solr_web_kerberos_principal = config['configurations']['infra-solr-env']['infra_solr_web_kerberos_principal'].replace('_HOST',_hostname_lowercase)
   infra_solr_kerberos_name_rules = config['configurations']['infra-solr-env']['infra_solr_kerberos_name_rules'].replace('$', '\$')
   infra_solr_sasl_user = get_name_from_principal(infra_solr_kerberos_principal)
-
+  kerberos_realm = config['configurations']['kerberos-env']['realm']
+
+  ranger_audit_principal_conf_key = "xasecure.audit.jaas.Client.option.principal"
+  ranger_audit_principals = []
+  ranger_audit_principals.append(default('configurations/ranger-hdfs-audit/' + ranger_audit_principal_conf_key, 'nn'))
+  ranger_audit_principals.append(default('configurations/ranger-hbase-audit/' + ranger_audit_principal_conf_key, 'hbase'))
+  ranger_audit_principals.append(default('configurations/ranger-hive-audit/' + ranger_audit_principal_conf_key, 'hive'))
+  ranger_audit_principals.append(default('configurations/ranger-knox-audit/' + ranger_audit_principal_conf_key, 'knox'))
+  ranger_audit_principals.append(default('configurations/ranger-kafka-audit/' + ranger_audit_principal_conf_key, 'kafka'))
+  ranger_audit_principals.append(default('configurations/ranger-kms-audit/' + ranger_audit_principal_conf_key, 'kms'))
+  ranger_audit_principals.append(default('configurations/ranger-storm-audit/' + ranger_audit_principal_conf_key, 'storm'))
+  ranger_audit_principals.append(default('configurations/ranger-yarn-audit/' + ranger_audit_principal_conf_key, 'yarn'))
+  ranger_audit_principals.append(default('configurations/ranger-nifi-audit/' + ranger_audit_principal_conf_key, 'nifi'))
+  ranger_audit_names_from_principals = [ get_name_from_principal(x) for x in ranger_audit_principals ]
+  default_ranger_audit_users = ','.join(ranger_audit_names_from_principals)
+
+infra_solr_ranger_audit_service_users = format(config['configurations']['infra-solr-security-json']['infra_solr_ranger_audit_service_users']).split(',')
 infra_solr_security_json_content = config['configurations']['infra-solr-security-json']['content']
 
 #Solr log4j
@@ -133,3 +150,13 @@ smokeuser = config['configurations']['cluster-env']['smokeuser']
 smoke_user_keytab = config['configurations']['cluster-env']['smokeuser_keytab']
 smokeuser_principal = config['configurations']['cluster-env']['smokeuser_principal_name']
 
+ranger_solr_collection_name = default('configurations/ranger-env/ranger_solr_collection_name', 'ranger_audits')
+logsearch_service_logs_collection = default('configurations/logsearch-properties/logsearch.solr.collection.service.logs', 'hadoop_logs')
+logsearch_audit_logs_collection = default('configurations/logsearch-properties/logsearch.solr.collection.audit.logs', 'audit_logs')
+
+ranger_admin_kerberos_service_user = get_name_from_principal(default('configurations/ranger-admin-site/ranger.admin.kerberos.principal', 'rangeradmin'))
+atlas_kerberos_service_user = get_name_from_principal(default('configurations/application-properties/atlas.authentication.principal', 'atlas'))
+logsearch_kerberos_service_user = get_name_from_principal(default('configurations/logsearch-env/logsearch_kerberos_principal', 'logsearch'))
+logfeeder_kerberos_service_user = get_name_from_principal(default('configurations/logfeeder-env/logfeeder_kerberos_principal', 'logfeeder'))
+infra_solr_kerberos_service_user = get_name_from_principal(default('configurations/infra-solr-env/infra_solr_kerberos_principal', 'infra-solr'))
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/0446e4b1/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/properties/infra-solr-security.json.j2
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/properties/infra-solr-security.json.j2 b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/properties/infra-solr-security.json.j2
index d8aea24..ed764f0 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/properties/infra-solr-security.json.j2
+++ b/ambari-server/src/main/resources/common-services/AMBARI_INFRA/0.1.0/properties/infra-solr-security.json.j2
@@ -18,5 +18,51 @@
 {
   "authentication": {
     "class": "org.apache.solr.security.KerberosPlugin"
+  },
+  "authorization": {
+    "class": "org.apache.ambari.infra.security.InfraRuleBasedAuthorizationPlugin",
+    "user-role": {
+      "{{infra_solr_kerberos_service_user}}@{{kerberos_realm}}": "admin",
+      "{{logsearch_kerberos_service_user}}@{{kerberos_realm}}": ["logsearch_user", "ranger_user", "dev"],
+      "{{logfeeder_kerberos_service_user}}@{{kerberos_realm}}": ["logfeeder_user", "dev"],
+      "{{atlas_kerberos_service_user}}@{{kerberos_realm}}": ["atlas_user", "ranger_audit_user", "dev"],
+{% if infra_solr_ranger_audit_service_users %}
+{%   for ranger_audit_service_user in infra_solr_ranger_audit_service_users %}
+      "{{ranger_audit_service_user}}@{{kerberos_realm}}": ["ranger_audit_user", "dev"],
+{%   endfor %}
+{% endif %}
+      "{{ranger_admin_kerberos_service_user}}@{{kerberos_realm}}": ["ranger_user", "ranger_audit_user", "dev"]
+    },
+    "permissions": [
+    {
+      "name" : "collection-admin-read",
+      "role" :null
+    },
+    {
+      "name" : "collection-admin-edit",
+      "role" : ["admin", "logsearch_user", "logfeeder_user", "atlas_user", "ranger_user"]
+    },
+    {
+      "name":"read",
+      "role": "dev"
+    },
+    {
+      "collection": ["{{logsearch_service_logs_collection}}", "{{logsearch_audit_logs_collection}}", "history"],
+      "role": ["admin", "logsearch_user", "logfeeder_user"],
+      "name": "logsearch-manager",
+      "path": "/*"
+    },
+    {
+       "collection": ["vertex_index", "edge_index", "fulltext_index"],
+       "role": ["admin", "atlas_user"],
+       "name": "atlas-manager",
+       "path": "/*"
+    },
+    {
+       "collection": "{{ranger_solr_collection_name}}",
+       "role": ["admin", "ranger_user", "ranger_audit_user"],
+       "name": "ranger-manager",
+       "path": "/*"
+    }]
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/0446e4b1/ambari-server/src/test/python/stacks/2.4/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.4/configs/default.json b/ambari-server/src/test/python/stacks/2.4/configs/default.json
index 7a940d3..d4e6064 100644
--- a/ambari-server/src/test/python/stacks/2.4/configs/default.json
+++ b/ambari-server/src/test/python/stacks/2.4/configs/default.json
@@ -240,6 +240,7 @@
         "content": "admin json content"
       },
       "infra-solr-security-json" : {
+        "infra_solr_ranger_audit_service_users" : "hbase,hdfs",
         "content" : "{\"authentication\": \"org.apache.solr.security.KerberosPlugin\"}"
       },
       "infra-solr-client-log4j" : {


[20/51] [abbrv] ambari git commit: AMBARI-19683. Content of yarn-env.sh on host is not same as in the downloaded config file from Ambari UI. (Attila Magyar via stoader)

Posted by rz...@apache.org.
AMBARI-19683. Content of yarn-env.sh on host is not same as in the downloaded config file from Ambari UI. (Attila Magyar via stoader)

(cherry picked from commit 99ec0a7f0a8dbb84455f68f86aa3ce3f9f761fee)

Change-Id: I16e78a7d3fdb4e3939c5af20929a4bc4e9d91587


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 02984ffa7c27e17d47a99960a6269737be3eada5
Parents: ea45fdd
Author: Attila Magyar <am...@hortonworks.com>
Authored: Fri Feb 3 11:48:41 2017 +0100
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 01:29:02 2017 -0800

----------------------------------------------------------------------
 .../2.1.0.2.0/package/scripts/params_linux.py   |   3 +-
 .../services/YARN/configuration/yarn-env.xml    | 165 +++++++++++++++++++
 .../stacks/2.0.6/YARN/test_historyserver.py     |   3 +-
 .../stacks/2.0.6/YARN/test_mapreduce2_client.py |   3 +-
 .../stacks/2.0.6/YARN/test_nodemanager.py       |   3 +-
 .../stacks/2.0.6/YARN/test_resourcemanager.py   |   3 +-
 .../stacks/2.0.6/YARN/test_yarn_client.py       |   3 +-
 7 files changed, 172 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/02984ffa/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
index 5a47e03..f9228be 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
@@ -259,7 +259,8 @@ if security_enabled:
   rm_keytab = config['configurations']['yarn-site']['yarn.resourcemanager.keytab']
   rm_kinit_cmd = format("{kinit_path_local} -kt {rm_keytab} {rm_principal_name};")
   yarn_jaas_file = os.path.join(config_dir, 'yarn_jaas.conf')
-  yarn_env_sh_template += format('\nYARN_OPTS="$YARN_OPTS -Dzookeeper.sasl.client=true -Dzookeeper.sasl.client.username=zookeeper -Djava.security.auth.login.config={yarn_jaas_file} -Dzookeeper.sasl.clientconfig=Client"\n')
+  if stack_supports_zk_security:
+    rm_security_opts = format('-Dzookeeper.sasl.client=true -Dzookeeper.sasl.client.username=zookeeper -Djava.security.auth.login.config={yarn_jaas_file} -Dzookeeper.sasl.clientconfig=Client')
 
   # YARN timeline security options
   if has_ats:

http://git-wip-us.apache.org/repos/asf/ambari/blob/02984ffa/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/yarn-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/yarn-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/yarn-env.xml
new file mode 100644
index 0000000..d04c3c5
--- /dev/null
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/YARN/configuration/yarn-env.xml
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/**
+ * 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.
+ */
+-->
+<configuration supports_final="true" supports_adding_forbidden="true">
+  <property>
+    <name>is_supported_yarn_ranger</name>
+    <value>true</value>
+    <description>Set to false by default,  needs to be set to true in stacks that use Ranger Yarn Plugin</description>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <!-- yarn-env.sh -->
+  <property>
+    <name>content</name>
+    <display-name>yarn-env template</display-name>
+    <description>This is the jinja template for yarn-env.sh file</description>
+    <value>
+      export HADOOP_YARN_HOME={{hadoop_yarn_home}}
+      export YARN_LOG_DIR={{yarn_log_dir_prefix}}/$USER
+      export YARN_PID_DIR={{yarn_pid_dir_prefix}}/$USER
+      export HADOOP_LIBEXEC_DIR={{hadoop_libexec_dir}}
+      export JAVA_HOME={{java64_home}}
+      export JAVA_LIBRARY_PATH="${JAVA_LIBRARY_PATH}:{{hadoop_java_io_tmpdir}}"
+
+      # We need to add the EWMA appender for the yarn daemons only;
+      # however, YARN_ROOT_LOGGER is shared by the yarn client and the
+      # daemons. This is restrict the EWMA appender to daemons only.
+      INVOKER="${0##*/}"
+      if [ "$INVOKER" == "yarn-daemon.sh" ]; then
+        export YARN_ROOT_LOGGER=${YARN_ROOT_LOGGER:-INFO,EWMA,RFA}
+      fi
+
+      # User for YARN daemons
+      export HADOOP_YARN_USER=${HADOOP_YARN_USER:-yarn}
+
+      # resolve links - $0 may be a softlink
+      export YARN_CONF_DIR="${YARN_CONF_DIR:-$HADOOP_YARN_HOME/conf}"
+
+      # some Java parameters
+      # export JAVA_HOME=/home/y/libexec/jdk1.6.0/
+      if [ "$JAVA_HOME" != "" ]; then
+      #echo "run java in $JAVA_HOME"
+      JAVA_HOME=$JAVA_HOME
+      fi
+
+      if [ "$JAVA_HOME" = "" ]; then
+      echo "Error: JAVA_HOME is not set."
+      exit 1
+      fi
+
+      JAVA=$JAVA_HOME/bin/java
+      JAVA_HEAP_MAX=-Xmx1000m
+
+      # For setting YARN specific HEAP sizes please use this
+      # Parameter and set appropriately
+      YARN_HEAPSIZE={{yarn_heapsize}}
+
+      # check envvars which might override default args
+      if [ "$YARN_HEAPSIZE" != "" ]; then
+      JAVA_HEAP_MAX="-Xmx""$YARN_HEAPSIZE""m"
+      fi
+
+      # Resource Manager specific parameters
+
+      # Specify the max Heapsize for the ResourceManager using a numerical value
+      # in the scale of MB. For example, to specify an jvm option of -Xmx1000m, set
+      # the value to 1000.
+      # This value will be overridden by an Xmx setting specified in either YARN_OPTS
+      # and/or YARN_RESOURCEMANAGER_OPTS.
+      # If not specified, the default value will be picked from either YARN_HEAPMAX
+      # or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
+      export YARN_RESOURCEMANAGER_HEAPSIZE={{resourcemanager_heapsize}}
+
+      # Specify the JVM options to be used when starting the ResourceManager.
+      # These options will be appended to the options specified as YARN_OPTS
+      # and therefore may override any similar flags set in YARN_OPTS
+      #export YARN_RESOURCEMANAGER_OPTS=
+
+      # Node Manager specific parameters
+
+      # Specify the max Heapsize for the NodeManager using a numerical value
+      # in the scale of MB. For example, to specify an jvm option of -Xmx1000m, set
+      # the value to 1000.
+      # This value will be overridden by an Xmx setting specified in either YARN_OPTS
+      # and/or YARN_NODEMANAGER_OPTS.
+      # If not specified, the default value will be picked from either YARN_HEAPMAX
+      # or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
+      export YARN_NODEMANAGER_HEAPSIZE={{nodemanager_heapsize}}
+
+      # Specify the max Heapsize for the timeline server using a numerical value
+      # in the scale of MB. For example, to specify an jvm option of -Xmx1000m, set
+      # the value to 1024.
+      # This value will be overridden by an Xmx setting specified in either YARN_OPTS
+      # and/or YARN_TIMELINESERVER_OPTS.
+      # If not specified, the default value will be picked from either YARN_HEAPMAX
+      # or JAVA_HEAP_MAX with YARN_HEAPMAX as the preferred option of the two.
+      export YARN_TIMELINESERVER_HEAPSIZE={{apptimelineserver_heapsize}}
+
+      # Specify the JVM options to be used when starting the NodeManager.
+      # These options will be appended to the options specified as YARN_OPTS
+      # and therefore may override any similar flags set in YARN_OPTS
+      #export YARN_NODEMANAGER_OPTS=
+
+      # so that filenames w/ spaces are handled correctly in loops below
+      IFS=
+
+
+      # default log directory and file
+      if [ "$YARN_LOG_DIR" = "" ]; then
+      YARN_LOG_DIR="$HADOOP_YARN_HOME/logs"
+      fi
+      if [ "$YARN_LOGFILE" = "" ]; then
+      YARN_LOGFILE='yarn.log'
+      fi
+
+      # default policy file for service-level authorization
+      if [ "$YARN_POLICYFILE" = "" ]; then
+      YARN_POLICYFILE="hadoop-policy.xml"
+      fi
+
+      # restore ordinary behaviour
+      unset IFS
+
+
+      YARN_OPTS="$YARN_OPTS -Dhadoop.log.dir=$YARN_LOG_DIR"
+      YARN_OPTS="$YARN_OPTS -Dyarn.log.dir=$YARN_LOG_DIR"
+      YARN_OPTS="$YARN_OPTS -Dhadoop.log.file=$YARN_LOGFILE"
+      YARN_OPTS="$YARN_OPTS -Dyarn.log.file=$YARN_LOGFILE"
+      YARN_OPTS="$YARN_OPTS -Dyarn.home.dir=$YARN_COMMON_HOME"
+      YARN_OPTS="$YARN_OPTS -Dyarn.id.str=$YARN_IDENT_STRING"
+      YARN_OPTS="$YARN_OPTS -Dhadoop.root.logger=${YARN_ROOT_LOGGER:-INFO,console}"
+      YARN_OPTS="$YARN_OPTS -Dyarn.root.logger=${YARN_ROOT_LOGGER:-INFO,console}"
+      export YARN_NODEMANAGER_OPTS="$YARN_NODEMANAGER_OPTS -Dnm.audit.logger=INFO,NMAUDIT"
+      export YARN_RESOURCEMANAGER_OPTS="$YARN_RESOURCEMANAGER_OPTS -Drm.audit.logger=INFO,RMAUDIT"
+      if [ "x$JAVA_LIBRARY_PATH" != "x" ]; then
+      YARN_OPTS="$YARN_OPTS -Djava.library.path=$JAVA_LIBRARY_PATH"
+      fi
+      YARN_OPTS="$YARN_OPTS -Dyarn.policy.file=$YARN_POLICYFILE"
+      YARN_OPTS="$YARN_OPTS -Djava.io.tmpdir={{hadoop_java_io_tmpdir}}"
+      {% if rm_security_opts is defined %}
+      YARN_OPTS="{{rm_security_opts}} $YARN_OPTS"
+      {% endif %}
+    </value>
+    <value-attributes>
+      <type>content</type>
+    </value-attributes>
+    <on-ambari-upgrade add="true"/>
+  </property>
+</configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/02984ffa/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py
index 92e2e29..e5449d3 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_historyserver.py
@@ -674,8 +674,7 @@ class TestHistoryServer(RMFTestCase):
       mode = 0644,
     )
     self.assertResourceCalled('File', '/etc/hadoop/conf/yarn-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['yarn-env']['content'] +
-                               '\nYARN_OPTS="$YARN_OPTS -Dzookeeper.sasl.client=true -Dzookeeper.sasl.client.username=zookeeper -Djava.security.auth.login.config=/usr/hdp/current/hadoop-client/conf/yarn_jaas.conf -Dzookeeper.sasl.clientconfig=Client"\n'),
+      content = InlineTemplate(self.getConfig()['configurations']['yarn-env']['content']),
       owner = 'yarn',
       group = 'hadoop',
       mode = 0755,

http://git-wip-us.apache.org/repos/asf/ambari/blob/02984ffa/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py
index 774f3c6..b05d9f2 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_mapreduce2_client.py
@@ -305,8 +305,7 @@ class TestMapReduce2Client(RMFTestCase):
       mode = 0644,
     )
     self.assertResourceCalled('File', '/etc/hadoop/conf/yarn-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['yarn-env']['content'] +
-                               '\nYARN_OPTS="$YARN_OPTS -Dzookeeper.sasl.client=true -Dzookeeper.sasl.client.username=zookeeper -Djava.security.auth.login.config=/usr/hdp/current/hadoop-client/conf/yarn_jaas.conf -Dzookeeper.sasl.clientconfig=Client"\n'),
+      content = InlineTemplate(self.getConfig()['configurations']['yarn-env']['content']),
       owner = 'yarn',
       group = 'hadoop',
       mode = 0755,

http://git-wip-us.apache.org/repos/asf/ambari/blob/02984ffa/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
index 0eb5561..10edb4b 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
@@ -487,8 +487,7 @@ class TestNodeManager(RMFTestCase):
       mode = 0644,
     )
     self.assertResourceCalled('File', '/etc/hadoop/conf/yarn-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['yarn-env']['content'] +
-                               '\nYARN_OPTS="$YARN_OPTS -Dzookeeper.sasl.client=true -Dzookeeper.sasl.client.username=zookeeper -Djava.security.auth.login.config=/usr/hdp/current/hadoop-client/conf/yarn_jaas.conf -Dzookeeper.sasl.clientconfig=Client"\n'),
+      content = InlineTemplate(self.getConfig()['configurations']['yarn-env']['content']),
       owner = 'yarn',
       group = 'hadoop',
       mode = 0755,

http://git-wip-us.apache.org/repos/asf/ambari/blob/02984ffa/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
index da93096..dc40e5e 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_resourcemanager.py
@@ -459,8 +459,7 @@ class TestResourceManager(RMFTestCase):
       mode = 0644,
     )
     self.assertResourceCalled('File', '/etc/hadoop/conf/yarn-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['yarn-env']['content'] +
-                               '\nYARN_OPTS="$YARN_OPTS -Dzookeeper.sasl.client=true -Dzookeeper.sasl.client.username=zookeeper -Djava.security.auth.login.config=/usr/hdp/current/hadoop-client/conf/yarn_jaas.conf -Dzookeeper.sasl.clientconfig=Client"\n'),
+      content = InlineTemplate(self.getConfig()['configurations']['yarn-env']['content']),
       owner = 'yarn',
       group = 'hadoop',
       mode = 0755,

http://git-wip-us.apache.org/repos/asf/ambari/blob/02984ffa/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py
index d4341e1..8873fbf 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_yarn_client.py
@@ -305,8 +305,7 @@ class TestYarnClient(RMFTestCase):
       mode = 0644,
     )
     self.assertResourceCalled('File', '/etc/hadoop/conf/yarn-env.sh',
-      content = InlineTemplate(self.getConfig()['configurations']['yarn-env']['content'] +
-        '\nYARN_OPTS="$YARN_OPTS -Dzookeeper.sasl.client=true -Dzookeeper.sasl.client.username=zookeeper -Djava.security.auth.login.config=/usr/hdp/current/hadoop-client/conf/yarn_jaas.conf -Dzookeeper.sasl.clientconfig=Client"\n'),
+      content = InlineTemplate(self.getConfig()['configurations']['yarn-env']['content']),
       owner = 'yarn',
       group = 'hadoop',
       mode = 0755,


[48/51] [abbrv] ambari git commit: AMBARI-19858 : Add nodeCount metric in AMS. (avijayan, swagle)

Posted by rz...@apache.org.
AMBARI-19858 : Add nodeCount metric in AMS. (avijayan,swagle)

(cherry picked from commit e5a7f2a50cd3a590fe1c8638b09c2fb34ef6f47c)

Change-Id: I253e2f3630379b3bc792b7215f389134564aabbf


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 8cfbd7b462f66c785ae2dbb4abb1301e2e5cd16d
Parents: 0446e4b
Author: Aravindan Vijayan <av...@hortonworks.com>
Authored: Tue Feb 7 09:58:30 2017 -0800
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 15:48:09 2017 -0800

----------------------------------------------------------------------
 .../metrics/timeline/PhoenixHBaseAccessor.java  |   6 +-
 .../TimelineMetricAppAggregator.java            |   4 +-
 .../TimelineMetricClusterAggregatorSecond.java  |  90 +++++++++------
 .../aggregators/TimelineMetricReadHelper.java   |   3 +-
 ...melineMetricClusterAggregatorSecondTest.java | 114 +++++++++++++++++--
 5 files changed, 162 insertions(+), 55 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8cfbd7b4/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
index 8d567ce..ad05025 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/PhoenixHBaseAccessor.java
@@ -153,9 +153,9 @@ public class PhoenixHBaseAccessor {
   private static final int POINTS_PER_MINUTE = 6;
   public static int RESULTSET_LIMIT = (int)TimeUnit.HOURS.toMinutes(2) * METRICS_PER_MINUTE * POINTS_PER_MINUTE ;
 
-  private static final TimelineMetricReadHelper TIMELINE_METRIC_READ_HELPER = new TimelineMetricReadHelper();
-  private static ObjectMapper mapper = new ObjectMapper();
-  private static TypeReference<TreeMap<Long, Double>> metricValuesTypeRef = new TypeReference<TreeMap<Long, Double>>() {};
+  static final TimelineMetricReadHelper TIMELINE_METRIC_READ_HELPER = new TimelineMetricReadHelper();
+  static ObjectMapper mapper = new ObjectMapper();
+  static TypeReference<TreeMap<Long, Double>> metricValuesTypeRef = new TypeReference<TreeMap<Long, Double>>() {};
 
   private final Configuration hbaseConf;
   private final Configuration metricsConf;

http://git-wip-us.apache.org/repos/asf/ambari/blob/8cfbd7b4/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricAppAggregator.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricAppAggregator.java b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricAppAggregator.java
index d7b0d55..44aca03 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricAppAggregator.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricAppAggregator.java
@@ -48,7 +48,7 @@ public class TimelineMetricAppAggregator {
   // Lookup to check candidacy of an app
   private final List<String> appIdsToAggregate;
   private final Map<String, Set<String>> hostedAppsMap;
-  Map<TimelineClusterMetric, MetricClusterAggregate> aggregateClusterMetrics;
+  Map<TimelineClusterMetric, MetricClusterAggregate> aggregateClusterMetrics = new HashMap<>();
   TimelineMetricMetadataManager metadataManagerInstance;
 
   public TimelineMetricAppAggregator(TimelineMetricMetadataManager metadataManager,
@@ -64,7 +64,7 @@ public class TimelineMetricAppAggregator {
    */
   public void init() {
     LOG.debug("Initializing aggregation cycle.");
-    aggregateClusterMetrics = new HashMap<TimelineClusterMetric, MetricClusterAggregate>();
+    aggregateClusterMetrics = new HashMap<>();
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/8cfbd7b4/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecond.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecond.java b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecond.java
index 6f3d8bc..6683c0d 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecond.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecond.java
@@ -18,8 +18,25 @@
 package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators;
 
 
+import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.SERVER_SIDE_TIMESIFT_ADJUSTMENT;
+import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.TIMELINE_METRICS_CLUSTER_AGGREGATOR_INTERPOLATION_ENABLED;
+import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.TIMELINE_METRIC_AGGREGATION_SQL_FILTERS;
+import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.PhoenixTransactSQL.GET_METRIC_SQL;
+import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.PhoenixTransactSQL.METRICS_RECORD_TABLE_NAME;
+
+import java.io.IOException;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.commons.collections.MapUtils;
 import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.mutable.MutableInt;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.metrics2.sink.timeline.PostProcessingUtil;
 import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
@@ -31,29 +48,13 @@ import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.
 import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.discovery.TimelineMetricMetadataManager;
 import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.Condition;
 import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.DefaultCondition;
-import java.io.IOException;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.HOST_APP_ID;
-import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.SERVER_SIDE_TIMESIFT_ADJUSTMENT;
-import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.TIMELINE_METRICS_CLUSTER_AGGREGATOR_INTERPOLATION_ENABLED;
-import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.PhoenixTransactSQL.GET_METRIC_SQL;
-import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.query.PhoenixTransactSQL.METRICS_RECORD_TABLE_NAME;
-import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.TimelineMetricConfiguration.TIMELINE_METRIC_AGGREGATION_SQL_FILTERS;
 
 /**
  * Aggregates a metric across all hosts in the cluster. Reads metrics from
  * the precision table and saves into the aggregate.
  */
 public class TimelineMetricClusterAggregatorSecond extends AbstractTimelineAggregator {
-  public Long timeSliceIntervalMillis;
+  Long timeSliceIntervalMillis;
   private TimelineMetricReadHelper timelineMetricReadHelper = new TimelineMetricReadHelper(true);
   // Aggregator to perform app-level aggregates for host metrics
   private final TimelineMetricAppAggregator appAggregator;
@@ -136,7 +137,7 @@ public class TimelineMetricClusterAggregatorSecond extends AbstractTimelineAggre
   /**
    * Return time slices to normalize the timeseries data.
    */
-  protected List<Long[]> getTimeSlices(long startTime, long endTime) {
+  List<Long[]> getTimeSlices(long startTime, long endTime) {
     List<Long[]> timeSlices = new ArrayList<Long[]>();
     long sliceStartTime = startTime;
     while (sliceStartTime < endTime) {
@@ -146,13 +147,13 @@ public class TimelineMetricClusterAggregatorSecond extends AbstractTimelineAggre
     return timeSlices;
   }
 
-  private Map<TimelineClusterMetric, MetricClusterAggregate> aggregateMetricsFromResultSet(ResultSet rs, List<Long[]> timeSlices)
-    throws SQLException, IOException {
+  Map<TimelineClusterMetric, MetricClusterAggregate> aggregateMetricsFromResultSet(ResultSet rs, List<Long[]> timeSlices)
+      throws SQLException, IOException {
     Map<TimelineClusterMetric, MetricClusterAggregate> aggregateClusterMetrics =
       new HashMap<TimelineClusterMetric, MetricClusterAggregate>();
-    int numLiveHosts = 0;
 
     TimelineMetric metric = null;
+    Map<String, MutableInt> hostedAppCounter = new HashMap<>();
     if (rs.next()) {
       metric = timelineMetricReadHelper.getTimelineMetricFromResultSet(rs);
 
@@ -167,7 +168,14 @@ public class TimelineMetricClusterAggregatorSecond extends AbstractTimelineAggre
         } else {
           // Process the current metric
           int numHosts = processAggregateClusterMetrics(aggregateClusterMetrics, metric, timeSlices);
-          numLiveHosts = Math.max(numHosts, numLiveHosts);
+          if (!hostedAppCounter.containsKey(metric.getAppId())) {
+            hostedAppCounter.put(metric.getAppId(), new MutableInt(numHosts));
+          } else {
+            int currentHostCount = hostedAppCounter.get(metric.getAppId()).intValue();
+            if (currentHostCount < numHosts) {
+              hostedAppCounter.put(metric.getAppId(), new MutableInt(numHosts));
+            }
+          }
           metric = nextMetric;
         }
       }
@@ -175,15 +183,22 @@ public class TimelineMetricClusterAggregatorSecond extends AbstractTimelineAggre
     // Process last metric
     if (metric != null) {
       int numHosts = processAggregateClusterMetrics(aggregateClusterMetrics, metric, timeSlices);
-      numLiveHosts = Math.max(numHosts, numLiveHosts);
+      if (!hostedAppCounter.containsKey(metric.getAppId())) {
+        hostedAppCounter.put(metric.getAppId(), new MutableInt(numHosts));
+      } else {
+        int currentHostCount = hostedAppCounter.get(metric.getAppId()).intValue();
+        if (currentHostCount < numHosts) {
+          hostedAppCounter.put(metric.getAppId(), new MutableInt(numHosts));
+        }
+      }
     }
 
     // Add app level aggregates to save
     aggregateClusterMetrics.putAll(appAggregator.getAggregateClusterMetrics());
 
-    // Add liveHosts metric.
+    // Add liveHosts per AppId metrics.
     long timestamp = timeSlices.get(timeSlices.size() - 1)[1];
-    processLiveHostsMetric(aggregateClusterMetrics, numLiveHosts, timestamp);
+    processLiveAppCountMetrics(aggregateClusterMetrics, hostedAppCounter, timestamp);
 
     return aggregateClusterMetrics;
   }
@@ -196,7 +211,6 @@ public class TimelineMetricClusterAggregatorSecond extends AbstractTimelineAggre
   protected int processAggregateClusterMetrics(Map<TimelineClusterMetric, MetricClusterAggregate> aggregateClusterMetrics,
                                               TimelineMetric metric, List<Long[]> timeSlices) {
     // Create time slices
-
     TimelineMetricMetadataKey appKey =  new TimelineMetricMetadataKey(metric.getMetricName(), metric.getAppId());
     TimelineMetricMetadata metricMetadata = metadataManagerInstance.getMetadataCacheValue(appKey);
 
@@ -209,8 +223,7 @@ public class TimelineMetricClusterAggregatorSecond extends AbstractTimelineAggre
     int numHosts = 0;
 
     if (clusterMetrics != null && !clusterMetrics.isEmpty()) {
-      for (Map.Entry<TimelineClusterMetric, Double> clusterMetricEntry :
-        clusterMetrics.entrySet()) {
+      for (Map.Entry<TimelineClusterMetric, Double> clusterMetricEntry : clusterMetrics.entrySet()) {
 
         TimelineClusterMetric clusterMetric = clusterMetricEntry.getKey();
         Double avgValue = clusterMetricEntry.getValue();
@@ -415,16 +428,21 @@ public class TimelineMetricClusterAggregatorSecond extends AbstractTimelineAggre
     return -1l;
   }
 
-  private void processLiveHostsMetric(Map<TimelineClusterMetric, MetricClusterAggregate> aggregateClusterMetrics,
-                                     int numLiveHosts, long timestamp) {
+  /* Add cluster metric for number of hosts that are hosting an appId */
+  private void processLiveAppCountMetrics(Map<TimelineClusterMetric, MetricClusterAggregate> aggregateClusterMetrics,
+      Map<String, MutableInt> appHostsCount, long timestamp) {
 
-    TimelineClusterMetric timelineClusterMetric = new TimelineClusterMetric(
-      "live_hosts", HOST_APP_ID, null, timestamp, null);
+    for (Map.Entry<String, MutableInt> appHostsEntry : appHostsCount.entrySet()) {
+      TimelineClusterMetric timelineClusterMetric = new TimelineClusterMetric(
+        "live_hosts", appHostsEntry.getKey(), null, timestamp, null);
 
-    MetricClusterAggregate metricClusterAggregate = new MetricClusterAggregate((double) numLiveHosts,
-      1, null, (double) numLiveHosts, (double) numLiveHosts);
+      Integer numOfHosts = appHostsEntry.getValue().intValue();
 
-    aggregateClusterMetrics.put(timelineClusterMetric, metricClusterAggregate);
-  }
+      MetricClusterAggregate metricClusterAggregate = new MetricClusterAggregate(
+        (double) numOfHosts, 1, null, (double) numOfHosts, (double) numOfHosts);
 
+      aggregateClusterMetrics.put(timelineClusterMetric, metricClusterAggregate);
+    }
+
+  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/8cfbd7b4/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricReadHelper.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricReadHelper.java b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricReadHelper.java
index 7a74e24..b5f49fb 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricReadHelper.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/main/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricReadHelper.java
@@ -41,8 +41,7 @@ public class TimelineMetricReadHelper {
   public TimelineMetric getTimelineMetricFromResultSet(ResultSet rs)
       throws SQLException, IOException {
     TimelineMetric metric = getTimelineMetricCommonsFromResultSet(rs);
-    TreeMap<Long, Double> sortedByTimeMetrics =
-      PhoenixHBaseAccessor.readMetricFromJSON(rs.getString("METRICS"));
+    TreeMap<Long, Double> sortedByTimeMetrics = PhoenixHBaseAccessor.readMetricFromJSON(rs.getString("METRICS"));
     metric.setMetricValues(sortedByTimeMetrics);
     return metric;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/8cfbd7b4/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecondTest.java
----------------------------------------------------------------------
diff --git a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecondTest.java b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecondTest.java
index 58d908a..2297036 100644
--- a/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecondTest.java
+++ b/ambari-metrics/ambari-metrics-timelineservice/src/test/java/org/apache/hadoop/yarn/server/applicationhistoryservice/metrics/timeline/aggregators/TimelineMetricClusterAggregatorSecondTest.java
@@ -17,19 +17,26 @@
  */
 package org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.aggregators;
 
-import junit.framework.Assert;
+import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.availability.AggregationTaskRunner.AGGREGATOR_NAME.METRIC_AGGREGATE_SECOND;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.createNiceMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+
+import java.sql.ResultSet;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.metrics2.sink.timeline.TimelineMetric;
 import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.discovery.TimelineMetricMetadataKey;
 import org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.discovery.TimelineMetricMetadataManager;
-import org.easymock.EasyMock;
+import org.codehaus.jackson.map.ObjectMapper;
 import org.junit.Test;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-import static org.apache.hadoop.yarn.server.applicationhistoryservice.metrics.timeline.availability.AggregationTaskRunner.AGGREGATOR_NAME.METRIC_AGGREGATE_SECOND;
+
+import junit.framework.Assert;
 
 public class TimelineMetricClusterAggregatorSecondTest {
 
@@ -41,7 +48,7 @@ public class TimelineMetricClusterAggregatorSecondTest {
     long metricInterval = 10000l;
 
     Configuration configuration = new Configuration();
-    TimelineMetricMetadataManager metricMetadataManagerMock = EasyMock.createNiceMock(TimelineMetricMetadataManager.class);
+    TimelineMetricMetadataManager metricMetadataManagerMock = createNiceMock(TimelineMetricMetadataManager.class);
 
     TimelineMetricClusterAggregatorSecond secondAggregator = new TimelineMetricClusterAggregatorSecond(
       METRIC_AGGREGATE_SECOND, metricMetadataManagerMock, null,
@@ -113,11 +120,11 @@ public class TimelineMetricClusterAggregatorSecondTest {
     long sliceInterval = 30000l;
 
     Configuration configuration = new Configuration();
-    TimelineMetricMetadataManager metricMetadataManagerMock = EasyMock.createNiceMock(TimelineMetricMetadataManager.class);
+    TimelineMetricMetadataManager metricMetadataManagerMock = createNiceMock(TimelineMetricMetadataManager.class);
 
-    EasyMock.expect(metricMetadataManagerMock.getMetadataCacheValue((TimelineMetricMetadataKey)EasyMock.anyObject()))
+    expect(metricMetadataManagerMock.getMetadataCacheValue((TimelineMetricMetadataKey) anyObject()))
       .andReturn(null).anyTimes();
-    EasyMock.replay(metricMetadataManagerMock);
+    replay(metricMetadataManagerMock);
 
     TimelineMetricClusterAggregatorSecond secondAggregator = new TimelineMetricClusterAggregatorSecond(
       METRIC_AGGREGATE_SECOND, metricMetadataManagerMock, null, configuration, null,
@@ -312,4 +319,87 @@ public class TimelineMetricClusterAggregatorSecondTest {
 
   }
 
+  @Test
+  public void testLiveHostCounterMetrics() throws Exception {
+    long aggregatorInterval = 120000;
+    long sliceInterval = 30000;
+
+    Configuration configuration = new Configuration();
+    TimelineMetricMetadataManager metricMetadataManagerMock = createNiceMock(TimelineMetricMetadataManager.class);
+
+    expect(metricMetadataManagerMock.getMetadataCacheValue((TimelineMetricMetadataKey) anyObject())).andReturn(null).anyTimes();
+    replay(metricMetadataManagerMock);
+
+    TimelineMetricClusterAggregatorSecond secondAggregator = new TimelineMetricClusterAggregatorSecond(
+      METRIC_AGGREGATE_SECOND, metricMetadataManagerMock, null, configuration, null,
+      aggregatorInterval, 2, "false", "", "", aggregatorInterval,
+      sliceInterval, null);
+
+    long now = System.currentTimeMillis();
+    long startTime = now - 120000;
+    long seconds = 1000;
+    List<Long[]> slices = secondAggregator.getTimeSlices(startTime, now);
+    ResultSet rs = createNiceMock(ResultSet.class);
+
+    TreeMap<Long, Double> metricValues = new TreeMap<>();
+    metricValues.put(startTime + 15*seconds, 1.0);
+    metricValues.put(startTime + 45*seconds, 2.0);
+    metricValues.put(startTime + 75*seconds, 3.0);
+    metricValues.put(startTime + 105*seconds, 4.0);
+
+    expect(rs.next()).andReturn(true).times(6);
+    expect(rs.next()).andReturn(false);
+
+    /*
+    m1-h1-a1
+    m2-h1-a1
+    m2-h1-a2
+    m2-h2-a1
+    m2-h2-a2
+    m2-h3-a2
+
+    So live_hosts : a1 = 2
+       live_hosts : a2 = 3
+     */
+    expect(rs.getString("METRIC_NAME")).andReturn("m1").times(1);
+    expect(rs.getString("METRIC_NAME")).andReturn("m2").times(5);
+
+    expect(rs.getString("HOSTNAME")).andReturn("h1").times(3);
+    expect(rs.getString("HOSTNAME")).andReturn("h2").times(2);
+    expect(rs.getString("HOSTNAME")).andReturn("h3").times(1);
+
+    expect(rs.getString("APP_ID")).andReturn("a1").times(2);
+    expect(rs.getString("APP_ID")).andReturn("a2").times(1);
+    expect(rs.getString("APP_ID")).andReturn("a1").times(1);
+    expect(rs.getString("APP_ID")).andReturn("a2").times(2);
+
+    expect(rs.getLong("SERVER_TIME")).andReturn(now - 150000).times(6);
+    expect(rs.getLong("START_TIME")).andReturn(now - 150000).times(6);
+    expect(rs.getString("UNITS")).andReturn(null).times(6);
+
+    ObjectMapper mapper = new ObjectMapper();
+    expect(rs.getString("METRICS")).andReturn(mapper.writeValueAsString(metricValues)).times(6);
+
+    replay(rs);
+
+    Map<TimelineClusterMetric, MetricClusterAggregate> aggregates = secondAggregator.aggregateMetricsFromResultSet(rs, slices);
+
+    Assert.assertNotNull(aggregates);
+
+    MetricClusterAggregate a1 = null, a2 = null;
+
+    for (Map.Entry<TimelineClusterMetric, MetricClusterAggregate> m : aggregates.entrySet()) {
+      if (m.getKey().getMetricName().equals("live_hosts") && m.getKey().getAppId().equals("a1")) {
+        a1 = m.getValue();
+      }
+      if (m.getKey().getMetricName().equals("live_hosts") && m.getKey().getAppId().equals("a2")) {
+        a2 = m.getValue();
+      }
+    }
+
+    Assert.assertNotNull(a1);
+    Assert.assertNotNull(a2);
+    Assert.assertEquals(2d, a1.getSum());
+    Assert.assertEquals(3d, a2.getSum());
+  }
 }


[36/51] [abbrv] ambari git commit: AMBARI-19799. Optimize DB initialization for Ambari Server Unit Tests. Additional fixes 2. (mpapirkovskyy)

Posted by rz...@apache.org.
AMBARI-19799. Optimize DB initialization for Ambari Server Unit Tests. Additional fixes 2. (mpapirkovskyy)

(cherry picked from commit 4dea63774aae481b36376cce65a11bfa28cfefa3)

Change-Id: I2ac9fa67e829391be0f5189e691af752f45a8b1a


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 21af204d51d1b480b55e291553dd0c95c81dda0b
Parents: a08d0bf
Author: Myroslav Papirkovskyi <mp...@hortonworks.com>
Authored: Thu Feb 2 02:03:00 2017 +0200
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 06:54:02 2017 -0800

----------------------------------------------------------------------
 .../server/controller/ControllerModule.java     | 18 ++--
 .../apache/ambari/server/H2DatabaseCleaner.java | 91 ++++++++++++++------
 .../ambari/server/orm/dao/CrudDAOTest.java      |  5 +-
 .../ambari/server/orm/dao/UpgradeDAOTest.java   | 16 ++--
 .../ComponentVersionCheckActionTest.java        | 29 +++++--
 .../upgrades/UpgradeActionTest.java             | 74 +++++++++++-----
 .../ambari/server/state/ConfigHelperTest.java   | 14 ++-
 .../state/cluster/AlertDataManagerTest.java     |  1 +
 pom.xml                                         |  4 +
 9 files changed, 175 insertions(+), 77 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/21af204d/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
index 14a0ab4..efff4ea 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java
@@ -215,14 +215,6 @@ public class ControllerModule extends AbstractModule {
     DatabaseType databaseType = configuration.getDatabaseType();
     LOG.info("Detected {} as the database type from the JDBC URL", databaseType);
 
-    // custom jdbc driver properties
-    Properties customDatabaseDriverProperties = configuration.getDatabaseCustomProperties();
-    properties.putAll(customDatabaseDriverProperties);
-
-    // custom persistence properties
-    Properties customPersistenceProperties = configuration.getPersistenceCustomProperties();
-    properties.putAll(customPersistenceProperties);
-
     switch (configuration.getPersistenceType()) {
       case IN_MEMORY:
         properties.setProperty(JDBC_URL, Configuration.JDBC_IN_MEMORY_URL);
@@ -230,7 +222,6 @@ public class ControllerModule extends AbstractModule {
         properties.setProperty(JDBC_USER, Configuration.JDBC_IN_MEMORY_USER);
         properties.setProperty(JDBC_PASSWORD, Configuration.JDBC_IN_MEMORY_PASSWORD);
         properties.setProperty(DDL_GENERATION, CREATE_ONLY);
-        properties.setProperty(DDL_GENERATION_MODE, DDL_BOTH_GENERATION);
         properties.setProperty(THROW_EXCEPTIONS, "true");
       case REMOTE:
         properties.setProperty(JDBC_URL, configuration.getDatabaseUrl());
@@ -242,6 +233,15 @@ public class ControllerModule extends AbstractModule {
         break;
     }
 
+    //allow to override values above
+    // custom jdbc driver properties
+    Properties customDatabaseDriverProperties = configuration.getDatabaseCustomProperties();
+    properties.putAll(customDatabaseDriverProperties);
+
+    // custom persistence properties
+    Properties customPersistenceProperties = configuration.getPersistenceCustomProperties();
+    properties.putAll(customPersistenceProperties);
+
     // determine the type of pool to use
     boolean isConnectionPoolingExternal = false;
     ConnectionPoolType connectionPoolType = configuration.getConnectionPoolType();

http://git-wip-us.apache.org/repos/asf/ambari/blob/21af204d/ambari-server/src/test/java/org/apache/ambari/server/H2DatabaseCleaner.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/H2DatabaseCleaner.java b/ambari-server/src/test/java/org/apache/ambari/server/H2DatabaseCleaner.java
index 91477eb..493e88b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/H2DatabaseCleaner.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/H2DatabaseCleaner.java
@@ -26,6 +26,7 @@ import java.nio.file.Files;
 import java.nio.file.Paths;
 import java.sql.Connection;
 import java.sql.DriverManager;
+import java.sql.PreparedStatement;
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.ArrayList;
@@ -39,13 +40,69 @@ import javax.persistence.metamodel.EntityType;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.orm.DBAccessorImpl;
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
 
 import com.google.inject.Injector;
 import com.google.inject.persist.PersistService;
 
 public class H2DatabaseCleaner {
-  private static final String SEQ_INSERT_PREFIX = "INSERT INTO ambari_sequences";
-  private static List<String> seqInsertStatements;
+  private static final String SEQ_STATEMENT =
+      "INSERT INTO ambari_sequences(sequence_name, sequence_value) values (?, 0);";
+  private static List<String> sequenceList = new ArrayList<>();
+
+  static {
+        sequenceList.add("extension_id_seq");
+        sequenceList.add("resource_id_seq");
+        sequenceList.add("alert_target_id_seq");
+        sequenceList.add("topology_request_id_seq");
+        sequenceList.add("setting_id_seq");
+        sequenceList.add("principal_type_id_seq");
+        sequenceList.add("group_id_seq");
+        sequenceList.add("remote_cluster_id_seq");
+        sequenceList.add("privilege_id_seq");
+        sequenceList.add("servicecomponent_history_id_seq");
+        sequenceList.add("permission_id_seq");
+        sequenceList.add("principal_id_seq");
+        sequenceList.add("repo_version_id_seq");
+        sequenceList.add("cluster_version_id_seq");
+        sequenceList.add("topology_host_task_id_seq");
+        sequenceList.add("topology_logical_task_id_seq");
+        sequenceList.add("host_id_seq");
+        sequenceList.add("servicecomponentdesiredstate_id_seq");
+        sequenceList.add("configgroup_id_seq");
+        sequenceList.add("topology_host_group_id_seq");
+        sequenceList.add("upgrade_item_id_seq");
+        sequenceList.add("requestschedule_id_seq");
+        sequenceList.add("blueprint_setting_id_seq");
+        sequenceList.add("host_version_id_seq");
+        sequenceList.add("hostcomponentstate_id_seq");
+        sequenceList.add("cluster_id_seq");
+        sequenceList.add("view_instance_id_seq");
+        sequenceList.add("resourcefilter_id_seq");
+        sequenceList.add("alert_group_id_seq");
+        sequenceList.add("link_id_seq");
+        sequenceList.add("topology_host_info_id_seq");
+        sequenceList.add("viewentity_id_seq");
+        sequenceList.add("alert_notice_id_seq");
+        sequenceList.add("user_id_seq");
+        sequenceList.add("upgrade_id_seq");
+        sequenceList.add("stack_id_seq");
+        sequenceList.add("alert_current_id_seq");
+        sequenceList.add("widget_id_seq");
+        sequenceList.add("remote_cluster_service_id_seq");
+        sequenceList.add("alert_history_id_seq");
+        sequenceList.add("config_id_seq");
+        sequenceList.add("upgrade_group_id_seq");
+        sequenceList.add("member_id_seq");
+        sequenceList.add("service_config_id_seq");
+        sequenceList.add("widget_layout_id_seq");
+        sequenceList.add("hostcomponentdesiredstate_id_seq");
+        sequenceList.add("operation_level_id_seq");
+        sequenceList.add("servicecomponent_version_id_seq");
+        sequenceList.add("host_role_command_id_seq");
+        sequenceList.add("alert_definition_id_seq");
+        sequenceList.add("resource_type_id_seq");
+  }
 
   public static void clearDatabaseAndStopPersistenceService(Injector injector) throws AmbariException, SQLException {
     clearDatabase(injector.getProvider(EntityManager.class).get());
@@ -57,34 +114,20 @@ public class H2DatabaseCleaner {
       Configuration.JDBC_IN_MEMORY_USER, Configuration.JDBC_IN_MEMORY_PASSWORD);
   }
 
-  private static List<String> collectSequenceInserts() {
-    try {
-      ArrayList<String> statementList = new ArrayList<>();
-      for (String s : Files.readAllLines(Paths.get(DEFAULT_CREATE_JDBC_FILE_NAME), Charset.defaultCharset())) {
-        if (s.startsWith(SEQ_INSERT_PREFIX)) {
-          statementList.add(s);
-        }
-      }
-      return statementList;
-    } catch (IOException e) {
-      return Collections.emptyList();
-    }
-  }
-
   //TODO all tests this method is used in should be modified to remove hardcoded IDs
   public static void resetSequences(Injector injector) {
     DBAccessorImpl dbAccessor = injector.getInstance(DBAccessorImpl.class);
     try {
       if (dbAccessor.tableExists("ambari_sequences")) {
-        if (seqInsertStatements == null) {
-          seqInsertStatements = collectSequenceInserts();
-        }
-        if (!CollectionUtils.isEmpty(seqInsertStatements)) {
-          dbAccessor.truncateTable("ambari_sequences");
-
-          for (String insert : seqInsertStatements) {
-            dbAccessor.executeUpdate(insert);
+        dbAccessor.truncateTable("ambari_sequences");
+        PreparedStatement preparedStatement = dbAccessor.getConnection().prepareStatement(SEQ_STATEMENT);
+        try {
+          for (String sequenceName : sequenceList) {
+            preparedStatement.setString(1, sequenceName);
+            preparedStatement.executeUpdate();
           }
+        } finally {
+          preparedStatement.close();
         }
 
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/21af204d/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/CrudDAOTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/CrudDAOTest.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/CrudDAOTest.java
index af54653..f3db856 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/CrudDAOTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/CrudDAOTest.java
@@ -54,11 +54,12 @@ public class CrudDAOTest {
   @Before
   public void before() {
     injector = Guice.createInjector(new InMemoryDefaultTestModule());
-    stackDAO = injector.getInstance(StackDAO.class);
-    repositoryVersionDAO = injector.getInstance(RepositoryVersionDAO.class);
     H2DatabaseCleaner.resetSequences(injector);
     injector.getInstance(GuiceJpaInitializer.class);
 
+    stackDAO = injector.getInstance(StackDAO.class);
+    repositoryVersionDAO = injector.getInstance(RepositoryVersionDAO.class);
+
     // required to populate stacks into the database
     injector.getInstance(AmbariMetaInfo.class);
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/21af204d/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/UpgradeDAOTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/UpgradeDAOTest.java b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/UpgradeDAOTest.java
index 3c5970d..dc30c6c 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/UpgradeDAOTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/orm/dao/UpgradeDAOTest.java
@@ -80,7 +80,7 @@ public class UpgradeDAOTest {
 
     // create upgrade entities
     UpgradeEntity entity = new UpgradeEntity();
-    entity.setClusterId(Long.valueOf(1));
+    entity.setClusterId(clusterId.longValue());
     entity.setRequestId(Long.valueOf(1));
     entity.setFromVersion("");
     entity.setToVersion("");
@@ -150,14 +150,14 @@ public class UpgradeDAOTest {
     // create upgrade entities
     RequestEntity requestEntity = new RequestEntity();
     requestEntity.setRequestId(1L);
-    requestEntity.setClusterId(1L);
+    requestEntity.setClusterId(clusterId.longValue());
     requestEntity.setStatus(HostRoleStatus.PENDING);
     requestEntity.setStages(new ArrayList<StageEntity>());
     requestDAO.create(requestEntity);
 
     UpgradeEntity entity1 = new UpgradeEntity();
     entity1.setId(11L);
-    entity1.setClusterId(1L);
+    entity1.setClusterId(clusterId.longValue());
     entity1.setDirection(Direction.UPGRADE);
     entity1.setRequestId(1L);
     entity1.setFromVersion("2.2.0.0-1234");
@@ -168,7 +168,7 @@ public class UpgradeDAOTest {
     dao.create(entity1);
     UpgradeEntity entity2 = new UpgradeEntity();
     entity2.setId(22L);
-    entity2.setClusterId(1L);
+    entity2.setClusterId(clusterId.longValue());
     entity2.setDirection(Direction.DOWNGRADE);
     entity2.setRequestId(1L);
     entity2.setFromVersion("2.3.0.0-4567");
@@ -179,7 +179,7 @@ public class UpgradeDAOTest {
     dao.create(entity2);
     UpgradeEntity entity3 = new UpgradeEntity();
     entity3.setId(33L);
-    entity3.setClusterId(1L);
+    entity3.setClusterId(clusterId.longValue());
     entity3.setDirection(Direction.UPGRADE);
     entity3.setRequestId(1L);
     entity3.setFromVersion("2.2.0.0-1234");
@@ -188,7 +188,7 @@ public class UpgradeDAOTest {
     entity3.setUpgradePackage("test-upgrade");
     entity3.setDowngradeAllowed(true);
     dao.create(entity3);
-    UpgradeEntity lastUpgradeForCluster = dao.findLastUpgradeForCluster(1, Direction.UPGRADE);
+    UpgradeEntity lastUpgradeForCluster = dao.findLastUpgradeForCluster(clusterId.longValue(), Direction.UPGRADE);
     assertNotNull(lastUpgradeForCluster);
     assertEquals(33L, (long)lastUpgradeForCluster.getId());
   }
@@ -202,14 +202,14 @@ public class UpgradeDAOTest {
   public void testUpdatableColumns() throws Exception {
     RequestEntity requestEntity = new RequestEntity();
     requestEntity.setRequestId(1L);
-    requestEntity.setClusterId(1L);
+    requestEntity.setClusterId(clusterId.longValue());
     requestEntity.setStatus(HostRoleStatus.PENDING);
     requestEntity.setStages(new ArrayList<StageEntity>());
     requestDAO.create(requestEntity);
 
     UpgradeEntity upgradeEntity = new UpgradeEntity();
     upgradeEntity.setId(11L);
-    upgradeEntity.setClusterId(1L);
+    upgradeEntity.setClusterId(clusterId.longValue());
     upgradeEntity.setDirection(Direction.UPGRADE);
     upgradeEntity.setRequestId(1L);
     upgradeEntity.setFromVersion("2.2.0.0-1234");

http://git-wip-us.apache.org/repos/asf/ambari/blob/21af204d/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
index ffbb6f7..ceaa83a 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/ComponentVersionCheckActionTest.java
@@ -64,10 +64,13 @@ import org.apache.ambari.server.state.ServiceComponentHostFactory;
 import org.apache.ambari.server.state.ServiceFactory;
 import org.apache.ambari.server.state.StackId;
 import org.apache.ambari.server.state.State;
+import org.apache.ambari.server.utils.EventBusSynchronizer;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import com.google.inject.Guice;
 import com.google.inject.Inject;
@@ -78,6 +81,9 @@ import com.google.inject.persist.UnitOfWork;
  * Tests upgrade-related server side actions
  */
 public class ComponentVersionCheckActionTest {
+  private static final Logger LOG = LoggerFactory.getLogger(ComponentVersionCheckActionTest.class);
+
+
   private static final String HDP_2_1_1_0 = "2.1.1.0-1";
   private static final String HDP_2_1_1_1 = "2.1.1.1-2";
 
@@ -120,6 +126,7 @@ public class ComponentVersionCheckActionTest {
   @Before
   public void setup() throws Exception {
     m_injector = Guice.createInjector(new InMemoryDefaultTestModule());
+    EventBusSynchronizer.synchronizeAmbariEventPublisher(m_injector);
     m_injector.getInstance(GuiceJpaInitializer.class);
     m_injector.injectMembers(this);
     m_injector.getInstance(UnitOfWork.class).begin();
@@ -185,9 +192,8 @@ public class ComponentVersionCheckActionTest {
     hostVersionDAO.create(entity);
   }
 
-  private void makeCrossStackUpgradeCluster(StackId sourceStack, String sourceRepo, StackId targetStack, String targetRepo) throws Exception {
-    String clusterName = "c1";
-    String hostName = "h1";
+  private void makeCrossStackUpgradeCluster(StackId sourceStack, String sourceRepo, StackId targetStack,
+                                            String targetRepo, String clusterName, String hostName) throws Exception {
 
     Clusters clusters = m_injector.getInstance(Clusters.class);
     clusters.addCluster(clusterName, sourceStack);
@@ -219,6 +225,16 @@ public class ComponentVersionCheckActionTest {
     c.createClusterVersion(sourceStack, sourceRepo, "admin", RepositoryVersionState.INSTALLING);
     c.transitionClusterVersion(sourceStack, sourceRepo, RepositoryVersionState.CURRENT);
 
+  }
+
+  private void createNewRepoVersion(StackId targetStack, String targetRepo, String clusterName,
+                                    String hostName) throws AmbariException {
+    Clusters clusters = m_injector.getInstance(Clusters.class);
+    StackDAO stackDAO = m_injector.getInstance(StackDAO.class);
+
+    StackEntity stackEntityTarget = stackDAO.find(targetStack.getStackName(), targetStack.getStackVersion());
+
+    Cluster c = clusters.getCluster(clusterName);
     // Create the new repo version
     String urlInfo = "[{'repositories':["
         + "{'Repositories/base_url':'http://foo1','Repositories/repo_name':'HDP','Repositories/repo_id':'" + targetRepo + "'}"
@@ -285,8 +301,10 @@ public class ComponentVersionCheckActionTest {
     StackId targetStack = HDP_22_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_2_1_0;
+    String clusterName = "c1";
+    String hostName = "h1";
 
-    makeCrossStackUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
+    makeCrossStackUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo, clusterName, hostName);
 
     Clusters clusters = m_injector.getInstance(Clusters.class);
     Cluster cluster = clusters.getCluster("c1");
@@ -297,9 +315,10 @@ public class ComponentVersionCheckActionTest {
     createNewServiceComponentHost(cluster, "HDFS", "NAMENODE", "h1");
     createNewServiceComponentHost(cluster, "HDFS", "DATANODE", "h1");
 
+    createNewRepoVersion(targetStack, targetRepo, clusterName, hostName);
+
     // create some configs
     createConfigs(cluster);
-
     // setup the cluster for the upgrade across stacks
     cluster.setCurrentStackVersion(sourceStack);
     cluster.setDesiredStackVersion(targetStack);

http://git-wip-us.apache.org/repos/asf/ambari/blob/21af204d/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
index 42a4ac5..bb76a71 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/upgrades/UpgradeActionTest.java
@@ -85,6 +85,7 @@ import org.apache.ambari.server.state.State;
 import org.apache.ambari.server.state.stack.UpgradePack;
 import org.apache.ambari.server.state.stack.upgrade.Direction;
 import org.apache.ambari.server.state.stack.upgrade.UpgradeType;
+import org.apache.ambari.server.utils.EventBusSynchronizer;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -161,6 +162,7 @@ public class UpgradeActionTest {
   @Before
   public void setup() throws Exception {
     m_injector = Guice.createInjector(new InMemoryDefaultTestModule());
+    EventBusSynchronizer.synchronizeAmbariEventPublisher(m_injector);
     m_injector.getInstance(GuiceJpaInitializer.class);
     m_injector.injectMembers(this);
     m_injector.getInstance(UnitOfWork.class).begin();
@@ -275,15 +277,13 @@ public class UpgradeActionTest {
     hostVersionDAO.create(entityTarget);
   }
 
-  private void makeUpgradeCluster(StackId sourceStack, String sourceRepo, StackId targetStack, String targetRepo) throws Exception {
-    String hostName = "h1";
+  private void createUpgradeClusterAndSourceRepo(StackId sourceStack, String sourceRepo,
+                                                 String hostName) throws Exception {
 
     clusters.addCluster(clusterName, sourceStack);
 
     StackEntity stackEntitySource = stackDAO.find(sourceStack.getStackName(), sourceStack.getStackVersion());
-    StackEntity stackEntityTarget = stackDAO.find(targetStack.getStackName(), targetStack.getStackVersion());
     assertNotNull(stackEntitySource);
-    assertNotNull(stackEntityTarget);
 
     Cluster c = clusters.getCluster(clusterName);
     c.setDesiredStackVersion(sourceStack);
@@ -320,6 +320,14 @@ public class UpgradeActionTest {
     c.createClusterVersion(sourceStack, sourceRepo, "admin", RepositoryVersionState.INSTALLING);
     c.transitionClusterVersion(sourceStack, sourceRepo, RepositoryVersionState.CURRENT);
 
+  }
+
+  private void createUpgradeClusterTargetRepo(StackId targetStack, String targetRepo,
+                                              String hostName) throws AmbariException {
+    Cluster c = clusters.getCluster(clusterName);
+    StackEntity stackEntityTarget = stackDAO.find(targetStack.getStackName(), targetStack.getStackVersion());
+    assertNotNull(stackEntityTarget);
+
     // Create the new repo version
     String urlInfo = "[{'repositories':["
             + "{'Repositories/base_url':'http://foo1','Repositories/repo_name':'HDP','Repositories/repo_id':'" + targetStack.getStackId() + "'}"
@@ -354,16 +362,14 @@ public class UpgradeActionTest {
     assertEquals(RepositoryVersionState.INSTALLED, hostVersions.get(0).getState());
   }
 
-  private void makeCrossStackUpgradeCluster(StackId sourceStack, String sourceRepo, StackId targetStack, String targetRepo) throws Exception {
-    String hostName = "h1";
+  private void makeCrossStackUpgradeClusterAndSourceRepo(StackId sourceStack, String sourceRepo,
+                                                         String hostName)throws Exception {
 
     clusters.addCluster(clusterName, sourceStack);
 
     StackEntity stackEntitySource = stackDAO.find(sourceStack.getStackName(), sourceStack.getStackVersion());
-    StackEntity stackEntityTarget = stackDAO.find(targetStack.getStackName(), targetStack.getStackVersion());
 
     assertNotNull(stackEntitySource);
-    assertNotNull(stackEntityTarget);
 
     Cluster c = clusters.getCluster(clusterName);
     c.setCurrentStackVersion(sourceStack);
@@ -384,11 +390,18 @@ public class UpgradeActionTest {
     m_helper.getOrCreateRepositoryVersion(sourceStack, sourceRepo);
     c.createClusterVersion(sourceStack, sourceRepo, "admin", RepositoryVersionState.INSTALLING);
     c.transitionClusterVersion(sourceStack, sourceRepo, RepositoryVersionState.CURRENT);
+  }
+
+  private void makeCrossStackUpgradeTargetRepo(StackId targetStack, String targetRepo, String hostName) throws Exception{
+    StackEntity stackEntityTarget = stackDAO.find(targetStack.getStackName(), targetStack.getStackVersion());
+    assertNotNull(stackEntityTarget);
+    Cluster c = clusters.getCluster(clusterName);
+
 
     // Create the new repo version
     String urlInfo = "[{'repositories':["
-            + "{'Repositories/base_url':'http://foo1','Repositories/repo_name':'HDP','Repositories/repo_id':'" + targetRepo + "'}"
-            + "], 'OperatingSystems/os_type':'redhat6'}]";
+        + "{'Repositories/base_url':'http://foo1','Repositories/repo_name':'HDP','Repositories/repo_id':'" + targetRepo + "'}"
+        + "], 'OperatingSystems/os_type':'redhat6'}]";
     repoVersionDAO.create(stackEntityTarget, targetRepo, String.valueOf(System.currentTimeMillis()), urlInfo);
 
     // Start upgrading the newer repo
@@ -396,7 +409,7 @@ public class UpgradeActionTest {
     c.transitionClusterVersion(targetStack, targetRepo, RepositoryVersionState.INSTALLED);
 
     c.mapHostVersions(Collections.singleton(hostName), c.getCurrentClusterVersion(),
-            RepositoryVersionState.CURRENT);
+        RepositoryVersionState.CURRENT);
 
     HostDAO hostDAO = m_injector.getInstance(HostDAO.class);
 
@@ -418,6 +431,7 @@ public class UpgradeActionTest {
     StackId targetStack = HDP_22_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_2_0_1;
+    String hostName = "h1";
 
     // Must be a NON_ROLLING upgrade that jumps stacks in order for it to apply config changes.
     // That upgrade pack has changes for ZK and NameNode.
@@ -426,10 +440,8 @@ public class UpgradeActionTest {
     Map<String, UpgradePack> packs = ambariMetaInfo.getUpgradePacks(sourceStack.getStackName(), sourceStack.getStackVersion());
     Assert.assertTrue(packs.containsKey(upgradePackName));
 
-    makeCrossStackUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
-
-    RepositoryVersionEntity targetRve = repoVersionDAO.findByStackNameAndVersion("HDP", targetRepo);
-    Assert.assertNotNull(targetRve);
+    makeCrossStackUpgradeClusterAndSourceRepo(sourceStack, sourceRepo, hostName);
+//    makeCrossStackUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
 
     Cluster cluster = clusters.getCluster(clusterName);
 
@@ -446,6 +458,11 @@ public class UpgradeActionTest {
     createNewServiceComponentHost(cluster, "HDFS", "NAMENODE", "h1");
     createNewServiceComponentHost(cluster, "HDFS", "DATANODE", "h1");
 
+    makeCrossStackUpgradeTargetRepo(targetStack, targetRepo, hostName);
+
+    RepositoryVersionEntity targetRve = repoVersionDAO.findByStackNameAndVersion("HDP", targetRepo);
+    Assert.assertNotNull(targetRve);
+
     // Create some configs
     createConfigs(cluster);
     Collection<Config> configs = cluster.getAllConfigs();
@@ -583,8 +600,10 @@ public class UpgradeActionTest {
     StackId targetStack = HDP_21_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_1_1_1;
+    String hostName = "h1";
 
-    makeUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
+    createUpgradeClusterAndSourceRepo(sourceStack, sourceRepo, hostName);
+    createUpgradeClusterTargetRepo(targetStack, targetRepo, hostName);
 
     // Verify the repo before calling Finalize
     AmbariCustomCommandExecutionHelper helper = m_injector.getInstance(AmbariCustomCommandExecutionHelper.class);
@@ -630,8 +649,10 @@ public class UpgradeActionTest {
     StackId targetStack = HDP_21_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_1_1_1;
+    String hostName = "h1";
 
-    makeUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
+    createUpgradeClusterAndSourceRepo(sourceStack, sourceRepo, hostName);
+    createUpgradeClusterTargetRepo(targetStack, targetRepo, hostName);
 
     // move the old version from CURRENT to INSTALLED and the new version from
     // UPGRADED to CURRENT - this will simulate what happens when a host is
@@ -696,8 +717,10 @@ public class UpgradeActionTest {
     StackId targetStack = HDP_22_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_2_0_1;
+    String hostName = "h1";
 
-    makeCrossStackUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
+    makeCrossStackUpgradeClusterAndSourceRepo(sourceStack, sourceRepo, hostName);
+    makeCrossStackUpgradeTargetRepo(targetStack, targetRepo, hostName);
 
     Cluster cluster = clusters.getCluster(clusterName);
 
@@ -747,10 +770,12 @@ public class UpgradeActionTest {
     StackId targetStack = HDP_22_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_2_0_1;
+    String hostName = "h1";
 
-    makeCrossStackUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
+    makeCrossStackUpgradeClusterAndSourceRepo(sourceStack, sourceRepo, hostName);
     Cluster cluster = clusters.getCluster(clusterName);
 
+
     // install HDFS with some components
     Service service = installService(cluster, "HDFS");
     addServiceComponent(cluster, service, "NAMENODE");
@@ -758,6 +783,8 @@ public class UpgradeActionTest {
     createNewServiceComponentHost(cluster, "HDFS", "NAMENODE", "h1");
     createNewServiceComponentHost(cluster, "HDFS", "DATANODE", "h1");
 
+    makeCrossStackUpgradeTargetRepo(targetStack, targetRepo, hostName);
+
     // create some configs
     createConfigs(cluster);
 
@@ -836,8 +863,9 @@ public class UpgradeActionTest {
     StackId targetStack = HDP_22_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_2_0_1;
+    String hostName = "h1";
 
-    makeCrossStackUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
+    makeCrossStackUpgradeClusterAndSourceRepo(sourceStack, sourceRepo, hostName);
 
     Cluster cluster = clusters.getCluster(clusterName);
 
@@ -847,6 +875,7 @@ public class UpgradeActionTest {
     createNewServiceComponentHost(cluster, "HDFS", "NAMENODE", "h1");
     createNewServiceComponentHost(cluster, "HDFS", "DATANODE", "h1");
 
+    makeCrossStackUpgradeTargetRepo(targetStack, targetRepo, hostName);
     // create some configs
     createConfigs(cluster);
 
@@ -915,8 +944,9 @@ public class UpgradeActionTest {
     StackId targetStack = HDP_21_STACK;
     String sourceRepo = HDP_2_1_1_0;
     String targetRepo = HDP_2_1_1_1;
+    String hostName = "h1";
 
-    makeUpgradeCluster(sourceStack, sourceRepo, targetStack, targetRepo);
+    createUpgradeClusterAndSourceRepo(sourceStack, sourceRepo, hostName);
 
     // Verify the repo before calling Finalize
     AmbariCustomCommandExecutionHelper helper = m_injector.getInstance(AmbariCustomCommandExecutionHelper.class);
@@ -930,6 +960,8 @@ public class UpgradeActionTest {
     ServiceComponentHost nnSCH = createNewServiceComponentHost(cluster, "HDFS", "NAMENODE", "h1");
     ServiceComponentHost dnSCH = createNewServiceComponentHost(cluster, "HDFS", "DATANODE", "h1");
 
+    createUpgradeClusterTargetRepo(targetStack, targetRepo, hostName);
+
     // fake their upgrade
     nnSCH.setStackVersion(nnSCH.getDesiredStackVersion());
     nnSCH.setVersion(targetRepo);

http://git-wip-us.apache.org/repos/asf/ambari/blob/21af204d/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
index 5d849c9..b1c10f5 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/ConfigHelperTest.java
@@ -58,9 +58,7 @@ import org.apache.ambari.server.state.configgroup.ConfigGroupFactory;
 import org.apache.ambari.server.state.host.HostFactory;
 import org.apache.ambari.server.state.stack.OsFamily;
 import org.junit.After;
-import org.junit.AfterClass;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.runners.Enclosed;
 import org.junit.runner.RunWith;
@@ -90,8 +88,8 @@ public class ConfigHelperTest {
     private static AmbariMetaInfo metaInfo;
     private static ConfigFactory configFactory;
 
-    @BeforeClass
-    public static void setup() throws Exception {
+    @Before
+    public void setup() throws Exception {
       // Set the authenticated user
       // TODO: remove this or replace the authenticated user to test authorization rules
       SecurityContextHolder.getContext().setAuthentication(TestAuthenticationFactory.createAdministrator("admin"));
@@ -222,8 +220,8 @@ public class ConfigHelperTest {
       }}, null);
     }
 
-    @AfterClass
-    public static void tearDown() throws AmbariException, SQLException {
+    @After
+    public void tearDown() throws AmbariException, SQLException {
       H2DatabaseCleaner.clearDatabaseAndStopPersistenceService(injector);
 
       // Clear the authenticated user
@@ -536,7 +534,7 @@ public class ConfigHelperTest {
               configHelper.getEffectiveDesiredTags(cluster, "h3"));
 
       Assert.assertNotNull(effectiveAttributes);
-      Assert.assertEquals(10, effectiveAttributes.size());
+      Assert.assertEquals(7, effectiveAttributes.size());
 
       Assert.assertTrue(effectiveAttributes.containsKey("global3"));
       Map<String, Map<String, String>> globalAttrs = effectiveAttributes.get("global3");
@@ -899,7 +897,7 @@ public class ConfigHelperTest {
       // set up expectations
       expect(sch.getActualConfigs()).andReturn(schReturn).times(6);
       expect(sch.getHostName()).andReturn("h1").anyTimes();
-      expect(sch.getClusterId()).andReturn(1l).anyTimes();
+      expect(sch.getClusterId()).andReturn(cluster.getClusterId()).anyTimes();
       expect(sch.getServiceName()).andReturn("FLUME").anyTimes();
       expect(sch.getServiceComponentName()).andReturn("FLUME_HANDLER").anyTimes();
       replay(sch);

http://git-wip-us.apache.org/repos/asf/ambari/blob/21af204d/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java
index 05aeddb..4ad93e6 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/state/cluster/AlertDataManagerTest.java
@@ -112,6 +112,7 @@ public class AlertDataManagerTest {
   @Before
   public void setup() throws Exception {
     m_injector = Guice.createInjector(new InMemoryDefaultTestModule());
+    EventBusSynchronizer.synchronizeAlertEventPublisher(m_injector);
     m_injector.getInstance(GuiceJpaInitializer.class);
     m_injector.getInstance(UnitOfWork.class).begin();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/21af204d/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index c48d49a..83ee8aa 100644
--- a/pom.xml
+++ b/pom.xml
@@ -158,6 +158,10 @@
           <artifactId>maven-clean-plugin</artifactId>
           <version>2.5</version>
         </plugin>
+        <plugin>
+          <artifactId>maven-assembly-plugin</artifactId>
+          <version>2.2-beta-5</version>
+        </plugin>
       </plugins>
     </pluginManagement>
     <plugins>


[34/51] [abbrv] ambari git commit: AMBARI-19755. Test Fix. Perf: start/stop all actions works much slower after few days of testing.(vbrodetskyi)

Posted by rz...@apache.org.
AMBARI-19755. Test Fix. Perf: start/stop all actions works much slower after few days of testing.(vbrodetskyi)

(cherry picked from commit 8ef727841c94fdc4a1e5b4a75e32f01fa9141527)

Change-Id: I0af6f3b2a4adbb2e1264e6c8a399dd1c36a513d5


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: d56e520ae6e7557e49efb7b95eb9b230f1ad23c1
Parents: e3b9ef3
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Wed Feb 1 01:37:18 2017 +0200
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 06:29:37 2017 -0800

----------------------------------------------------------------------
 .../org/apache/ambari/server/state/cluster/ClusterImpl.java    | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d56e520a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
index 5da8012..a4c4b36 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClusterImpl.java
@@ -2894,13 +2894,13 @@ public class ClusterImpl implements Cluster {
 
     Service service = clusterServices.get(serviceName);
     Map<String, ServiceComponent> components = service.getServiceComponents();
-    Map<String, ServiceComponentHost> serviceComponentHosts = components.get(componentName).getServiceComponentHosts();
 
-    if (!components.containsKey(componentName) || serviceComponentHosts.size() == 0) {
+    if (!components.containsKey(componentName) ||
+            components.get(componentName).getServiceComponentHosts().size() == 0) {
       return Collections.emptySet();
     }
 
-    return serviceComponentHosts.keySet();
+    return components.get(componentName).getServiceComponentHosts().keySet();
   }
 
   @Override


[07/51] [abbrv] ambari git commit: AMBARI-17722. Add some of value-attributes to property files in TEZ. (Masahiro Tanaka via yusaku)

Posted by rz...@apache.org.
AMBARI-17722. Add some of value-attributes to property files in TEZ. (Masahiro Tanaka via yusaku)

(cherry picked from commit 9b51e8b5f3a088c9ee2d4e557c003acf39487c53)

Change-Id: I5ec5700e6e3313480297019c6c54767142547285


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 7dbbffb45aa9c7a57c46678a75526b656fdede44
Parents: e016c76
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Thu Feb 2 13:08:09 2017 -0800
Committer: Zuul <re...@hortonworks.com>
Committed: Mon Feb 6 20:09:39 2017 -0800

----------------------------------------------------------------------
 .../TEZ/0.4.0.2.1/configuration/tez-site.xml    | 27 +++++-
 .../services/TEZ/configuration/tez-site.xml     | 65 ++++++++++++++-
 .../2.2/services/TEZ/configuration/tez-site.xml | 83 ++++++++++++++++++
 .../2.3/services/TEZ/configuration/tez-site.xml |  6 ++
 .../2.5/services/TEZ/configuration/tez-site.xml |  6 ++
 .../2.2/services/TEZ/configuration/tez-site.xml | 88 +++++++++++++++++++-
 6 files changed, 272 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7dbbffb4/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/configuration/tez-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/configuration/tez-site.xml b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/configuration/tez-site.xml
index bf120e6..d7031e1 100644
--- a/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/configuration/tez-site.xml
+++ b/ambari-server/src/main/resources/common-services/TEZ/0.4.0.2.1/configuration/tez-site.xml
@@ -41,6 +41,7 @@
     <description>The amount of memory to be used by the AppMaster</description>
     <value-attributes>
       <type>int</type>
+      <unit>MB</unit>
     </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
@@ -57,6 +58,9 @@
     <description>In case of a ScatterGather connection, the fraction of source tasks which should
       complete before tasks for the current vertex are schedule
     </description>
+    <value-attributes>
+      <type>float</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -72,6 +76,10 @@
     <name>tez.am.am-rm.heartbeat.interval-ms.max</name>
     <value>250</value>
     <description>The maximum heartbeat interval between the AM and RM in milliseconds</description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -94,6 +102,7 @@
     </description>
     <value-attributes>
       <type>int</type>
+      <unit>Bytes</unit>
     </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
@@ -105,6 +114,7 @@
     </description>
     <value-attributes>
       <type>int</type>
+      <unit>Bytes</unit>
     </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
@@ -136,6 +146,10 @@
       it immediately. Only active when reuse is enabled. Set to -1 to never release a container
       in a session
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -149,9 +163,13 @@
   <property>
     <name>tez.task.get-task.sleep.interval-ms.max</name>
     <value>200</value>
-    <description>The maximum amount of time, in seconds, to wait before a task asks an AM for
+    <description>The maximum amount of time, in milliseconds, to wait before a task asks an AM for
       another task
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -170,6 +188,10 @@
     <description>Time (in seconds) to wait for AM to come up when trying to submit a DAG from
       the client
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>seconds</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -229,6 +251,9 @@
     <name>tez.yarn.ats.enabled</name>
     <value>true</value>
     <description>Whether to send history events to YARN Application Timeline Server</description>
+    <value-attributes>
+      <type>boolean</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/7dbbffb4/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/TEZ/configuration/tez-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/TEZ/configuration/tez-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/TEZ/configuration/tez-site.xml
index 704022c..3632318 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/TEZ/configuration/tez-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.1.GlusterFS/services/TEZ/configuration/tez-site.xml
@@ -39,6 +39,10 @@
     <name>tez.am.resource.memory.mb</name>
     <value>1536</value>
     <description>The amount of memory to be used by the AppMaster</description>
+    <value-attributes>
+      <type>int</type>
+      <unit>MB</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <!-- tez picks the java opts from yarn.app.mapreduce.am.command-opts for MR tasks. Likewise for the AM memory MB -->
@@ -54,6 +58,9 @@
     <description>In case of a ScatterGather connection, the fraction of source tasks which should
       complete before tasks for the current vertex are schedule
     </description>
+    <value-attributes>
+      <type>float</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -63,12 +70,19 @@
       completed, all tasks on the current vertex can be scheduled. Number of tasks ready for
       scheduling on the current vertex scales linearly between min-fraction and max-fraction
     </description>
+    <value-attributes>
+      <type>float</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.am.am-rm.heartbeat.interval-ms.max</name>
     <value>250</value>
     <description>The maximum heartbeat interval between the AM and RM in milliseconds</description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -78,6 +92,9 @@
       a Vertex. 1.4 with 100% queue available implies generating a number of tasks roughly equal
       to 140% of the available containers on the queue
     </description>
+    <value-attributes>
+      <type>float</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -86,6 +103,10 @@
     <description>Lower bound on the size (in bytes) of a grouped split, to avoid generating
       too many splits
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>Bytes</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -94,12 +115,19 @@
     <description>Upper bound on the size (in bytes) of a grouped split, to avoid generating
       excessively large split
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>Bytes</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.am.container.reuse.enabled</name>
     <value>true</value>
     <description>Configuration to specify whether container should be reused</description>
+    <value-attributes>
+      <type>boolean</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -107,6 +135,9 @@
     <value>true</value>
     <description>Whether to reuse containers for rack local tasks. Active only if reuse is enabled
     </description>
+    <value-attributes>
+      <type>boolean</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -114,6 +145,9 @@
     <value>true</value>
     <description>Whether to reuse containers for non-local tasks. Active only if reuse is enabled
     </description>
+    <value-attributes>
+      <type>boolean</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -124,6 +158,10 @@
       it immediately. Only active when reuse is enabled. Set to -1 to never release a container
       in a session
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -132,14 +170,22 @@
     <description>The amount of time to wait before assigning a container to the next level of
       locality. NODE -&gt; RACK -&gt; NON_LOCAL
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.task.get-task.sleep.interval-ms.max</name>
     <value>200</value>
-    <description>The maximum amount of time, in seconds, to wait before a task asks an AM for
+    <description>The maximum amount of time, in milliseconds, to wait before a task asks an AM for
       another task
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -158,6 +204,10 @@
     <description>Time (in seconds) to wait for AM to come up when trying to submit a DAG from
       the client
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>seconds</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -166,6 +216,10 @@
     <description>Time (in seconds) for which the Tez AM should wait for a DAG to be submitted
       before shutting down
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>seconds</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <!-- Configuration for runtime components -->
@@ -175,6 +229,9 @@
     <name>tez.runtime.intermediate-output.should-compress</name>
     <value>false</value>
     <description>Whether intermediate output should be compressed or not</description>
+    <value-attributes>
+      <type>boolean</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -189,6 +246,9 @@
     <name>tez.runtime.intermediate-input.is-compressed</name>
     <value>false</value>
     <description>Whether intermediate input is compressed</description>
+    <value-attributes>
+      <type>boolean</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -203,6 +263,9 @@
     <name>tez.yarn.ats.enabled</name>
     <value>true</value>
     <description>Whether to send history events to YARN Application Timeline Server</description>
+    <value-attributes>
+      <type>boolean</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/7dbbffb4/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml
index a63cb03..1427a6f 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml
@@ -58,6 +58,7 @@
     </description>
     <value-attributes>
       <type>int</type>
+      <unit>MB</unit>
     </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
@@ -101,6 +102,10 @@
         <name>yarn.scheduler.maximum-allocation-mb</name>
       </property>
     </depends-on>
+    <value-attributes>
+      <type>int</type>
+      <unit>MB</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -133,6 +138,9 @@
     <description>In case of a ScatterGather connection, the fraction of source tasks which should
       complete before tasks for the current vertex are schedule
     </description>
+    <value-attributes>
+      <type>float</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -142,12 +150,19 @@
       completed, all tasks on the current vertex can be scheduled. Number of tasks ready for
       scheduling on the current vertex scales linearly between min-fraction and max-fraction
     </description>
+    <value-attributes>
+      <type>float</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.am.am-rm.heartbeat.interval-ms.max</name>
     <value>250</value>
     <description>The maximum heartbeat interval between the AM and RM in milliseconds</description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -157,6 +172,9 @@
       a Vertex. 1.7 with 100% queue available implies generating a number of tasks roughly equal
       to 170% of the available containers on the queue
     </description>
+    <value-attributes>
+      <type>float</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -165,6 +183,10 @@
     <description>Lower bound on the size (in bytes) of a grouped split, to avoid generating
       too many splits
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>Bytes</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -173,6 +195,10 @@
     <description>Upper bound on the size (in bytes) of a grouped split, to avoid generating
       excessively large split
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>Bytes</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -199,12 +225,20 @@
     <name>tez.am.container.idle.release-timeout-min.millis</name>
     <value>10000</value>
     <description>The minimum amount of time to hold on to a container that is idle. Only active when reuse is enabled.</description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.am.container.idle.release-timeout-max.millis</name>
     <value>20000</value>
     <description>The maximum amount of time to hold on to a container if no task can be assigned to it immediately. Only active when reuse is enabled.</description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -213,6 +247,10 @@
     <description>The amount of time to wait before assigning a container to the next level of
       locality. NODE -&gt; RACK -&gt; NON_LOCAL
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -227,12 +265,19 @@
     <description>The maximum number of allowed task attempt failures on a node before
       it gets marked as blacklisted
     </description>
+    <value-attributes>
+      <type>int</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.task.am.heartbeat.counter.interval-ms.max</name>
     <value>4000</value>
     <description>Time interval at which task counters are sent to the AM</description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -241,12 +286,19 @@
     <description>The maximum amount of time, in seconds, to wait before a task asks an AM for
       another task
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.task.max-events-per-heartbeat</name>
     <value>500</value>
     <description>Maximum number of of events to fetch from the AM by the tasks in a single heartbeat.</description>
+    <value-attributes>
+      <type>int</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -255,6 +307,10 @@
     <description>Time (in seconds) to wait for AM to come up when trying to submit a DAG from
       the client
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>seconds</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -263,18 +319,28 @@
     <description>Time (in seconds) for which the Tez AM should wait for a DAG to be submitted
       before shutting down
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>seconds</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.counters.max</name>
     <value>5000</value>
     <description>The number of allowed counters for the executing DAG</description>
+    <value-attributes>
+      <type>int</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.counters.max.groups</name>
     <value>1000</value>
     <description>The number of allowed counter groups for the executing DAG</description>
+    <value-attributes>
+      <type>int</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <!-- Configuration for runtime components -->
@@ -284,6 +350,9 @@
     <name>tez.runtime.compress</name>
     <value>true</value>
     <description>Whether intermediate data should be compressed or not</description>
+    <value-attributes>
+      <type>boolean</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -304,6 +373,10 @@
         <name>tez.task.resource.memory.mb</name>
       </property>
     </depends-on>
+    <value-attributes>
+      <type>int</type>
+      <unit>MB</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -316,6 +389,10 @@
         <name>tez.task.resource.memory.mb</name>
       </property>
     </depends-on>
+    <value-attributes>
+      <type>int</type>
+      <unit>MB</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -331,12 +408,18 @@
     <name>tez.runtime.convert.user-payload.to.history-text</name>
     <value>false</value>
     <description>Whether to publish configuration information to History logger</description>
+    <value-attributes>
+      <type>boolean</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.use.cluster.hadoop-libs</name>
     <value>false</value>
     <description>This being true implies that the deployment is relying on hadoop jars being available on the cluster on all nodes.</description>
+    <value-attributes>
+      <type>boolean</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>

http://git-wip-us.apache.org/repos/asf/ambari/blob/7dbbffb4/ambari-server/src/main/resources/stacks/HDP/2.3/services/TEZ/configuration/tez-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/TEZ/configuration/tez-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/TEZ/configuration/tez-site.xml
index 8c2c6cf..d0ff092 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/TEZ/configuration/tez-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/TEZ/configuration/tez-site.xml
@@ -106,12 +106,18 @@
     <name>tez.counters.max</name>
     <value>10000</value>
     <description>The number of allowed counters for the executing DAG</description>
+    <value-attributes>
+      <type>int</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.counters.max.groups</name>
     <value>3000</value>
     <description>The number of allowed counter groups for the executing DAG</description>
+    <value-attributes>
+      <type>int</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/7dbbffb4/ambari-server/src/main/resources/stacks/HDP/2.5/services/TEZ/configuration/tez-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/TEZ/configuration/tez-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/TEZ/configuration/tez-site.xml
index 382025e..fc301b7 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/TEZ/configuration/tez-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/TEZ/configuration/tez-site.xml
@@ -22,6 +22,9 @@
     <value>0.6</value>
     <description>Fraction (0-1) of the available memory which can be used to
       retain shuffled data</description>
+    <value-attributes>
+      <type>float</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -30,6 +33,9 @@
     <description>This property determines the maximum size of a shuffle segment
       which can be fetched to memory. Fraction (0-1) of shuffle memory
       (after applying tez.runtime.shuffle.fetch.buffer.percent)</description>
+    <value-attributes>
+      <type>float</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/7dbbffb4/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/TEZ/configuration/tez-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/TEZ/configuration/tez-site.xml b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/TEZ/configuration/tez-site.xml
index d719322..19e6092 100644
--- a/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/TEZ/configuration/tez-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDPWIN/2.2/services/TEZ/configuration/tez-site.xml
@@ -42,6 +42,9 @@
     <name>tez.generate.debug.artifacts</name>
     <value>false</value>
     <description>Generate debug artifacts such as a text representation of the submitted DAG plan</description>
+    <value-attributes>
+      <type>boolean</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -50,6 +53,10 @@
     <description>The amount of memory to be used by the AppMaster.
       Used only if the value is not specified explicitly by the DAG definition.
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>MB</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -82,6 +89,10 @@
     <description>The amount of memory to be used by launched tasks.
       Used only if the value is not specified explicitly by the DAG definition.
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>MB</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -114,6 +125,9 @@
     <description>In case of a ScatterGather connection, the fraction of source tasks which should
       complete before tasks for the current vertex are schedule
     </description>
+    <value-attributes>
+      <type>float</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -123,12 +137,19 @@
       completed, all tasks on the current vertex can be scheduled. Number of tasks ready for
       scheduling on the current vertex scales linearly between min-fraction and max-fraction
     </description>
+    <value-attributes>
+      <type>float</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.am.am-rm.heartbeat.interval-ms.max</name>
     <value>250</value>
     <description>The maximum heartbeat interval between the AM and RM in milliseconds</description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -138,6 +159,9 @@
       a Vertex. 1.7 with 100% queue available implies generating a number of tasks roughly equal
       to 170% of the available containers on the queue
     </description>
+    <value-attributes>
+      <type>float</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -146,6 +170,10 @@
     <description>Lower bound on the size (in bytes) of a grouped split, to avoid generating
       too many splits
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>Bytes</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -154,6 +182,10 @@
     <description>Upper bound on the size (in bytes) of a grouped split, to avoid generating
       excessively large split
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>Bytes</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -180,12 +212,20 @@
     <name>tez.am.container.idle.release-timeout-min.millis</name>
     <value>10000</value>
     <description>The minimum amount of time to hold on to a container that is idle. Only active when reuse is enabled.</description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.am.container.idle.release-timeout-max.millis</name>
     <value>20000</value>
     <description>The maximum amount of time to hold on to a container if no task can be assigned to it immediately. Only active when reuse is enabled.</description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -194,12 +234,19 @@
     <description>The amount of time to wait before assigning a container to the next level of
       locality. NODE -&gt; RACK -&gt; NON_LOCAL
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.am.max.app.attempts</name>
     <value>2</value>
     <description>Specifies the total number of time the app master will run in case recovery is triggered</description>
+    <value-attributes>
+      <type>int</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -208,12 +255,19 @@
     <description>The maximum number of allowed task attempt failures on a node before
       it gets marked as blacklisted
     </description>
+    <value-attributes>
+      <type>int</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.task.am.heartbeat.counter.interval-ms.max</name>
     <value>4000</value>
     <description>Time interval at which task counters are sent to the AM</description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -222,12 +276,19 @@
     <description>The maximum amount of time, in seconds, to wait before a task asks an AM for
       another task
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>ms</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.task.max-events-per-heartbeat</name>
     <value>500</value>
-    <description>Maximum number of of events to fetch from the AM by the tasks in a single heartbeat.</description>
+    <description>Maximum number of events to fetch from the AM by the tasks in a single heartbeat.</description>
+    <value-attributes>
+      <type>int</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -236,6 +297,10 @@
     <description>Time (in seconds) to wait for AM to come up when trying to submit a DAG from
       the client
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>seconds</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -244,18 +309,28 @@
     <description>Time (in seconds) for which the Tez AM should wait for a DAG to be submitted
       before shutting down
     </description>
+    <value-attributes>
+      <type>int</type>
+      <unit>seconds</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.counters.max</name>
     <value>2000</value>
     <description>The number of allowed counters for the executing DAG</description>
+    <value-attributes>
+      <type>int</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.counters.max.groups</name>
     <value>1000</value>
     <description>The number of allowed counter groups for the executing DAG</description>
+    <value-attributes>
+      <type>int</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <!-- Configuration for runtime components -->
@@ -265,6 +340,9 @@
     <name>tez.runtime.compress</name>
     <value>true</value>
     <description>Whether intermediate data should be compressed or not</description>
+    <value-attributes>
+      <type>boolean</type>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
@@ -279,12 +357,20 @@
     <name>tez.runtime.io.sort.mb</name>
     <value>512</value>
     <description>The size of the sort buffer when output needs to be sorted</description>
+    <value-attributes>
+      <type>int</type>
+      <unit>MB</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>
     <name>tez.runtime.unordered.output.buffer.size-mb</name>
     <value>100</value>
     <description>The size of the buffer when output does not require to be sorted</description>
+    <value-attributes>
+      <type>int</type>
+      <unit>MB</unit>
+    </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
   <property>


[51/51] [abbrv] ambari git commit: AMBARI-19907. On certain actions, there's no feedback from the UI when API takes a long time to respond (rzang)

Posted by rz...@apache.org.
AMBARI-19907. On certain actions, there's no feedback from the UI when API takes a long time to respond <fix1> (rzang)


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 626d4348eb3ca1fc4fb17f00124288794c252fa7
Parents: c77ca2e
Author: Richard Zang <rz...@apache.org>
Authored: Thu Feb 16 13:36:07 2017 -0800
Committer: Richard Zang <rz...@apache.org>
Committed: Thu Feb 16 13:36:07 2017 -0800

----------------------------------------------------------------------
 ambari-web/app/utils/ajax/ajax.js          | 23 +++++++++++++++--------
 ambari-web/app/views/common/modal_popup.js |  9 +++++++++
 2 files changed, 24 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/626d4348/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 82fa34f..842b8d8 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -3104,15 +3104,19 @@ var ajax = Em.Object.extend({
     }
 
     var loadingPopup = null;
+    var loadingPopupTimeout = null;
     if(config.hasOwnProperty("showLoadingPopup") && config.showLoadingPopup === true) {
-      loadingPopup = App.ModalPopup.show({
-        header: Em.I18n.t('jobs.loadingTasks'),
-        primary: false,
-        secondary: false,
-        bodyClass: Em.View.extend({
-          template: Em.Handlebars.compile('{{view App.SpinnerView}}')
-        })
-      });
+      loadingPopupTimeout = setTimeout(function() {
+        loadingPopup = App.ModalPopup.show({
+          header: Em.I18n.t('jobs.loadingTasks'),
+          backdrop: false,
+          primary: false,
+          secondary: false,
+          bodyClass: Em.View.extend({
+            template: Em.Handlebars.compile('{{view App.SpinnerView}}')
+          })
+        });
+      }, 1000);
     }
 
     // default parameters
@@ -3164,6 +3168,9 @@ var ajax = Em.Object.extend({
       }
     };
     opt.complete = function () {
+      if (loadingPopupTimeout) {
+        clearTimeout(loadingPopupTimeout);
+      }
       if(loadingPopup) {
         Em.tryInvoke(loadingPopup, 'hide');
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/626d4348/ambari-web/app/views/common/modal_popup.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/modal_popup.js b/ambari-web/app/views/common/modal_popup.js
index c6361fb..8bbdeed 100644
--- a/ambari-web/app/views/common/modal_popup.js
+++ b/ambari-web/app/views/common/modal_popup.js
@@ -72,11 +72,20 @@ App.ModalPopup = Ember.View.extend({
       .on('enter-key-pressed', this.enterKeyPressed.bind(this))
       .on('escape-key-pressed', this.escapeKeyPressed.bind(this));
     this.fitZIndex();
+    this.handleBackDrop();
     var firstInputElement = this.$('#modal').find(':input').not(':disabled, .no-autofocus').first();
     this.focusElement(firstInputElement);
     this.subscribeResize();
   },
 
+  handleBackDrop: function () {
+    if (this.get('backdrop') === false) {
+      $('.modal-backdrop').css('visibility', 'hidden');
+    } else {
+      $('.modal-backdrop').css('visibility', 'visible');
+    }
+  },
+
   subscribeResize: function() {
     if (this.get('autoHeight') && !$.mocho) {
       this.fitHeight();


[15/51] [abbrv] ambari git commit: AMBARI-19797. ambari-server SuSE11 init script not working in certain environments (aonishuk)

Posted by rz...@apache.org.
AMBARI-19797. ambari-server SuSE11 init script not working in certain environments (aonishuk)

(cherry picked from commit 83bdf4b3bf11fe9a574222305cf36485c3d76847)

Change-Id: I7dbfc75fb53f6ceff1f51725f92a401be02c2366


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 2fed50c4585f46b4a4cdad25d2628d4d874c776c
Parents: 0ef1214
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Thu Feb 2 16:20:34 2017 +0200
Committer: Zuul <re...@hortonworks.com>
Committed: Mon Feb 6 23:33:59 2017 -0800

----------------------------------------------------------------------
 ambari-server/sbin/ambari-server | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2fed50c4/ambari-server/sbin/ambari-server
----------------------------------------------------------------------
diff --git a/ambari-server/sbin/ambari-server b/ambari-server/sbin/ambari-server
index b63f128..88d503d 100755
--- a/ambari-server/sbin/ambari-server
+++ b/ambari-server/sbin/ambari-server
@@ -21,6 +21,7 @@
 
 ### BEGIN INIT INFO
 # Provides:          ambari-server
+# Required-Start:    $ALL
 # Required-Start:
 # Required-Stop:
 # Default-Start:     2 3 4 5


[31/51] [abbrv] ambari git commit: AMBARI-19878 Log Search Portal time zone selection bug (mgergely)

Posted by rz...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/e3b9ef3c/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/timezone/WorldMapGenerator.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/timezone/WorldMapGenerator.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/timezone/WorldMapGenerator.js
new file mode 100644
index 0000000..cfc44c7
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/timezone/WorldMapGenerator.js
@@ -0,0 +1,3474 @@
+/**
+ * @version: 1.0.1
+ * @author: Keval Bhatt 
+ * @copyright: Copyright (c) 2015 Keval Bhatt. All rights reserved.
+ * @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
+ * @website: http://kevalbhatt.github.io/WorldMapGenerator/
+ */
+'use strict';
+(function(root, factory) {
+
+    if (typeof define === 'function' && define.amd) {
+        define(['moment', 'jquery'], function(momentjs, $) {
+            root.worldMapTime = {};
+            factory(momentjs, $, root.worldMapTime);
+        });
+
+    } else {
+        if ((typeof root.moment == "undefined")) {
+            var moment = false;
+            console.log('Day light feature requires moment.js')
+        } else {
+            if (!(root.moment.tz)) {
+                throw new Error('moment-timezone dependency not found');
+            }
+        }
+        if ((root.jQuery != "undefined" || root.Zepto != "undefined" || root.ender != "undefined" || root.$ != "undefined")) {
+            var c = root.worldMapTime = {};
+            factory(root.moment || moment, (root.jQuery || root.Zepto || root.ender || root.$), c);
+        } else {
+            throw new Error('jQuery dependnecy not found');
+        }
+
+    }
+
+}(this, function(moment, $, getTimeZoneObjct) {
+    var findValue = function(key, value) {
+        var referObj = [];
+        var obj = WorldMapGenerator.timeZoneValue.filter(function(object) {
+            if (object[key] === value) {
+                referObj.push($.extend(true, {},object));
+                return object;
+            }
+        });
+        for(var i=0;i<referObj.length;i++){
+           delete referObj[i].points;
+           delete referObj[i].pin;
+        }
+        return referObj;
+    }
+    getTimeZoneObjct['getSystemTimezone'] = function() {
+        /* var d = new Date()
+         var n = d.getTimezoneOffset();
+         var offset = (-(n))/60*/
+        var zoneAbr = new Date().toString().split('(')[1].slice(0, -1)
+        return findValue('zoneName', zoneAbr)
+    }
+    getTimeZoneObjct['getZoneName'] = function(zoneAbr) {
+        return findValue('zoneName', zoneAbr).zoneName
+    }
+    getTimeZoneObjct['getTimeZoneString'] = function(zoneAbr) {
+        return findValue('zoneName', zoneAbr).timezone
+    }
+    getTimeZoneObjct['getTimeZoneObject'] = function(zoneAbr) {
+        return findValue('zoneName', zoneAbr)
+    }
+
+
+    var WorldMapGenerator = function(element, options) {
+        this.$el = element;
+        this.generateMap(options);
+    }
+
+    WorldMapGenerator.VERSION = '1.0.1';
+
+    WorldMapGenerator.DEFAULTS = {
+        width: 500,
+        height: 250,
+        hoverColor: '#5A5A5A',
+        selectedColor: '#496A84',
+        mapColor: '#BBB',
+        defaultCss: true,
+        localStore: true,
+        quickLink: [{
+            "IST": "IST",
+            "EAT": "EAT"
+        }],
+        selectBox: true,
+        showHoverText: true,
+        dayLightSaving: ((typeof moment == "function") ? (true) : (false))
+    };
+
+    WorldMapGenerator.prototype = {
+
+        constructor: WorldMapGenerator,
+
+        /**
+         * [setValue set value in map]
+         * @param {[type]} value        [attribute value]
+         * @param {[type]} attribute         [attribute name]
+         */
+        setValue: function(value, attribute) {
+
+            this.$el.find('svg polygon').attr('data-selected', 'false');
+            var elements = this.$el.find('svg polygon[data-' + ((attribute) ? (attribute) : ("timezone")) + '="' + value + '"]');
+
+            if (elements && elements.length) {
+                elements.attr('data-selected', 'true');
+                this.$el.find('select option[value="' + ((attribute) ? (elements.attr('data-timeZone')) : (value)) + '"]').prop('selected', true);
+                this.$el.find('.quickLink span').removeClass('active');
+                var findQuickLink = this.$el.find('.quickLink span[data-select="' + value + '"]');
+                this.$el.find('.quickLink span[data-select="' + value + '"]').addClass('active');
+                this.$el.find('.quickLink span[data-select="' + elements.attr('data-zonename') + '"]').addClass('active');
+
+            }
+        },
+        /**
+         * [getValue get selected value array]
+         * @return {[type]} [description]
+         */
+        getValue: function() {
+            var value = [];
+            this.$el.find('svg polygon[data-selected="true"]').map(function(index, el) {
+                value.push($(el).data());
+            });
+            return value;
+        },
+        /**
+         * [generateMap create element dynamically]
+         * @param  {[type]} options [depanding on option it will create e]
+         * @return {[type]}         [description]
+         */
+        generateMap: function(options) {
+
+            var polygon = [],
+                option = [],
+                quickLink = [],
+                containerArr = [],
+                timezone = WorldMapGenerator.timeZoneValue;
+            for (var index in timezone) {
+                var zoneName =  ((options.dayLightSaving) ? (moment().tz(timezone[index].timezone).zoneName()) : (timezone[index].zoneName))
+                if (zoneName == 'CST' && timezone[index].timezone.startsWith('Asia'))
+                  zoneName = 'CST/China'
+                polygon.push(this.genrateElement('polygon', {
+                    'data-timezone': timezone[index].timezone,
+                    'data-country': timezone[index].country,
+                    'data-pin': timezone[index].pin,
+                    'data-offset': timezone[index].offset,
+                    'points': timezone[index].points,
+                    'data-zonename': zoneName
+                }, false, true));
+                option.push(this.genrateElement('option', {
+                    'value': timezone[index].timezone
+                }, timezone[index].timezone + " (" + ((options.dayLightSaving) ? (moment().tz(timezone[index].timezone).zoneName()) : (timezone[index].zoneName)) + ")"));
+            }
+            if (options.selectBox) {
+                var select = this.genrateElement('select', {
+                    'class': 'mapDropDown dropdown-toggle',
+                }, option);
+                containerArr.push(select);
+            }
+
+
+            if (options.quickLink.length > 0) {
+                for (var index in options.quickLink[0]) {
+                    quickLink.push(this.genrateElement('span', {
+                        'data-select': options.quickLink[0][index]
+                    }, index));
+                }
+                var qickLinkDiv = this.genrateElement('div', {
+                    'class': 'quickLink'
+                }, quickLink);
+                containerArr.push(qickLinkDiv);
+            }
+
+
+
+            var svg = this.genrateElement('svg', {
+                'class': 'timezone-map',
+                'viewBox': '0 0 ' + options.width + ' ' + options.height
+            }, polygon, true);
+
+            if (containerArr.length > 0) {
+                var container = this.genrateElement('div', {
+                    'class': 'Cbox'
+                }, containerArr);
+                this.$el.append(container);
+
+            }
+            this.$el.append(svg);
+
+            if (options.showHoverText) {
+                var hoverZone = this.genrateElement('span', {
+                    'class': 'hoverZone',
+                });
+                this.$el.append(hoverZone);
+            }
+
+
+
+            if (options.defaultCss) {
+                this.createCss(options);
+            }
+            this.bindEvent(options);
+
+        },
+        /**
+         * [bindEvent bind all event i.e click,mouseenter,mouseleave,change(select)]
+         * @return {[type]} [description]
+         */
+        bindEvent: function() {
+            var that = this;
+            this.$el.on('mouseenter', 'svg polygon', function(e) {
+                var d = $(this).data();
+                $('.timezone-map polygon[data-zonename="' + d.zonename + '"]').attr('class', 'active');
+                that.$el.find('.hoverZone').text(d.timezone + " (" + d.zonename + ")");
+            });
+            this.$el.on('mouseleave', 'svg polygon', function(e) {
+                $('.timezone-map polygon').attr('class', '');
+                that.$el.find('.hoverZone').text('');
+            });
+            this.$el.on('click', 'svg polygon', function() {
+
+                that.setValue($(this).attr('data-timezone'));
+                that.$el.trigger("map:clicked");
+
+            });
+            this.$el.on('change', 'select', function() {
+                that.setValue($(this).val());
+                that.$el.trigger("map:clicked");
+            });
+            this.$el.on('click', '.quickLink span', function() {
+                var selectValue = $(this).data().select
+                if (selectValue.search('/') > 0) {
+                    that.setValue(selectValue, 'timezone');
+                } else {
+                    that.setValue(selectValue, 'zonename');
+                }
+                that.$el.trigger("map:clicked");
+            });
+        },
+        /**
+         * [genrateElement description]
+         * @param  {[Jquery Object]}  element     [selector]
+         * @param  {[type]}  elementAttr [description]
+         * @param  {[javascript Object or text]}  chilled      [If we pass javascript object or  array it will append all chilled and if you pass string it will add string(value) inside element ]
+         * @param  {Boolean} isSvg       [If it is svg then it will create svg element]
+         * @return {[type]}              [description]
+         */
+        genrateElement: function(element, elementAttr, chilled, isSvg) {
+
+
+            if (isSvg) {
+                var elementObject = document.createElementNS('http://www.w3.org/2000/svg', element);
+            } else {
+                var elementObject = document.createElement(element);
+            }
+            if (elementAttr) {
+                for (var key in elementAttr) {
+                    elementObject.setAttribute(key, elementAttr[key]);
+                }
+            }
+            if (chilled) {
+                if (chilled instanceof Array) {
+                    for (var chilleds in chilled) {
+                        elementObject.appendChild(chilled[chilleds]);
+                    }
+                } else if (typeof chilled == 'string') {
+                    elementObject.innerHTML = chilled;
+                } else {
+                    elementObject.appendChild(chilled);
+                }
+
+            }
+
+            return elementObject;
+
+        },
+        /**
+         * [createCss function will create css dynamically it is insert style attribute in  in head ]
+         * @param  {[type]} options [options has mapColor,selectedColor,hoverColor ]
+         * @return {[type]}         [description]
+         */
+        createCss: function(options) {
+            var style = document.createElement('style');
+            style.type = 'text/css';
+            style.innerHTML = '.timezone-map polygon[data-selected="true"] {fill: ' + options.selectedColor + '}' +
+                '.timezone-map polygon { fill: ' + options.mapColor + ';}' +
+                '.timezone-map polygon.active {fill: ' + options.hoverColor + ';}' +
+                '.timezone-map polygon:hover { cursor: pointer;}' +
+                '.Cbox .quickLink{width: 52%;float: right;padding-bottom: 11px;overflow-x: auto; white-space: nowrap;overflow-y: hidden;}' +
+                '.Cbox .quickLink span:hover {color:#FFF;background-color: #496A84;  cursor: pointer;}' +
+                '.Cbox select{width: 45%;float: left;height: 27px; padding: 0px 0px 0px 10px;}' +
+                '.Cbox .quickLink span.active {color: #FFF; background-color: #496A84;}' +
+                '.Cbox .quickLink span{ font-weight: 300; border-radius: 3px; color: #000; background-color: #FFF; border: solid 1px #CCC;margin-left: 10px;' +
+                'font-size: 9px;padding: 4px 6px 4px 6px;}';
+            document.getElementsByTagName('head')[0].appendChild(style);
+
+        }
+    };
+    /**
+     * [Plugin Staring point for plugin]
+     * @param {[type]} option [user options which can be override the default options]
+     */
+    function Plugin(option) {
+
+        return this.each(function() {
+            var $el = $(this)
+            var options = $.extend({}, WorldMapGenerator.DEFAULTS, $el.data(), typeof option == 'object' && option);
+            $el.data('WorldMapGenerator', new WorldMapGenerator($el, options));
+            $el.trigger("map:loaded");
+        });
+    };
+
+    $.fn.WorldMapGenerator = Plugin;
+
+    WorldMapGenerator.timeZoneValue = [{
+        "timezone": "Africa/Abidjan",
+        "country": "CI",
+        "pin": "244,118",
+        "offset": 0,
+        "points": "241,118,240,119,240,117,238,116,238,115,239,114,239,113,239,113,239,111,241,110,241,111,243,111,244,112,246,111,247,113,245,116,246,118,241,118",
+        "zoneName": "GMT"
+    }, {
+        "timezone": "Africa/Accra",
+        "country": "GH",
+        "pin": "250,117",
+        "offset": 0,
+        "points": "251,117,247,118,246,118,246,118,246,116,247,114,246,110,250,110,251,113,251,116,252,116,251,117",
+        "zoneName": "GMT"
+    }, {
+        "timezone": "Africa/Addis_Ababa",
+        "country": "ET",
+        "pin": "304,112",
+        "offset": 3,
+        "points": "313,118,311,118,308,120,307,119,305,120,300,119,299,116,296,114,296,113,297,113,298,110,299,110,300,107,300,107,301,105,302,105,303,104,303,105,307,105,309,108,308,110,310,110,309,110,310,112,317,114,313,118",
+        "zoneName": "EAT"
+    }, {
+        "timezone": "Africa/Algiers",
+        "country": "DZ",
+        "pin": "254,74",
+        "offset": 1,
+        "points": "263,83,264,86,264,88,263,89,264,91,266,91,267,92,258,98,255,99,254,97,252,97,250,95,238,87,238,85,239,85,243,83,243,82,245,82,245,81,246,81,246,80,248,80,249,80,248,79,248,77,247,76,254,74,262,74,261,74,262,77,260,78,263,81,263,83",
+        "zoneName": "CET"
+    }, {
+        "timezone": "Africa/Asmara",
+        "country": "ER",
+        "pin": "304,104",
+        "offset": 3,
+        "points": "306,104,310,107,309,108,306,105,303,105,303,104,302,105,301,105,301,101,304,100,305,104,305,103,306,104",
+        "zoneName": "EAT"
+    }, {
+        "timezone": "Africa/Bamako",
+        "country": "ML",
+        "pin": "239,107",
+        "offset": 0,
+        "points": "244,107,244,108,242,109,242,111,241,111,241,110,240,111,239,110,239,111,238,110,238,110,238,109,237,108,235,108,234,108,234,107,233,105,234,103,235,104,237,103,242,103,241,90,243,90,252,96,252,97,254,97,255,99,256,98,256,101,255,104,249,104,246,105,245,107,244,106,244,107",
+        "zoneName": "GMT"
+    }, {
+        "timezone": "Africa/Bangui",
+        "country": "CF",
+        "pin": "276,119",
+        "offset": 1,
+        "points": "284,118,283,119,282,118,281,119,277,118,276,119,276,120,273,120,272,122,270,119,270,117,272,115,276,114,276,113,278,112,280,110,281,110,283,111,283,113,284,113,284,113,285,114,288,118,285,118,285,118,284,118",
+        "zoneName": "WAT"
+    }, {
+        "timezone": "Africa/Banjul",
+        "country": "GM",
+        "pin": "227,106",
+        "offset": 0,
+        "points": "231,106,227,106,229,106,231,106",
+        "zoneName": "GMT"
+    }, {
+        "timezone": "Africa/Bissau",
+        "country": "GW",
+        "pin": "228,109",
+        "offset": 0,
+        "points": "228,109,228,109,228,109",
+        "zoneName": "GMT"
+    }, {
+        "timezone": "Africa/Blantyre",
+        "country": "MW",
+        "pin": "299,147",
+        "offset": 2,
+        "points": "298,144,300,146,299,149,298,147,298,145,297,145,295,144,297,142,296,140,297,140,296,138,298,139,299,141,298,142,298,144",
+        "zoneName": "CAT"
+    }, {
+        "timezone": "Africa/Brazzaville",
+        "country": "CG",
+        "pin": "271,131",
+        "offset": 1,
+        "points": "266,131,267,130,266,128,267,128,268,128,270,128,270,128,270,126,269,125,270,124,269,123,268,123,268,122,272,123,273,120,276,120,275,126,273,128,272,130,270,132,270,131,269,132,268,131,267,132,266,131",
+        "zoneName": "WAT"
+    }, {
+        "timezone": "Africa/Bujumbura",
+        "country": "BI",
+        "pin": "291,130",
+        "offset": 2,
+        "points": "292,131,291,131,290,129,291,129,292,128,292,128,293,130,292,131",
+        "zoneName": "CAT"
+    }, {
+        "timezone": "Asia/Oral",
+        "country": "KZ",
+        "pin": "321,54",
+        "offset": 5,
+        "points": "316,55,317,56,318,56,317,55,319,54,320,53,323,53,326,54,326,56,323,58,321,57,319,58,315,58,316,55",
+        "zoneName": "ORAT"
+    }, {
+        "timezone": "Africa/Cairo",
+        "country": "EG",
+        "pin": "293,83",
+        "offset": 2,
+        "points": "294,94,285,94,284,83,285,81,290,82,293,81,294,81,295,82,298,82,298,84,298,86,296,85,295,83,295,84,300,92,299,92,299,93,297,95,294,94",
+        "zoneName": "EET"
+    }, {
+        "timezone": "Africa/Casablanca",
+        "country": "MA",
+        "pin": "239,78",
+        "offset": 0,
+        "points": "242,84,240,84,238,85,238,87,232,87,236,84,237,83,236,81,237,80,241,78,242,75,243,75,244,76,246,76,248,77,248,80,246,80,246,81,245,81,245,82,243,82,242,84",
+        "zoneName": "WET"
+    }, {
+        "timezone": "Africa/Ceuta",
+        "country": "ES",
+        "pin": "243,75",
+        "offset": 1,
+        "points": "243,75,243,75,243,75",
+        "zoneName": "CET"
+    }, {
+        "timezone": "Africa/Conakry",
+        "country": "GN",
+        "pin": "231,112",
+        "offset": 0,
+        "points": "238,114,237,115,236,113,235,114,235,113,234,111,233,111,232,112,231,111,230,110,229,109,231,109,231,107,234,108,235,108,237,108,238,109,238,110,238,110,239,111,239,112,239,113,239,113,239,114,238,114",
+        "zoneName": "GMT"
+    }, {
+        "timezone": "Africa/Dakar",
+        "country": "SN",
+        "pin": "226,105",
+        "offset": 0,
+        "points": "227,107,229,106,231,106,229,106,227,106,226,105,227,102,230,102,233,105,234,108,229,107,227,108,227,108,227,108,227,107",
+        "zoneName": "GMT"
+    }, {
+        "timezone": "Africa/Dar_es_Salaam",
+        "country": "TZ",
+        "pin": "305,134",
+        "offset": 3,
+        "points": "306,139,306,139,306,140,302,141,299,141,297,138,293,137,291,134,291,132,293,130,292,129,293,128,292,126,297,126,302,129,302,130,304,131,304,134,305,135,305,137,306,139",
+        "zoneName": "EAT"
+    }, {
+        "timezone": "Asia/Yekaterinburg",
+        "country": "RU",
+        "pin": "334,46",
+        "offset": 6,
+        "points": "333,53,335,54,335,54,333,55,331,54,329,54,327,55,326,54,326,55,324,53,321,53,322,51,322,50,324,50,325,49,324,48,325,48,324,47,326,47,325,46,326,46,325,44,325,43,324,43,325,42,323,41,322,40,326,40,329,40,332,39,333,35,342,31,341,31,342,31,341,31,341,30,340,29,342,29,342,29,341,29,345,30,346,29,345,28,343,28,344,28,344,27,343,27,345,25,346,24,351,24,350,26,351,27,351,27,351,29,352,30,350,32,346,32,346,33,350,33,354,31,353,30,356,29,357,30,357,31,358,31,361,32,358,31,359,30,358,29,353,29,352,28,353,27,351,26,354,25,354,24,355,25,354,26,355,26,359,27,356,25,358,25,357,25,358,25,362,25,360,26,362,26,362,27,360,28,365,29,365,30,364,31,364,31,364,32,366,32,366,34,367,34,367,35,369,35,369,36,368,37,369,37,367,39,369,40,369,40,364,41,357,40,356,42,353,44,349,44,348,44,348,45,350,46,348,47,348,48,346,48,341,50,335,50,335,51,336,51,335,51,334,52,335,52,333,53",
+        "zoneName": "YEKT"
+    }, {
+        "timezone": "Africa/Djibouti",
+        "country": "DJ",
+        "pin": "310,109",
+        "offset": 3,
+        "points": "310,109,310,109,310,109",
+        "zoneName": "EAT"
+    }, {
+        "timezone": "Africa/Douala",
+        "country": "CM",
+        "pin": "263,119",
+        "offset": 1,
+        "points": "270,117,270,119,272,121,272,123,270,122,264,122,263,119,263,120,262,119,262,117,264,116,265,115,266,116,266,115,269,110,270,109,270,107,271,107,271,110,272,111,269,112,272,114,270,117",
+        "zoneName": "WAT"
+    }, {
+        "timezone": "Africa/Freetown",
+        "country": "SL",
+        "pin": "232,113",
+        "offset": 0,
+        "points": "235,115,234,115,232,114,232,112,233,111,234,111,235,112,235,114,236,114,235,115",
+        "zoneName": "GMT"
+    }, {
+        "timezone": "Africa/Gaborone",
+        "country": "BW",
+        "pin": "286,159",
+        "offset": 2,
+        "points": "287,158,285,161,282,160,281,162,279,162,279,161,278,159,278,156,279,156,279,150,282,150,283,151,285,150,286,152,289,153,289,155,291,156,287,158",
+        "zoneName": "CAT"
+    }, {
+        "timezone": "Africa/Harare",
+        "country": "ZW",
+        "pin": "293,150",
+        "offset": 2,
+        "points": "293,156,289,155,289,153,286,152,285,150,288,150,291,147,296,148,295,151,296,153,295,155,293,156",
+        "zoneName": "CAT"
+    }, {
+        "timezone": "Africa/El_Aaiun",
+        "country": "EH",
+        "pin": "232,87",
+        "offset": 0,
+        "points": "233,89,233,92,232,93,232,95,227,95,226,96,226,95,228,92,228,92,229,91,230,89,231,88,232,87,238,87,238,89,233,89",
+        "zoneName": "WET"
+    }, {
+        "timezone": "Africa/Johannesburg",
+        "country": "ZA",
+        "pin": "289,161",
+        "offset": 2,
+        "points": "283,172,278,173,276,172,276,173,275,171,275,170,275,169,273,165,274,164,274,165,275,165,278,164,278,159,279,161,279,162,280,162,282,160,285,161,288,158,290,156,293,156,294,159,294,161,294,161,293,162,294,163,294,163,294,162,296,162,295,165,289,171,286,172,283,172",
+        "zoneName": "SAST"
+    }, {
+        "timezone": "Africa/Juba",
+        "country": "SS",
+        "pin": "294,118",
+        "offset": 3,
+        "points": "299,117,299,118,300,118,300,119,298,119,297,120,293,120,291,119,289,119,289,119,287,116,284,113,285,111,286,111,287,112,290,112,292,111,293,111,295,110,295,108,296,108,296,110,297,111,297,113,296,113,296,114,297,115,299,117",
+        "zoneName": "EAT"
+    }, {
+        "timezone": "Africa/Kampala",
+        "country": "UG",
+        "pin": "295,125",
+        "offset": 3,
+        "points": "293,126,291,127,292,124,293,122,293,122,293,120,297,120,297,119,299,122,297,125,297,126,293,126",
+        "zoneName": "EAT"
+    }, {
+        "timezone": "Africa/Khartoum",
+        "country": "SD",
+        "pin": "295,103",
+        "offset": 3,
+        "points": "300,107,299,110,298,110,297,112,296,110,296,108,295,108,295,108,295,110,293,111,292,111,290,112,287,112,286,111,285,111,284,113,283,113,283,111,282,110,281,107,280,107,282,103,283,103,283,97,285,97,285,94,294,94,297,95,299,93,301,94,302,96,302,99,304,100,301,101,301,106,300,107,300,107",
+        "zoneName": "EAT"
+    }, {
+        "timezone": "Africa/Kinshasa",
+        "country": "CD",
+        "pin": "271,131",
+        "offset": 1,
+        "points": "271,131,272,130,273,128,275,126,276,119,277,118,277,118,279,119,283,120,281,120,283,122,281,122,281,123,283,125,282,126,283,126,282,126,284,127,281,128,281,128,281,128,279,128,279,131,278,131,278,135,277,135,277,136,274,136,273,133,267,133,268,131,269,132,270,131,270,132,271,131",
+        "zoneName": "WAT"
+    }, {
+        "timezone": "Africa/Lagos",
+        "country": "NG",
+        "pin": "255,116",
+        "offset": 1,
+        "points": "261,119,258,119,256,116,254,116,254,112,255,110,255,109,256,106,258,106,260,107,261,106,263,107,265,106,267,107,269,106,270,108,270,109,269,110,266,115,266,116,264,115,262,117,262,118,261,119",
+        "zoneName": "WAT"
+    }, {
+        "timezone": "Africa/Libreville",
+        "country": "GA",
+        "pin": "263,124",
+        "offset": 1,
+        "points": "269,125,270,126,270,128,267,128,267,128,266,128,267,130,266,131,263,128,262,126,263,126,263,125,264,125,263,124,263,124,266,124,266,122,268,122,268,123,270,123,270,124,269,125",
+        "zoneName": "WAT"
+    }, {
+        "timezone": "Africa/Lome",
+        "country": "TG",
+        "pin": "252,116",
+        "offset": 0,
+        "points": "252,116,251,116,251,113,250,110,251,110,251,111,252,111,253,116,252,116",
+        "zoneName": "GMT"
+    }, {
+        "timezone": "Africa/Kigali",
+        "country": "RW",
+        "pin": "292,128",
+        "offset": 2,
+        "points": "292,128,291,129,290,129,291,127,292,126,293,128,292,128",
+        "zoneName": "CAT"
+    }, {
+        "timezone": "Africa/Luanda",
+        "country": "AO",
+        "pin": "268,137",
+        "offset": 1,
+        "points": "281,140,281,141,283,140,283,143,281,143,281,148,283,149,279,150,276,149,269,149,268,149,266,149,267,144,269,142,269,140,268,138,269,137,267,133,273,133,274,136,277,136,277,135,280,135,280,138,281,140",
+        "zoneName": "WAT"
+    }, {
+        "timezone": "Africa/Lubumbashi",
+        "country": "CD",
+        "pin": "288,141",
+        "offset": 2,
+        "points": "291,132,291,134,293,136,290,137,289,138,290,139,289,141,290,142,291,142,291,144,290,144,288,141,287,142,286,142,285,141,284,141,283,140,281,141,280,135,278,135,277,134,278,133,278,131,279,131,279,128,281,128,281,128,281,128,284,127,282,126,283,126,282,126,283,125,281,123,281,122,283,122,281,120,283,120,281,119,282,118,285,118,285,118,288,118,289,119,291,119,293,120,293,122,293,122,292,124,291,127,290,128,291,132",
+        "zoneName": "CAT"
+    }, {
+        "timezone": "Africa/Lusaka",
+        "country": "ZM",
+        "pin": "289,146",
+        "offset": 2,
+        "points": "290,147,290,148,287,150,284,149,283,149,281,148,281,143,283,143,283,140,284,141,285,141,286,142,287,142,288,141,290,144,291,144,291,142,290,142,289,141,290,139,289,138,290,137,293,136,296,138,297,140,296,140,297,142,295,144,296,144,292,146,292,147,290,147",
+        "zoneName": "CAT"
+    }, {
+        "timezone": "Africa/Malabo",
+        "country": "GQ",
+        "pin": "262,120",
+        "offset": 1,
+        "points": "266,123,266,124,263,123,264,122,266,122,266,123",
+        "zoneName": "WAT"
+    }, {
+        "timezone": "Africa/Maputo",
+        "country": "MZ",
+        "pin": "295,161",
+        "offset": 2,
+        "points": "296,160,295,161,295,162,296,161,296,162,295,162,294,159,293,156,295,155,296,153,295,151,296,148,292,147,292,146,296,144,297,145,298,145,298,146,298,147,299,149,300,146,298,144,298,141,302,141,306,140,306,146,305,148,303,149,300,151,298,152,298,154,299,156,299,158,296,160",
+        "zoneName": "CAT"
+    }, {
+        "timezone": "Africa/Mbabane",
+        "country": "SZ",
+        "pin": "293,162",
+        "offset": 2,
+        "points": "294,161,295,162,294,163,293,162,294,161,294,161",
+        "zoneName": "SAST"
+    }, {
+        "timezone": "Africa/Mogadishu",
+        "country": "SO",
+        "pin": "313,122",
+        "offset": 3,
+        "points": "310,125,308,127,307,126,307,121,308,119,312,118,317,114,311,113,309,110,310,109,312,111,321,109,321,111,321,111,321,111,321,112,317,119,310,125",
+        "zoneName": "EAT"
+    }, {
+        "timezone": "Africa/Monrovia",
+        "country": "LR",
+        "pin": "235,116",
+        "offset": 0,
+        "points": "239,118,240,119,238,119,234,116,236,113,237,113,237,115,238,115,238,114,239,115,238,116,240,117,239,118",
+        "zoneName": "GMT"
+    }, {
+        "timezone": "Africa/Nairobi",
+        "country": "KE",
+        "pin": "301,127",
+        "offset": 3,
+        "points": "308,127,306,129,304,131,302,130,302,129,297,126,297,125,299,122,297,119,298,119,300,119,305,120,307,119,308,119,307,121,307,126,308,127",
+        "zoneName": "EAT"
+    }, {
+        "timezone": "Africa/Maseru",
+        "country": "LS",
+        "pin": "288,166",
+        "offset": 2,
+        "points": "289,167,289,167,288,166,290,165,291,166,289,167",
+        "zoneName": "SAST"
+    }, {
+        "timezone": "Africa/Ndjamena",
+        "country": "TD",
+        "pin": "271,108",
+        "offset": 1,
+        "points": "278,112,276,113,276,114,272,115,269,112,270,111,272,111,271,110,271,107,270,107,269,105,272,102,272,97,271,95,271,93,272,92,283,98,283,103,282,103,280,107,281,107,282,110,280,110,279,112,278,112",
+        "zoneName": "WAT"
+    }, {
+        "timezone": "Africa/Niamey",
+        "country": "NE",
+        "pin": "253,106",
+        "offset": 1,
+        "points": "256,106,255,108,255,109,254,108,253,108,253,107,251,107,252,106,251,106,250,104,255,104,256,101,256,98,258,98,267,92,270,94,271,93,271,95,272,97,272,102,269,105,269,106,267,107,265,106,263,107,261,106,260,107,258,106,256,106",
+        "zoneName": "WAT"
+    }, {
+        "timezone": "Africa/Nouakchott",
+        "country": "MR",
+        "pin": "228,100",
+        "offset": 0,
+        "points": "234,103,233,105,230,102,227,102,227,103,228,100,227,98,228,97,227,95,226,96,232,95,232,93,233,92,233,89,238,89,238,87,243,90,241,90,242,103,237,103,235,104,234,103",
+        "zoneName": "GMT"
+    }, {
+        "timezone": "Africa/Ouagadougou",
+        "country": "BF",
+        "pin": "248,108",
+        "offset": 0,
+        "points": "249,110,246,110,246,112,246,111,243,112,242,111,242,109,244,108,244,106,245,107,247,105,250,104,250,104,251,106,252,106,251,107,253,107,253,109,252,110,249,110",
+        "zoneName": "GMT"
+    }, {
+        "timezone": "Africa/Porto-Novo",
+        "country": "BJ",
+        "pin": "254,116",
+        "offset": 1,
+        "points": "254,114,254,116,252,116,252,112,251,111,252,109,253,109,254,108,255,109,255,110,254,112,254,114",
+        "zoneName": "WAT"
+    }, {
+        "timezone": "Africa/Tunis",
+        "country": "TN",
+        "pin": "264,74",
+        "offset": 1,
+        "points": "266,80,264,81,264,82,263,83,263,80,261,79,260,78,262,76,261,74,263,73,264,73,264,74,265,74,265,75,266,76,264,78,266,79,266,80",
+        "zoneName": "CET"
+    }, {
+        "timezone": "Africa/Sao_Tome",
+        "country": "ST",
+        "pin": "259,125",
+        "offset": 0,
+        "points": "260,123,260,123,260,123",
+        "zoneName": "GMT"
+    }, {
+        "timezone": "Africa/Tripoli",
+        "country": "LY",
+        "pin": "268,79",
+        "offset": 2,
+        "points": "285,88,285,97,283,97,283,98,272,92,270,94,264,91,263,89,264,88,264,86,263,83,264,82,264,81,266,80,266,79,271,80,272,81,276,83,278,82,278,80,281,79,282,80,285,81,284,83,285,88",
+        "zoneName": "EET"
+    }, {
+        "timezone": "Africa/Windhoek",
+        "country": "NA",
+        "pin": "274,156",
+        "offset": 2,
+        "points": "278,163,278,164,277,165,274,165,274,164,273,165,272,164,271,162,270,156,267,151,266,149,268,149,269,149,276,149,279,150,284,149,285,150,283,151,282,150,279,150,279,156,278,156,278,163",
+        "zoneName": "WAST"
+    }, {
+        "timezone": "America/Adak",
+        "country": "US",
+        "pin": "5,53",
+        "offset": -10,
+        "points": "7,53,6,53,8,52,7,53",
+        "zoneName": "HST"
+    }, {
+        "timezone": "America/Argentina/Salta",
+        "country": "AR",
+        "pin": "159,159",
+        "offset": -3,
+        "points": "162,180,162,182,163,182,160,182,160,183,150,183,150,180,152,179,151,176,152,175,153,177,155,177,155,175,160,175,160,174,162,174,162,180",
+        "zoneName": "ART"
+    }, {
+        "timezone": "America/Argentina/Salta",
+        "country": "AR",
+        "pin": "159,159",
+        "offset": -3,
+        "points": "159,156,161,157,161,156,163,156,163,156,163,159,162,161,158,162,157,161,158,160,155,160,155,159,157,158,158,159,158,157,159,159,161,159,161,158,160,158,159,156",
+        "zoneName": "ART"
+    }, {
+        "timezone": "America/Anchorage",
+        "country": "US",
+        "pin": "42,40",
+        "offset": -9,
+        "points": "42,42,40,43,39,43,40,42,39,42,40,41,43,41,42,40,42,40,40,40,36,43,37,43,36,44,30,47,30,47,25,48,25,48,27,48,27,47,31,45,31,44,32,43,30,44,30,43,29,44,27,43,25,44,25,37,27,36,26,36,27,35,25,35,25,33,26,33,25,33,25,32,26,33,25,32,25,27,33,26,34,26,33,27,35,26,39,27,39,27,38,27,39,27,51,28,54,28,54,42,54,41,50,42,46,41,47,40,44,40,45,40,43,41,44,41,44,41,44,41,42,42",
+        "zoneName": "AKST"
+    }, {
+        "timezone": "America/Anguilla",
+        "country": "AI",
+        "pin": "162,100",
+        "offset": -4,
+        "points": "162,100,162,100,162,100",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Antigua",
+        "country": "AG",
+        "pin": "164,101",
+        "offset": -4,
+        "points": "164,101,164,101,164,101",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Araguaina",
+        "country": "BR",
+        "pin": "183,135",
+        "offset": -3,
+        "points": "185,136,185,136,185,138,186,139,185,141,186,141,186,143,184,143,182,143,182,142,181,143,180,143,180,142,180,143,180,140,182,137,182,135,183,134,183,133,183,132,184,133,184,135,185,136",
+        "zoneName": "BRT"
+    }, {
+        "timezone": "America/Argentina/Buenos_Aires",
+        "country": "AR",
+        "pin": "169,173",
+        "offset": -3,
+        "points": "167,171,169,172,169,173,171,174,170,175,171,176,169,178,165,179,163,179,164,180,163,180,163,181,164,181,163,182,162,182,162,173,164,173,165,172,167,171",
+        "zoneName": "ART"
+    }, {
+        "timezone": "America/Argentina/Catamarca",
+        "country": "AR",
+        "pin": "159,165",
+        "offset": -3,
+        "points": "159,188,157,188,156,189,151,189,151,188,150,187,151,187,150,187,151,186,150,184,160,183,161,184,161,183,162,184,160,184,161,185,159,186,159,188",
+        "zoneName": "ART"
+    }, {
+        "timezone": "America/Argentina/Catamarca",
+        "country": "AR",
+        "pin": "159,165",
+        "offset": -3,
+        "points": "160,167,158,164,154,164,155,162,155,160,158,160,157,161,159,162,158,163,159,164,159,164,160,167",
+        "zoneName": "ART"
+    }, {
+        "timezone": "America/Argentina/Cordoba",
+        "country": "AR",
+        "pin": "161,169",
+        "offset": -3,
+        "points": "163,173,162,173,162,174,160,174,160,170,159,169,159,168,160,166,159,164,161,161,162,161,163,159,163,156,165,158,170,160,169,163,173,163,174,162,174,161,175,161,175,163,173,164,170,167,169,172,166,171,164,173,163,173",
+        "zoneName": "ART"
+    }, {
+        "timezone": "America/Argentina/Jujuy",
+        "country": "AR",
+        "pin": "159,159",
+        "offset": -3,
+        "points": "157,157,158,155,159,156,159,157,160,158,161,158,161,159,160,159,159,159,158,157,158,159,157,158,157,157",
+        "zoneName": "ART"
+    }, {
+        "timezone": "America/Argentina/La_Rioja",
+        "country": "AR",
+        "pin": "157,166",
+        "offset": -3,
+        "points": "156,167,154,166,154,165,153,164,154,164,158,164,160,167,159,169,157,169,156,167",
+        "zoneName": "ART"
+    }, {
+        "timezone": "America/Argentina/Mendoza",
+        "country": "AR",
+        "pin": "154,171",
+        "offset": -3,
+        "points": "152,170,156,170,157,171,157,175,155,175,155,177,153,177,152,175,152,174,153,171,152,170",
+        "zoneName": "ART"
+    }, {
+        "timezone": "America/Argentina/Rio_Gallegos",
+        "country": "AR",
+        "pin": "154,197",
+        "offset": -3,
+        "points": "151,189,156,189,157,190,159,191,158,192,154,195,154,197,155,198,150,197,149,197,150,195,148,196,148,195,148,193,150,192,149,191,150,191,151,189",
+        "zoneName": "ART"
+    }, {
+        "timezone": "America/Argentina/San_Juan",
+        "country": "AR",
+        "pin": "155,169",
+        "offset": -3,
+        "points": "153,167,154,164,154,165,154,166,156,167,157,169,156,169,156,170,154,169,152,170,152,168,153,167",
+        "zoneName": "ART"
+    }, {
+        "timezone": "America/Argentina/San_Luis",
+        "country": "AR",
+        "pin": "158,171",
+        "offset": -3,
+        "points": "159,169,160,170,160,175,157,175,156,169,159,169",
+        "zoneName": "ART"
+    }, {
+        "timezone": "America/Argentina/Tucuman",
+        "country": "AR",
+        "pin": "159,162",
+        "offset": -3,
+        "points": "158,161,160,161,160,164,159,164,158,163,159,162,158,161",
+        "zoneName": "ART"
+    }, {
+        "timezone": "America/Aruba",
+        "country": "AW",
+        "pin": "153,108",
+        "offset": -4,
+        "points": "153,108,153,108,153,108",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Argentina/Ushuaia",
+        "country": "AR",
+        "pin": "155,201",
+        "offset": -3,
+        "points": "155,201,155,198,155,199,155,199,156,200,160,201,158,201,155,201",
+        "zoneName": "ART"
+    }, {
+        "timezone": "America/Asuncion",
+        "country": "PY",
+        "pin": "170,160",
+        "offset": -3,
+        "points": "174,161,173,163,169,163,170,160,165,158,163,156,164,152,167,152,169,152,169,156,172,156,173,158,175,158,174,161",
+        "zoneName": "PYST"
+    }, {
+        "timezone": "America/Bahia_Banderas",
+        "country": "MX",
+        "pin": "104,96",
+        "offset": -6,
+        "points": "104,96,103,96,104,96",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Atikokan",
+        "country": "CA",
+        "pin": "123,57",
+        "offset": -5,
+        "points": "125,58,122,58,123,57,124,57,124,58,125,58",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Bahia",
+        "country": "BR",
+        "pin": "197,143",
+        "offset": -2,
+        "points": "187,146,186,146,186,141,185,141,186,140,187,139,188,140,189,140,189,138,191,138,193,137,194,138,195,137,197,137,198,139,197,140,198,141,196,143,196,147,195,150,194,149,195,147,194,147,193,147,192,146,189,145,189,145,187,146",
+        "zoneName": "BRT"
+    }, {
+        "timezone": "America/Barbados",
+        "country": "BB",
+        "pin": "167,107",
+        "offset": -4,
+        "points": "167,106,167,107,167,106",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Belem",
+        "country": "BR",
+        "pin": "183,127",
+        "offset": -3,
+        "points": "179,126,180,125,179,126,180,125,183,125,182,127,180,128,182,127,181,128,183,127,183,126,186,127,185,130,182,132,183,133,182,135,182,137,180,139,177,138,178,138,177,136,178,134,177,132,177,130,178,129,177,127,178,127,177,126,176,123,174,122,174,122,177,122,178,119,180,122,181,123,179,126",
+        "zoneName": "BRT"
+    }, {
+        "timezone": "America/Belize",
+        "country": "BZ",
+        "pin": "128,101",
+        "offset": -6,
+        "points": "128,101,128,101,128,101",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Blanc-Sablon",
+        "country": "CA",
+        "pin": "171,54",
+        "offset": -4,
+        "points": "169,54,167,55,169,54",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Boa_Vista",
+        "country": "BR",
+        "pin": "166,121",
+        "offset": -4,
+        "points": "167,118,166,119,167,120,167,121,167,122,168,123,168,125,167,125,166,126,165,126,164,127,163,126,163,122,161,122,160,119,163,120,163,119,165,119,166,118,167,118",
+        "zoneName": "AMT"
+    }, {
+        "timezone": "America/Bogota",
+        "country": "CO",
+        "pin": "147,119",
+        "offset": -5,
+        "points": "154,126,153,131,152,130,153,129,152,128,150,128,149,128,146,125,142,124,140,123,143,120,142,119,143,117,142,115,143,114,143,113,143,114,143,113,145,112,145,110,148,109,150,108,151,108,149,110,148,112,149,113,149,115,150,115,153,115,154,117,156,117,156,119,157,120,156,121,157,122,157,123,156,122,153,123,153,124,154,124,153,124,154,126",
+        "zoneName": "COT"
+    }, {
+        "timezone": "America/Boise",
+        "country": "US",
+        "pin": "89,64",
+        "offset": -7,
+        "points": "96,66,96,67,87,67,87,66,86,66,86,64,87,63,88,62,88,61,89,62,92,62,93,63,96,63,96,66",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Cambridge_Bay",
+        "country": "CA",
+        "pin": "104,29",
+        "offset": -7,
+        "points": "99,18,100,19,99,19,101,19,100,20,102,19,104,20,103,21,97,21,97,20,99,20,97,20,98,19,97,19,99,18",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Cambridge_Bay",
+        "country": "CA",
+        "pin": "104,29",
+        "offset": -7,
+        "points": "108,36,97,35,95,34,92,34,81,30,81,28,89,29,92,30,89,31,90,31,97,31,100,32,99,32,101,33,100,32,101,32,101,32,101,32,100,31,103,30,99,30,100,30,103,29,105,31,106,30,109,31,113,31,113,30,115,30,116,30,116,31,117,30,116,31,118,32,117,30,120,30,120,30,120,29,119,30,120,28,116,28,117,27,116,27,116,26,119,25,118,25,120,25,121,26,121,27,123,28,122,27,121,28,122,28,121,28,125,29,123,29,124,29,124,30,125,30,126,29,126,32,108,32,108,36",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Cambridge_Bay",
+        "country": "CA",
+        "pin": "104,29",
+        "offset": -7,
+        "points": "115,24,116,24,116,25,116,25,114,25,114,26,113,26,107,24,111,24,110,23,115,24",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Cambridge_Bay",
+        "country": "CA",
+        "pin": "104,29",
+        "offset": -7,
+        "points": "100,23,103,24,105,26,105,26,110,27,110,28,106,28,107,28,107,29,108,28,109,29,107,29,104,29,104,29,102,28,99,30,93,30,92,29,93,29,88,29,87,28,97,28,97,24,99,24,100,26,101,25,100,23,100,23",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Campo_Grande",
+        "country": "BR",
+        "pin": "174,153",
+        "offset": -3,
+        "points": "176,150,177,151,179,152,179,153,175,158,173,158,172,156,169,156,170,150,172,149,173,150,175,149,175,150,176,150",
+        "zoneName": "AMST"
+    }, {
+        "timezone": "America/Cancun",
+        "country": "MX",
+        "pin": "129,96",
+        "offset": -6,
+        "points": "128,95,130,96,128,98,129,98,128,100,128,99,127,100,126,100,126,98,128,96,128,95",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Caracas",
+        "country": "VE",
+        "pin": "157,110",
+        "offset": -4.5,
+        "points": "163,111,165,112,165,113,167,113,166,115,166,115,165,116,165,117,166,118,163,119,163,120,160,119,161,122,162,122,159,124,159,124,158,124,157,123,157,122,156,121,157,120,156,119,156,116,154,117,153,115,150,115,149,112,148,112,149,110,151,109,150,109,151,110,150,111,150,112,151,112,151,112,151,110,153,109,153,108,153,109,155,109,155,110,158,110,160,111,162,110,161,110,164,110,163,110,163,111",
+        "zoneName": "VET"
+    }, {
+        "timezone": "America/Cayenne",
+        "country": "GF",
+        "pin": "177,118",
+        "offset": -3,
+        "points": "176,117,178,119,177,122,175,122,175,120,174,118,175,117,176,117",
+        "zoneName": "GFT"
+    }, {
+        "timezone": "America/Cayman",
+        "country": "KY",
+        "pin": "137,98",
+        "offset": -5,
+        "points": "139,98,139,98,139,98",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Chicago",
+        "country": "US",
+        "pin": "128,67",
+        "offset": -6,
+        "points": "128,72,132,74,132,75,131,76,132,80,132,84,130,83,130,83,129,83,129,82,128,83,128,82,128,83,124,83,126,83,125,84,126,84,126,85,125,84,125,85,120,83,118,84,118,84,118,85,116,86,117,85,116,85,116,86,115,86,115,87,114,87,115,87,115,89,112,88,112,87,109,84,107,84,107,85,105,84,104,82,104,81,107,81,107,74,108,74,108,73,109,73,109,70,108,70,108,69,109,69,109,67,110,67,109,64,111,63,110,63,111,62,111,61,109,61,110,60,110,59,106,59,105,57,118,57,118,56,119,57,126,58,122,60,124,60,124,60,128,61,128,62,128,63,129,63,128,66,129,67,130,67,128,68,128,72",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Chihuahua",
+        "country": "MX",
+        "pin": "103,85",
+        "offset": -7,
+        "points": "106,85,106,86,106,88,105,88,103,88,101,89,98,86,99,86,99,82,100,82,100,81,102,81,104,83,105,84,106,85",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Coral_Harbour",
+        "country": "",
+        "pin": "250,125",
+        "offset": -5,
+        "points": "131,33,132,34,133,34,136,35,137,36,136,36,139,36,137,37,135,36,131,37,131,36,129,37,130,36,130,34,131,33",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Costa_Rica",
+        "country": "CR",
+        "pin": "133,111",
+        "offset": -6,
+        "points": "132,112,131,111,131,109,134,110,135,112,135,112,135,114,131,111,132,112",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Creston",
+        "country": "CA",
+        "pin": "88,57",
+        "offset": -7,
+        "points": "89,57,87,57,88,56,89,57",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Cuiaba",
+        "country": "BR",
+        "pin": "172,147",
+        "offset": -3,
+        "points": "179,146,176,148,176,150,175,150,175,149,173,150,172,149,170,150,169,149,169,148,166,148,166,144,167,142,167,141,165,140,164,137,169,137,169,135,170,137,171,138,180,139,180,141,180,143,179,146",
+        "zoneName": "AMST"
+    }, {
+        "timezone": "America/Curacao",
+        "country": "CW",
+        "pin": "154,108",
+        "offset": -4,
+        "points": "154,108,154,108,154,108",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Danmarkshavn",
+        "country": "GL",
+        "pin": "224,18",
+        "offset": 0,
+        "points": "223,15,223,15,224,15,221,16,221,16,220,17,221,17,223,17,224,17,221,17,224,18,225,18,218,18,223,19,220,19,223,20,218,20,219,14,223,15",
+        "zoneName": "GMT"
+    }, {
+        "timezone": "America/Dawson",
+        "country": "CA",
+        "pin": "56,36",
+        "offset": -8,
+        "points": "56,36,56,36,56,36",
+        "zoneName": "PST"
+    }, {
+        "timezone": "America/Dawson_Creek",
+        "country": "CA",
+        "pin": "83,42",
+        "offset": -7,
+        "points": "83,45,83,50,79,48,78,46,83,45",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Denver",
+        "country": "US",
+        "pin": "104,70",
+        "offset": -7,
+        "points": "93,63,92,62,91,62,91,60,89,59,89,57,105,57,106,59,108,59,108,60,110,61,109,61,111,61,111,62,110,63,111,63,109,64,110,67,109,67,109,69,108,69,108,70,109,70,109,73,108,73,108,74,107,74,107,81,104,81,104,82,102,81,99,81,99,76,96,76,95,74,95,74,92,74,92,67,96,67,96,63,93,63",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Detroit",
+        "country": "US",
+        "pin": "135,66",
+        "offset": -5,
+        "points": "132,67,129,67,130,66,130,64,130,63,131,62,132,63,132,61,134,62,134,62,134,63,133,65,135,64,136,65,134,67,132,67",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Detroit",
+        "country": "US",
+        "pin": "135,66",
+        "offset": -5,
+        "points": "125,60,127,59,127,60,130,61,132,60,134,61,131,61,130,62,129,61,128,62,129,62,128,61,126,61,125,60",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Dominica",
+        "country": "DM",
+        "pin": "165,104",
+        "offset": -4,
+        "points": "165,103,165,104,165,103",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Edmonton",
+        "country": "CA",
+        "pin": "92,51",
+        "offset": -7,
+        "points": "92,57,88,56,88,55,85,53,86,52,86,52,83,51,83,42,97,42,97,51,99,51,97,52,97,57,92,57",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Eirunepe",
+        "country": "BR",
+        "pin": "153,134",
+        "offset": -4,
+        "points": "156,138,148,135,148,134,149,132,150,131,153,131,156,138",
+        "zoneName": "ACT"
+    }, {
+        "timezone": "America/El_Salvador",
+        "country": "SV",
+        "pin": "126,106",
+        "offset": -6,
+        "points": "126,106,125,106,126,105,128,106,128,107,126,106",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Fortaleza",
+        "country": "BR",
+        "pin": "197,130",
+        "offset": -3,
+        "points": "201,134,202,135,201,135,199,137,198,136,198,135,197,136,194,135,194,136,192,138,189,138,189,140,187,140,186,139,185,138,185,136,184,135,184,133,182,132,185,130,186,126,187,127,187,127,188,127,188,128,188,130,188,128,189,129,190,128,191,129,194,129,198,132,201,132,201,134",
+        "zoneName": "BRT"
+    }, {
+        "timezone": "America/Glace_Bay",
+        "country": "CA",
+        "pin": "167,61",
+        "offset": -4,
+        "points": "167,61,166,61,166,61,167,61",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Godthab",
+        "country": "GL",
+        "pin": "178,36",
+        "offset": -3,
+        "points": "188,42,187,42,188,41,187,41,188,41,187,41,187,41,186,41,187,40,186,41,187,40,183,41,184,40,183,40,183,40,182,40,183,39,182,39,182,39,181,39,182,39,181,39,182,39,180,38,181,37,180,38,180,38,180,37,180,37,179,37,180,37,179,37,180,37,179,37,179,36,178,36,180,36,178,36,180,35,179,35,180,35,181,36,179,34,180,35,178,36,178,35,179,35,177,35,178,34,177,34,180,34,177,34,177,34,176,34,178,33,176,33,180,32,175,33,176,33,175,33,177,33,176,32,177,32,175,32,180,32,175,31,181,31,177,31,178,31,175,31,176,30,178,31,176,30,180,31,179,30,179,30,176,30,179,30,180,29,179,30,179,29,180,29,180,29,180,29,180,29,179,29,180,28,179,28,180,28,174,27,180,27,179,27,179,27,178,26,179,26,177,26,178,26,177,26,179,26,176,26,178,25,176,25,175,25,175,26,173,26,172,25,174,25,173,25,174,25,173,24,174,24,173,23,174,23,172,23,173,22,172,22,172,22,170,22,172,21,168,20,169,20,169,20,161,19,158,15,160,15,160,14,162,14,156,13,162,12,163,13,162,12,165,12,165,12,166,12,165,11,166,11,172,12,167,11,169,11,174,1
 1,176,11,175,12,176,11,181,12,179,11,181,11,179,10,180,10,188,11,189,11,188,11,188,11,188,11,191,11,186,10,195,10,187,10,196,10,196,10,199,10,196,9,202,9,214,9,201,10,215,9,216,10,214,10,220,10,204,11,216,11,213,12,213,12,221,11,220,12,217,13,224,12,223,12,228,11,234,12,229,13,221,13,228,13,221,14,222,14,226,14,225,14,219,14,218,20,223,20,223,21,219,20,220,20,219,20,222,21,219,21,224,22,219,22,219,22,219,22,220,23,220,22,222,22,221,23,219,23,217,23,219,23,214,22,216,23,212,23,213,23,212,23,212,24,215,24,212,24,216,24,213,24,215,24,215,25,216,25,216,26,210,25,212,25,210,26,215,26,211,26,212,26,209,27,213,27,210,28,212,28,215,27,219,28,213,30,208,30,206,30,205,30,206,31,204,31,202,33,198,33,198,34,197,33,198,33,197,33,197,33,197,33,197,34,195,34,194,34,195,34,194,35,193,35,194,36,192,36,194,36,194,37,192,36,193,37,192,37,192,37,191,37,192,38,190,38,191,38,190,38,192,39,190,39,191,39,190,40,191,40,189,40,191,40,190,41,190,41,189,41,190,42,189,41,188,42",
+        "zoneName": "WGT"
+    }, {
+        "timezone": "America/Goose_Bay",
+        "country": "CA",
+        "pin": "166,51",
+        "offset": -4,
+        "points": "171,53,161,53,161,52,162,52,162,52,161,52,160,53,158,53,158,51,156,52,157,51,156,50,157,49,156,49,157,49,157,48,159,49,161,49,162,48,161,48,161,47,162,47,161,47,162,45,160,44,162,43,160,43,161,43,161,42,160,42,160,41,162,43,161,43,163,43,162,44,163,44,162,44,164,45,163,45,165,46,163,46,164,46,164,47,166,48,166,48,166,49,167,48,167,48,168,48,167,49,168,48,168,49,170,49,167,50,169,50,166,51,170,50,171,50,170,51,171,53",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Grand_Turk",
+        "country": "TC",
+        "pin": "151,95",
+        "offset": -5,
+        "points": "151,95,151,95,151,95",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Grenada",
+        "country": "GD",
+        "pin": "164,108",
+        "offset": -4,
+        "points": "165,108,165,108,165,108",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Guadeloupe",
+        "country": "GP",
+        "pin": "165,102",
+        "offset": -4,
+        "points": "165,102,165,102,165,102",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Guatemala",
+        "country": "GT",
+        "pin": "124,105",
+        "offset": -6,
+        "points": "125,106,123,105,122,104,123,103,124,103,123,101,124,101,124,100,126,100,126,103,127,103,125,106",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Guayaquil",
+        "country": "EC",
+        "pin": "139,128",
+        "offset": -5,
+        "points": "141,130,140,132,139,131,138,131,139,128,139,129,137,128,139,124,141,123,142,124,144,124,145,125,145,125,146,126,141,130",
+        "zoneName": "ECT"
+    }, {
+        "timezone": "America/Guyana",
+        "country": "GY",
+        "pin": "169,116",
+        "offset": -4,
+        "points": "170,116,171,118,170,118,169,119,172,122,170,122,168,123,167,122,167,121,167,120,166,119,167,118,165,117,165,116,166,115,166,115,167,114,167,113,169,115,169,116,169,115,170,116",
+        "zoneName": "GYT"
+    }, {
+        "timezone": "America/Halifax",
+        "country": "CA",
+        "pin": "162,63",
+        "offset": -4,
+        "points": "161,63,162,62,160,62,161,61,163,62,164,61,165,62,161,63,159,65,158,64,158,63,160,62,161,63",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Havana",
+        "country": "CU",
+        "pin": "136,93",
+        "offset": -5,
+        "points": "146,96,147,97,142,97,143,96,141,96,141,95,136,94,136,94,137,94,136,93,132,95,134,93,138,93,146,96",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Hermosillo",
+        "country": "MX",
+        "pin": "96,85",
+        "offset": -7,
+        "points": "90,81,91,80,96,81,99,81,99,86,98,86,99,88,98,88,96,87,97,86,94,85,93,82,90,81",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Indiana/Petersburg",
+        "country": "US",
+        "pin": "129,72",
+        "offset": -5,
+        "points": "129,72,129,72,129,72",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Indiana/Tell_City",
+        "country": "US",
+        "pin": "129,72",
+        "offset": -6,
+        "points": "130,72,130,72,130,72",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Indiana/Vevay",
+        "country": "US",
+        "pin": "132,71",
+        "offset": -5,
+        "points": "132,71,132,71,132,71",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Indiana/Indianapolis",
+        "country": "US",
+        "pin": "130,70",
+        "offset": -5,
+        "points": "132,71,130,72,130,71,128,71,128,68,130,68,130,67,132,67,132,70,132,71",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Indiana/Knox",
+        "country": "US",
+        "pin": "130,68",
+        "offset": -6,
+        "points": "130,67,129,68,130,67",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Indiana/Marengo",
+        "country": "US",
+        "pin": "130,72",
+        "offset": -5,
+        "points": "130,72,130,72,130,72,130,72",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Indiana/Vincennes",
+        "country": "US",
+        "pin": "128,71",
+        "offset": -5,
+        "points": "128,72,128,71,130,71,130,72,128,72",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Indiana/Winamac",
+        "country": "US",
+        "pin": "130,68",
+        "offset": -5,
+        "points": "130,68,129,68,130,68",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Inuvik",
+        "country": "CA",
+        "pin": "64,30",
+        "offset": -7,
+        "points": "65,30,64,30,65,30",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Iqaluit",
+        "country": "CA",
+        "pin": "155,36",
+        "offset": -5,
+        "points": "139,20,138,20,140,20,138,21,140,21,132,21,132,20,139,20",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Iqaluit",
+        "country": "CA",
+        "pin": "155,36",
+        "offset": -5,
+        "points": "139,10,145,10,144,11,145,10,142,10,156,10,155,10,156,10,156,12,154,12,156,12,152,12,156,12,156,13,152,13,153,14,149,14,152,14,151,14,147,14,146,14,148,15,142,15,147,15,142,15,146,16,143,16,145,16,145,17,141,17,142,17,141,18,136,18,142,18,141,19,137,19,138,19,135,18,136,19,132,19,132,18,134,18,134,17,136,17,132,17,132,15,136,16,134,16,137,15,132,15,134,15,132,15,132,14,138,14,139,14,134,13,144,13,140,13,143,12,140,12,140,12,139,13,132,13,132,12,136,12,132,12,132,11,133,11,132,10,140,11,135,11,138,10,137,10,141,10,138,10,139,10",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Iqaluit",
+        "country": "CA",
+        "pin": "155,36",
+        "offset": -5,
+        "points": "132,30,133,29,132,29,132,28,136,28,134,28,137,29,136,29,137,30,135,30,137,31,134,33,133,32,132,32,132,30",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Iqaluit",
+        "country": "CA",
+        "pin": "155,36",
+        "offset": -5,
+        "points": "144,24,140,24,138,23,142,23,144,24",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Iqaluit",
+        "country": "CA",
+        "pin": "155,36",
+        "offset": -5,
+        "points": "133,23,137,23,139,24,138,24,138,24,138,25,139,24,142,25,140,25,142,25,141,24,142,24,146,24,146,25,144,25,147,25,145,26,146,25,146,26,148,25,147,26,148,26,147,26,149,26,148,26,149,25,151,26,149,27,150,27,149,27,152,26,150,27,151,27,151,28,153,27,152,27,155,27,152,28,155,28,153,28,156,27,155,28,153,28,156,29,154,29,155,29,154,29,155,29,155,29,156,29,154,29,156,30,156,33,155,33,156,34,156,37,154,36,156,37,156,39,151,37,150,37,151,37,149,36,148,36,148,35,148,36,148,35,147,36,147,35,146,35,146,35,147,36,142,36,141,35,142,34,148,34,147,33,150,32,148,30,148,30,147,30,148,30,145,29,144,30,145,29,143,28,143,28,143,28,143,28,142,28,142,27,140,27,139,27,140,27,141,28,136,28,138,28,135,27,137,28,132,28,132,26,133,25,132,25,132,25,133,25,132,25,132,24,133,24,132,23,133,24,132,23,133,23",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/La_Paz",
+        "country": "BO",
+        "pin": "155,148",
+        "offset": -4,
+        "points": "164,154,163,156,161,156,161,157,160,156,158,155,157,157,156,157,155,153,155,152,153,149,154,148,154,147,155,142,153,140,155,140,157,139,159,138,160,142,166,144,166,148,169,148,169,149,170,150,170,153,168,152,164,152,164,154",
+        "zoneName": "BOT"
+    }, {
+        "timezone": "America/Jamaica",
+        "country": "JM",
+        "pin": "143,100",
+        "offset": -5,
+        "points": "144,100,143,100,141,100,143,99,144,100",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Juneau",
+        "country": "US",
+        "pin": "63,44",
+        "offset": -9,
+        "points": "59,43,62,42,66,45,65,46,65,45,64,45,65,45,64,45,65,45,64,44,64,44,63,44,62,42,62,42,62,44,61,44,61,43,61,43,61,43,60,43,61,44,60,44,58,43,59,43",
+        "zoneName": "AKST"
+    }, {
+        "timezone": "America/Kentucky/Louisville",
+        "country": "US",
+        "pin": "131,72",
+        "offset": -5,
+        "points": "130,72,130,72,131,71,130,72",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Kentucky/Monticello",
+        "country": "US",
+        "pin": "132,74",
+        "offset": -5,
+        "points": "132,74,133,74,132,74,132,74",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Kralendijk",
+        "country": "BQ",
+        "pin": "155,108",
+        "offset": -4,
+        "points": "162,101,162,100,162,101",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Lima",
+        "country": "PE",
+        "pin": "143,142",
+        "offset": -5,
+        "points": "153,149,153,150,152,150,151,149,146,146,144,145,144,144,139,135,137,133,138,133,137,131,138,130,139,130,138,131,140,132,141,130,145,127,146,126,145,125,146,125,149,128,150,128,153,129,152,130,153,131,152,131,149,132,148,134,147,135,149,137,148,138,150,138,150,139,152,138,152,140,153,140,155,142,154,147,154,148,153,149",
+        "zoneName": "PET"
+    }, {
+        "timezone": "America/Managua",
+        "country": "NI",
+        "pin": "130,108",
+        "offset": -6,
+        "points": "132,110,131,110,128,107,129,107,129,106,131,106,132,104,135,104,134,110,132,110",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Manaus",
+        "country": "BR",
+        "pin": "167,129",
+        "offset": -4,
+        "points": "167,125,168,125,169,127,172,128,169,134,169,135,169,137,164,137,163,136,162,136,161,137,160,138,158,138,157,139,156,138,153,131,154,127,153,124,154,124,153,124,153,123,156,122,157,123,158,124,159,124,159,124,161,122,162,122,163,124,163,126,164,127,165,126,166,126,167,125",
+        "zoneName": "AMT"
+    }, {
+        "timezone": "America/Los_Angeles",
+        "country": "US",
+        "pin": "86,78",
+        "offset": -8,
+        "points": "91,62,88,62,88,61,88,62,87,63,86,64,86,66,87,66,87,67,92,67,92,75,91,75,91,77,91,79,91,79,87,80,85,78,82,77,82,76,80,73,80,72,79,72,78,71,77,69,78,67,77,66,78,61,78,61,78,61,78,60,78,60,78,60,78,60,77,58,80,58,79,59,80,58,80,59,79,60,80,59,80,57,89,57,89,59,91,60,91,62",
+        "zoneName": "PST"
+    }, {
+        "timezone": "America/Lower_Princes",
+        "country": "SX",
+        "pin": "162,100",
+        "offset": -4,
+        "points": "162,100,162,100,162,100",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Maceio",
+        "country": "BR",
+        "pin": "200,138",
+        "offset": -3,
+        "points": "199,140,198,141,197,140,198,139,197,138,198,137,199,138,201,137,199,140",
+        "zoneName": "BRT"
+    }, {
+        "timezone": "America/Marigot",
+        "country": "MF",
+        "pin": "162,100",
+        "offset": -4,
+        "points": "162,100,162,100,162,100",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Martinique",
+        "country": "MQ",
+        "pin": "165,105",
+        "offset": -4,
+        "points": "165,104,165,104,165,104",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Matamoros",
+        "country": "MX",
+        "pin": "115,89",
+        "offset": -6,
+        "points": "113,89,112,89,109,84,108,84,107,85,107,85,107,84,109,84,112,87,112,88,115,89,115,90,113,89",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Mazatlan",
+        "country": "MX",
+        "pin": "102,93",
+        "offset": -7,
+        "points": "104,93,106,95,105,96,104,96,104,95,103,94,100,90,98,89,98,88,100,88,101,90,104,93",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Mazatlan",
+        "country": "MX",
+        "pin": "102,93",
+        "offset": -7,
+        "points": "91,86,93,86,98,93,97,93,94,91,94,89,93,88,92,88,90,86,92,87,91,86",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Menominee",
+        "country": "US",
+        "pin": "128,62",
+        "offset": -6,
+        "points": "128,62,128,61,124,60,128,61,129,62,128,62",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Mexico_City",
+        "country": "MX",
+        "pin": "112,98",
+        "offset": -6,
+        "points": "119,103,118,102,116,103,114,103,104,98,103,97,104,96,105,96,106,95,105,94,106,92,108,91,107,90,110,91,111,93,114,94,117,99,119,100,122,99,122,100,124,100,124,101,123,101,124,102,123,103,122,105,119,102,119,103",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Merida",
+        "country": "MX",
+        "pin": "126,96",
+        "offset": -6,
+        "points": "124,96,125,95,128,95,128,96,126,98,126,100,122,100,122,99,123,99,124,96",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Metlakatla",
+        "country": "US",
+        "pin": "67,48",
+        "offset": -8,
+        "points": "67,48,67,48,67,48",
+        "zoneName": "PST"
+    }, {
+        "timezone": "America/Miquelon",
+        "country": "PM",
+        "pin": "172,60",
+        "offset": -3,
+        "points": "172,60,172,60,172,60",
+        "zoneName": "PMST"
+    }, {
+        "timezone": "America/Moncton",
+        "country": "CA",
+        "pin": "160,61",
+        "offset": -4,
+        "points": "157,58,160,59,159,60,160,60,160,61,161,61,158,62,156,62,156,62,156,60,154,59,155,58,157,58",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Monterrey",
+        "country": "MX",
+        "pin": "111,89",
+        "offset": -6,
+        "points": "107,90,108,91,106,92,105,94,104,94,101,90,103,88,105,88,106,88,106,86,106,85,108,84,109,84,112,89,115,89,115,90,115,90,114,90,114,94,111,93,110,91,107,90",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Montevideo",
+        "country": "UY",
+        "pin": "172,173",
+        "offset": -2,
+        "points": "172,173,170,173,169,172,170,167,171,167,172,168,173,168,176,170,175,173,172,173",
+        "zoneName": "UYT"
+    }, {
+        "timezone": "America/Montreal",
+        "country": "",
+        "pin": "250,125",
+        "offset": -5,
+        "points": "146,63,147,62,144,62,141,61,139,59,140,53,140,54,140,53,141,52,140,51,140,50,139,49,142,48,144,47,143,44,141,44,143,42,142,41,143,41,142,41,142,40,141,41,142,40,142,39,142,38,146,39,148,38,150,39,150,39,151,39,150,40,151,40,153,40,153,42,151,42,153,42,153,43,154,43,152,44,154,43,155,44,154,45,156,44,155,44,156,44,156,45,158,43,158,44,158,43,159,43,159,43,160,43,159,42,160,41,160,42,161,42,161,43,160,43,162,43,160,44,162,45,161,47,162,47,161,47,161,48,162,48,161,49,159,49,157,48,157,49,156,49,157,49,156,50,157,51,156,52,158,51,158,53,160,53,161,52,162,52,162,52,161,52,161,53,171,53,171,53,168,54,167,55,164,55,158,55,158,55,156,57,155,57,152,60,149,61,157,57,160,57,161,58,159,58,155,58,153,60,152,62,151,63,146,63",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Montserrat",
+        "country": "MS",
+        "pin": "164,102",
+        "offset": -4,
+        "points": "164,102,164,102,164,102",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Nassau",
+        "country": "BS",
+        "pin": "143,90",
+        "offset": -5,
+        "points": "143,90,143,90,143,90",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/New_York",
+        "country": "US",
+        "pin": "147,68",
+        "offset": -5,
+        "points": "132,82,131,76,132,75,133,74,130,72,132,71,132,71,132,67,136,67,140,66,140,65,144,65,144,64,146,63,152,62,154,59,156,60,156,62,157,63,155,64,154,63,154,64,152,64,151,66,152,67,153,67,153,67,151,67,151,67,151,68,148,68,146,71,145,70,146,72,145,73,145,72,144,71,145,70,144,70,144,72,143,72,144,72,143,72,144,74,143,73,144,74,145,75,144,74,145,75,143,75,145,76,143,76,144,76,143,76,144,76,144,77,138,80,137,82,139,88,138,90,137,90,136,88,136,88,136,88,135,87,136,86,135,86,135,84,133,83,131,84,132,82",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Nipigon",
+        "country": "CA",
+        "pin": "127,57",
+        "offset": -5,
+        "points": "127,57,127,57,127,57",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Nome",
+        "country": "US",
+        "pin": "20,35",
+        "offset": -9,
+        "points": "25,32,23,32,22,31,18,30,19,29,23,29,25,27,25,32",
+        "zoneName": "AKST"
+    }, {
+        "timezone": "America/Nome",
+        "country": "US",
+        "pin": "20,35",
+        "offset": -9,
+        "points": "25,35,24,36,19,35,18,35,19,34,16,34,23,33,22,33,25,33,25,35",
+        "zoneName": "AKST"
+    }, {
+        "timezone": "America/Nome",
+        "country": "US",
+        "pin": "20,35",
+        "offset": -9,
+        "points": "25,42,22,42,20,41,21,40,19,39,22,37,23,37,25,37,25,42",
+        "zoneName": "AKST"
+    }, {
+        "timezone": "America/Noronha",
+        "country": "BR",
+        "pin": "205,130",
+        "offset": -2,
+        "points": "205,130,205,130,205,130",
+        "zoneName": "FNT"
+    }, {
+        "timezone": "America/North_Dakota/Beulah",
+        "country": "US",
+        "pin": "109,59",
+        "offset": -6,
+        "points": "109,59,108,60,108,59,109,59",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/North_Dakota/Center",
+        "country": "US",
+        "pin": "109,60",
+        "offset": -6,
+        "points": "110,60,109,60,110,60",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/North_Dakota/New_Salem",
+        "country": "US",
+        "pin": "109,60",
+        "offset": -6,
+        "points": "110,60,110,60,110,61,108,60,110,60",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Ojinaga",
+        "country": "MX",
+        "pin": "105,84",
+        "offset": -7,
+        "points": "102,81,106,85,105,84,104,83,102,81,99,82,100,81,100,81,102,81",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Panama",
+        "country": "PA",
+        "pin": "140,113",
+        "offset": -5,
+        "points": "142,113,143,114,142,115,141,114,141,113,142,114,140,112,138,114,139,115,138,115,138,115,137,114,137,114,136,113,135,114,135,113,135,112,137,113,140,112,142,113",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Pangnirtung",
+        "country": "CA",
+        "pin": "159,33",
+        "offset": -5,
+        "points": "156,10,160,10,165,11,156,12,156,10",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Pangnirtung",
+        "country": "CA",
+        "pin": "159,33",
+        "offset": -5,
+        "points": "156,34,157,34,157,35,157,35,160,35,159,36,160,36,160,36,160,37,159,36,160,38,159,37,159,38,158,37,158,37,156,37,156,34",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Pangnirtung",
+        "country": "CA",
+        "pin": "159,33",
+        "offset": -5,
+        "points": "156,30,157,30,156,30,158,30,157,31,158,31,158,31,158,31,160,31,159,31,160,31,161,31,160,31,161,32,160,32,162,31,161,32,163,32,163,32,164,32,165,32,163,33,164,33,162,33,163,33,163,33,163,34,162,33,162,35,159,34,161,33,159,33,159,33,158,33,156,32,157,33,156,33,157,33,156,33,156,30",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Paramaribo",
+        "country": "SR",
+        "pin": "173,117",
+        "offset": -3,
+        "points": "175,118,175,120,174,122,172,121,172,122,171,122,169,119,170,118,171,118,171,117,175,117,175,118",
+        "zoneName": "SRT"
+    }, {
+        "timezone": "America/Phoenix",
+        "country": "US",
+        "pin": "94,79",
+        "offset": -7,
+        "points": "99,80,99,81,96,81,91,80,91,77,91,75,91,75,92,74,95,74,95,74,96,76,99,76,99,80",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Port-au-Prince",
+        "country": "HT",
+        "pin": "150,99",
+        "offset": -5,
+        "points": "148,99,149,99,148,99",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Port_of_Spain",
+        "country": "TT",
+        "pin": "165,110",
+        "offset": -4,
+        "points": "164,110,164,110,164,110",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Porto_Velho",
+        "country": "BR",
+        "pin": "161,137",
+        "offset": -4,
+        "points": "167,142,166,144,164,144,160,142,159,138,157,139,158,138,160,138,161,137,162,136,163,136,165,137,165,140,167,140,167,142",
+        "zoneName": "AMT"
+    }, {
+        "timezone": "America/Puerto_Rico",
+        "country": "PR",
+        "pin": "158,99",
+        "offset": -4,
+        "points": "158,99,158,99,158,99",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Rainy_River",
+        "country": "CA",
+        "pin": "119,57",
+        "offset": -6,
+        "points": "119,57,119,57,119,57",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Rankin_Inlet",
+        "country": "CA",
+        "pin": "122,38",
+        "offset": -6,
+        "points": "132,12,125,12,125,12,129,12,122,12,132,11,132,12",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Rankin_Inlet",
+        "country": "CA",
+        "pin": "122,38",
+        "offset": -6,
+        "points": "113,19,114,19,114,20,115,20,111,21,110,20,111,20,108,20,108,20,109,20,108,19,111,20,111,19,112,19,110,19,113,19",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Rankin_Inlet",
+        "country": "CA",
+        "pin": "122,38",
+        "offset": -6,
+        "points": "125,16,126,16,122,16,121,16,123,16,119,15,124,15,118,15,117,15,119,14,116,14,119,14,118,14,119,14,116,13,120,13,117,13,121,12,119,12,120,12,127,14,128,13,128,14,129,14,129,15,132,15,128,16,128,15,127,16,128,16,127,16,127,16,125,16",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Rankin_Inlet",
+        "country": "CA",
+        "pin": "122,38",
+        "offset": -6,
+        "points": "132,21,122,21,122,21,122,20,121,19,118,19,118,19,115,18,117,18,121,18,120,19,124,19,124,19,123,19,126,19,123,19,126,20,132,20,132,21",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Rankin_Inlet",
+        "country": "CA",
+        "pin": "122,38",
+        "offset": -6,
+        "points": "132,19,125,19,130,18,127,17,129,17,132,18,132,19",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Rankin_Inlet",
+        "country": "CA",
+        "pin": "122,38",
+        "offset": -6,
+        "points": "132,28,127,27,126,26,129,26,125,26,125,25,126,25,125,24,128,23,132,23,130,24,130,24,130,25,132,26,129,26,132,26,132,28",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Rankin_Inlet",
+        "country": "CA",
+        "pin": "122,38",
+        "offset": -6,
+        "points": "125,36,124,37,119,36,123,37,124,37,122,38,122,38,120,39,120,39,119,40,120,40,118,42,108,42,108,32,126,32,126,29,128,30,128,30,127,31,129,32,130,31,131,30,132,30,132,33,130,33,131,33,129,34,123,33,129,35,128,36,125,36",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Rankin_Inlet",
+        "country": "CA",
+        "pin": "122,38",
+        "offset": -6,
+        "points": "118,22,120,22,125,22,122,24,119,24,120,24,120,25,117,24,117,23,119,23,118,22",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Recife",
+        "country": "BR",
+        "pin": "202,136",
+        "offset": -3,
+        "points": "196,136,197,136,198,135,199,137,201,135,202,136,201,137,199,138,198,137,197,138,195,137,194,138,193,137,194,136,194,135,196,136",
+        "zoneName": "BRT"
+    }, {
+        "timezone": "America/Regina",
+        "country": "CA",
+        "pin": "105,55",
+        "offset": -6,
+        "points": "104,57,97,57,97,52,99,51,97,51,97,42,108,42,108,48,108,49,109,50,109,57,104,57",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Resolute",
+        "country": "CA",
+        "pin": "118,21",
+        "offset": -6,
+        "points": "118,20,120,20,120,21,116,21,118,20",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Rio_Branco",
+        "country": "BR",
+        "pin": "156,139",
+        "offset": -4,
+        "points": "148,135,152,136,157,139,155,140,152,140,152,138,150,139,150,138,148,138,149,137,147,135,148,135",
+        "zoneName": "ACT"
+    }, {
+        "timezone": "America/Santa_Isabel",
+        "country": "MX",
+        "pin": "90,83",
+        "offset": -8,
+        "points": "91,80,91,83,93,86,91,86,92,85,89,84,88,81,88,80,91,80",
+        "zoneName": "PST"
+    }, {
+        "timezone": "America/Santarem",
+        "country": "BR",
+        "pin": "174,128",
+        "offset": -3,
+        "points": "176,125,177,126,178,127,177,127,178,129,177,130,177,132,178,134,177,136,178,138,177,138,171,138,170,137,169,134,172,128,168,126,168,123,170,122,172,122,172,121,174,121,174,123,176,123,176,125",
+        "zoneName": "BRT"
+    }, {
+        "timezone": "America/Santiago",
+        "country": "CL",
+        "pin": "152,171",
+        "offset": -3,
+        "points": "152,199,154,198,155,198,155,201,150,201,153,201,152,200,154,201,154,201,154,201,153,200,154,199,152,199,152,199",
+        "zoneName": "CLT"
+    }, {
+        "timezone": "America/Santiago",
+        "country": "CL",
+        "pin": "152,171",
+        "offset": -3,
+        "points": "148,193,148,195,148,196,150,195,149,197,150,197,155,198,152,198,151,200,149,199,150,199,151,198,151,198,149,198,149,199,148,199,149,198,148,198,148,197,149,198,149,197,149,198,149,198,149,198,149,197,148,196,148,197,149,197,148,197,149,197,148,197,148,197,148,197,147,197,148,196,147,196,148,195,148,195,147,196,147,195,146,195,147,195,147,194,148,194,147,193,147,194,147,193,147,193,147,193,147,192,146,192,148,192,148,191,146,191,147,191,147,191,147,191,147,190,145,190,146,189,147,189,147,190,148,188,148,189,148,188,149,188,148,188,149,187,148,186,149,184,149,184,149,184,149,183,149,183,150,183,148,183,147,182,148,180,148,177,148,177,151,172,151,165,152,162,152,157,153,155,152,150,154,149,155,152,155,153,156,157,157,157,156,158,155,159,155,162,153,164,153,167,152,168,153,173,152,174,152,175,151,176,152,179,150,180,150,183,150,184,151,186,150,187,151,187,150,187,151,188,150,188,150,190,149,191,149,193,148,193",
+        "zoneName": "CLT"
+    }, {
+        "timezone": "America/Santo_Domingo",
+        "country": "DO",
+        "pin": "153,99",
+        "offset": -4,
+        "points": "151,100,150,100,150,99,150,97,153,98,154,98,153,98,155,99,155,100,151,100",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Scoresbysund",
+        "country": "GL",
+        "pin": "219,27",
+        "offset": -1,
+        "points": "216,25,219,25,218,26,220,25,219,26,220,26,220,26,219,26,220,26,219,26,220,27,217,27,216,26,216,25",
+        "zoneName": "EGT"
+    }, {
+        "timezone": "America/Sao_Paulo",
+        "country": "BR",
+        "pin": "185,158",
+        "offset": -2,
+        "points": "181,166,179,168,178,170,180,167,179,167,179,168,176,172,176,171,176,170,175,170,173,168,172,168,171,167,170,167,173,164,175,162,175,161,174,161,175,159,176,157,178,155,179,152,177,151,176,149,179,146,180,142,181,143,182,142,182,143,184,143,186,143,186,146,189,145,195,147,194,149,195,150,195,152,193,155,193,156,192,157,188,157,183,160,182,160,183,161,182,161,183,161,182,164,181,166",
+        "zoneName": "BRST"
+    }, {
+        "timezone": "America/Sitka",
+        "country": "US",
+        "pin": "62,46",
+        "offset": -9,
+        "points": "66,45,67,46,65,46,66,45,66,45",
+        "zoneName": "AKST"
+    }, {
+        "timezone": "America/St_Barthelemy",
+        "country": "BL",
+        "pin": "163,100",
+        "offset": -4,
+        "points": "163,100,163,100,163,100",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/St_Johns",
+        "country": "CA",
+        "pin": "177,59",
+        "offset": -3.5,
+        "points": "173,53,172,54,173,54,172,54,171,56,172,55,173,56,172,56,173,56,173,57,174,56,176,57,175,58,176,57,175,58,175,59,177,58,176,59,177,59,176,60,176,60,176,59,175,60,175,59,175,58,173,60,174,59,172,59,173,59,173,58,171,59,168,59,169,58,168,58,169,57,170,57,169,57,170,56,169,56,170,55,173,53",
+        "zoneName": "NST"
+    }, {
+        "timezone": "America/Thule",
+        "country": "GL",
+        "pin": "154,19",
+        "offset": -4,
+        "points": "161,19,155,19,153,19,156,18,151,18,158,17,153,17,153,17,149,16,158,15,161,19",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/St_Kitts",
+        "country": "KN",
+        "pin": "163,101",
+        "offset": -4,
+        "points": "163,101,163,101,163,101",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/St_Lucia",
+        "country": "LC",
+        "pin": "165,106",
+        "offset": -4,
+        "points": "165,105,165,106,165,105",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/St_Thomas",
+        "country": "VI",
+        "pin": "160,100",
+        "offset": -4,
+        "points": "160,99,160,99,160,99",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/St_Vincent",
+        "country": "VC",
+        "pin": "165,107",
+        "offset": -4,
+        "points": "165,106,165,107,165,106",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Swift_Current",
+        "country": "CA",
+        "pin": "100,55",
+        "offset": -6,
+        "points": "100,55,100,55,100,55",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Tegucigalpa",
+        "country": "HN",
+        "pin": "129,105",
+        "offset": -6,
+        "points": "129,106,129,107,128,106,126,105,126,104,128,103,131,103,133,103,135,104,132,104,131,106,129,106",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Thunder_Bay",
+        "country": "CA",
+        "pin": "126,58",
+        "offset": -5,
+        "points": "126,58,126,58,126,58",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Tijuana",
+        "country": "MX",
+        "pin": "87,80",
+        "offset": -8,
+        "points": "87,80,87,80,87,80",
+        "zoneName": "PST"
+    }, {
+        "timezone": "America/Toronto",
+        "country": "CA",
+        "pin": "140,64",
+        "offset": -5,
+        "points": "146,62,147,62,143,64,142,63,143,64,143,64,140,64,139,65,140,65,135,67,137,65,137,63,137,62,138,63,139,63,138,61,137,61,136,62,133,61,133,60,132,58,131,58,130,57,127,57,128,58,126,58,126,58,124,58,124,57,125,56,125,55,124,53,125,53,125,52,126,52,127,51,126,50,125,50,125,47,127,46,128,47,132,48,136,48,136,51,138,54,140,54,140,60,141,61,144,62,146,62",
+        "zoneName": "EST"
+    }, {
+        "timezone": "America/Tortola",
+        "country": "VG",
+        "pin": "160,99",
+        "offset": -4,
+        "points": "160,99,160,99,160,99",
+        "zoneName": "AST"
+    }, {
+        "timezone": "America/Vancouver",
+        "country": "CA",
+        "pin": "79,57",
+        "offset": -8,
+        "points": "72,54,76,55,79,58,76,57,77,57,76,57,75,56,74,56,75,56,72,55,73,55,72,54",
+        "zoneName": "PST"
+    }, {
+        "timezone": "America/Vancouver",
+        "country": "CA",
+        "pin": "79,57",
+        "offset": -8,
+        "points": "63,43,62,42,59,43,57,42,83,42,83,45,78,46,79,48,86,52,86,52,85,53,88,55,88,57,79,57,81,56,81,57,80,56,81,57,80,57,80,56,79,57,79,56,79,56,79,55,79,56,78,56,78,56,78,56,78,55,77,56,77,55,77,55,76,55,77,54,76,54,76,55,75,55,76,54,75,55,74,54,75,54,73,54,74,54,73,54,74,53,73,53,72,53,73,52,74,53,74,52,75,52,73,52,73,52,73,52,72,53,72,52,72,52,72,52,71,51,73,51,71,51,71,50,70,51,69,50,70,50,69,49,69,50,69,49,70,48,69,49,70,48,70,48,69,49,69,47,67,46,65,44,63,43",
+        "zoneName": "PST"
+    }, {
+        "timezone": "America/Whitehorse",
+        "country": "CA",
+        "pin": "62,41",
+        "offset": -8,
+        "points": "57,29,60,29,61,32,64,32,64,33,66,33,66,35,69,36,70,37,69,37,70,37,70,39,73,40,74,41,77,40,78,42,54,41,54,28,57,29",
+        "zoneName": "PST"
+    }, {
+        "timezone": "America/Winnipeg",
+        "country": "CA",
+        "pin": "115,56",
+        "offset": -6,
+        "points": "122,58,119,57,118,56,118,57,109,57,109,50,108,49,108,48,108,42,118,42,118,43,121,43,122,45,121,46,124,45,126,46,125,47,125,50,126,50,127,51,126,52,125,52,125,53,124,53,125,55,125,56,123,57,122,58",
+        "zoneName": "CST"
+    }, {
+        "timezone": "America/Yakutat",
+        "country": "US",
+        "pin": "56,42",
+        "offset": -9,
+        "points": "56,42,56,42,56,42",
+        "zoneName": "AKST"
+    }, {
+        "timezone": "America/Yellowknife",
+        "country": "CA",
+        "pin": "91,38",
+        "offset": -7,
+        "points": "83,31,92,34,95,34,97,35,108,36,108,42,78,42,77,40,74,41,73,40,70,39,70,37,69,37,70,37,69,36,66,35,66,33,64,33,64,32,61,32,60,29,62,30,61,29,63,28,64,28,64,29,70,28,67,28,67,29,68,28,68,29,69,28,73,27,72,27,76,29,77,28,78,28,77,29,79,28,82,28,81,28,81,30,83,31",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Yellowknife",
+        "country": "CA",
+        "pin": "91,38",
+        "offset": -7,
+        "points": "88,17,90,18,88,18,89,18,87,19,86,19,86,18,83,20,79,19,84,18,88,17",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Yellowknife",
+        "country": "CA",
+        "pin": "91,38",
+        "offset": -7,
+        "points": "84,22,87,22,90,23,85,24,83,25,83,26,79,26,75,25,78,23,77,22,81,21,84,22",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Yellowknife",
+        "country": "CA",
+        "pin": "91,38",
+        "offset": -7,
+        "points": "91,19,97,20,97,21,93,22,91,21,96,20,87,20,90,20,87,20,91,20,88,20,91,19",
+        "zoneName": "MST"
+    }, {
+        "timezone": "America/Yellowknife",
+        "country": "CA",
+        "pin": "91,38",
+        "offset": -7,
+        "points": "90,23,92,23,91,24,93,24,96,24,95,25,97,24,97,28,87,28,87,28,87,28,95,27,87,27,86,26,90,26,86,26,87,25,85,25,86,25,86,24,90,23",
+        "zoneName": "MST"
+    }, {
+        "timezone": "Antarctica/Macquarie",
+        "country": "AU",
+        "pin": "471,201",
+        "offset": 11,
+        "points": "471,201,471,201,471,201",
+        "zoneName": "MIST"
+    }, {
+        "timezone": "Arctic/Longyearbyen",
+        "country": "SJ",
+        "pin": "272,17",
+        "offset": 1,
+        "points": "275,14,275,14,275,15,275,14,280,16,276,16,276,17,274,18,274,19,273,19,272,18,273,18,269,17,273,17,270,17,274,17,269,17,269,17,274,16,273,16,273,16,271,16,271,15,270,16,271,16,268,16,267,16,268,16,266,15,267,15,266,15,267,15,266,15,265,15,269,14,267,14,269,15,269,15,270,14,273,15,272,14,275,14",
+        "zoneName": "CET"
+    }, {
+        "timezone": "Arctic/Longyearbyen",
+        "country": "SJ",
+        "pin": "272,17",
+        "offset": 1,
+        "points": "285,14,288,14,283,15,275,14,277,14,276,13,278,14,277,13,281,14,282,13,282,13,282,14,285,14",
+        "zoneName": "CET"
+    }, {
+        "timezone": "Asia/Aden",
+        "country": "YE",
+        "pin": "313,107",
+        "offset": 3,
+        "points": "313,107,310,107,309,104,310,101,314,102,314,103,318,100,322,99,324,102,323,102,322,103,313,107",
+        "zoneName": "AST"
+    }, {
+        "timezone": "Asia/Almaty",
+        "country": "KZ",
+        "pin": "357,65",
+        "offset": 6,
+        "points": "348,66,345,68,343,68,342,66,344,65,345,64,344,63,343,61,337,60,339,58,339,58,340,57,342,57,345,55,344,54,344,52,342,52,342,51,342,51,342,51,342,49,346,48,348,48,349,50,352,50,352,51,357,49,356,50,358,51,361,55,362,54,363,55,366,54,368,56,371,56,371,57,369,58,369,60,365,59,364,62,365,62,363,62,361,63,362,63,362,65,361,66,359,65,355,66,353,65,352,65,352,66,350,66,348,66",
+        "zoneName": "ALMT"
+    }, {
+        "timezone": "Asia/Amman",
+        "country": "JO",
+        "pin": "300,81",
+        "offset": 2,
+        "points": "302,82,303,83,302,83,300,84,299,84,299,80,301,80,304,79,305,80,301,81,302,82",
+        "zoneName": "EET"
+    }, {
+        "timezone": "Asia/Anadyr",
+        "country": "RU",
+        "pin": "497,35",
+        "offset": 12,
+        "points": "10,32,14,33,13,34,12,34,12,34,10,34,11,34,11,35,9,35,11,36,10,36,6,35,6,34,2,34,2,33,2,33,0,33,1,34,0,35,0,29,7,31,8,33,9,33,7,32,10,32",
+        "zoneName": "ANAT"
+    }, {
+        "timezone": "Asia/Anadyr",
+        "country": "RU",
+        "pin": "497,35",
+        "offset": 12,
+        "points": "497,35,493,35,498,36,499,38,499,39,496,38,492,39,491,38,487,39,484,37,486,37,484,36,473,35,471,34,471,33,470,33,471,32,469,31,470,30,476,30,476,29,475,28,476,28,483,28,486,30,488,29,486,28,487,28,495,28,500,29,500,35,498,35,497,35",
+        "zoneName": "ANAT"
+    }, {
+        "timezone": "Asia/Aqtau",
+        "country": "KZ",
+        "pin": "320,63",
+        "offset": 5,
+        "points": "328,63,328,68,325,66,323,67,323,66,321,65,320,63,322,63,321,63,321,62,324,62,323,60,321,60,319,61,317,60,318,60,318,59,315,58,319,58,325,57,325,57,326,57,327,60,329,61,329,62,328,63",
+        "zoneName": "AQTT"
+    }, {
+        "timezone": "Asia/Aqtobe",
+        "country": "KZ",
+        "pin": "329,55",
+        "offset": 5,
+        "points": "326,55,326,54,327,55,328,54,331,54,333,55,335,54,336,54,337,56,337,57,339,58,337,60,335,59,331,62,329,62,328,60,326,59,326,57,324,57,326,56,326,55",
+        "zoneName": "AQTT"
+    }, {
+        "timezone": "Asia/Ashgabat",
+        "country": "TM",
+        "pin": "331,72",
+        "offset": 5,
+        "points": "340,74,340,75,337,76,335,75,335,74,334,74,332,73,329,72,325,73,325,71,324,71,324,70,325,70,323,69,324,68,323,67,325,66,327,68,329,68,329,67,331,66,331,66,331,66,331,66,333,66,334,68,336,68,337,70,343,72,342,73,341,73,340,74",
+  

<TRUNCATED>

[25/51] [abbrv] ambari git commit: AMBARI-19872 : HiveView2.0 : added Upload CSV, JSON, XML to create table feature in the new view (nitirajrathore)

Posted by rz...@apache.org.
AMBARI-19872 : HiveView2.0 : added Upload CSV,JSON, XML to create table feature in the new view (nitirajrathore)

(cherry picked from commit d3451fb347bf96fceefc6190904f59682a9eb390)

Change-Id: Icc5adb2e4903553891215eb83e0feb01827c9690


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 53e6c8d47f998f81780fe6b7add936051f31273a
Parents: fb265e1
Author: Nitiraj Singh Rathore <ni...@gmail.com>
Authored: Tue Feb 7 13:02:34 2017 +0530
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 03:28:56 2017 -0800

----------------------------------------------------------------------
 .../view/hive20/internal/dto/ColumnInfo.java    |   4 +
 .../generators/InsertFromQueryGenerator.java    |  77 ++
 .../view/hive20/resources/jobs/JobService.java  |   1 +
 .../hive20/resources/uploads/CSVParams.java     |   2 +-
 .../resources/uploads/TableDataReader.java      |   5 +-
 .../hive20/resources/uploads/TableInput.java    |  51 -
 .../resources/uploads/UploadFromHdfsInput.java  |   8 +-
 .../hive20/resources/uploads/UploadService.java | 107 +--
 .../resources/uploads/parsers/Parser.java       |  11 +-
 .../resources/uploads/parsers/PreviewData.java  |   9 +-
 .../uploads/query/InsertFromQueryInput.java     |  10 +-
 .../resources/uploads/query/QueryGenerator.java | 143 ---
 .../resources/uploads/query/RowFormat.java      |  57 --
 .../resources/uploads/query/TableInfo.java      |  97 --
 .../resources/ui/app/adapters/file-uploader.js  |  28 +
 .../resources/ui/app/adapters/upload-table.js   |  93 ++
 .../ui/app/components/csv-format-params.js      |  77 ++
 .../resources/ui/app/components/radio-button.js |  40 +
 .../resources/ui/app/components/simple-table.js |  22 +
 .../ui/app/components/upload-table-source.js    |  48 +
 .../resources/ui/app/components/upload-table.js |  60 ++
 .../ui/app/components/validated-text-field.js   |  62 ++
 .../main/resources/ui/app/configs/helpers.js    |  14 +-
 .../resources/ui/app/locales/en/translations.js | 111 +++
 .../src/main/resources/ui/app/models/column.js  |  23 +-
 .../hive20/src/main/resources/ui/app/router.js  |   2 +-
 .../app/routes/databases/database/tables/new.js |  80 +-
 .../databases/database/tables/upload-table.js   | 925 +++++++++++++++++++
 .../src/main/resources/ui/app/services/jobs.js  |   3 +
 .../ui/app/services/table-operations.js         |   4 +-
 .../templates/components/csv-format-params.hbs  | 118 +++
 .../app/templates/components/radio-button.hbs   |  19 +
 .../app/templates/components/simple-table.hbs   |  42 +
 .../components/upload-table-source.hbs          | 112 +++
 .../app/templates/components/upload-table.hbs   |  59 ++
 .../components/validated-text-field.hbs         |  23 +
 .../templates/databases/database/tables/new.hbs |   6 +-
 .../databases/database/tables/upload-table.hbs  |  45 +
 .../main/resources/ui/app/utils/constants.js    |  64 ++
 .../hive20/src/main/resources/ui/bower.json     |   3 +-
 .../src/main/resources/ui/config/environment.js |   4 +
 .../hive20/src/main/resources/ui/package.json   |   3 +
 .../resources/upload/DataParserCSVTest.java     |  29 +-
 .../resources/upload/DataParserJSONTest.java    |  37 +-
 .../resources/upload/DataParserXMLTest.java     |  20 +-
 .../resources/upload/QueryGeneratorTest.java    | 108 ---
 .../resources/upload/TableDataReaderTest.java   |   5 +-
 47 files changed, 2249 insertions(+), 622 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/ColumnInfo.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/ColumnInfo.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/ColumnInfo.java
index 44c82a0..5daab91 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/ColumnInfo.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/dto/ColumnInfo.java
@@ -30,6 +30,10 @@ public class ColumnInfo {
   private Integer scale;
   private String comment;
 
+  private ColumnInfo(){
+    // for json de-serialization
+  }
+
   public ColumnInfo(String name, String type, Integer precision, Integer scale, String comment) {
     this.name = name;
     this.type = type;

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/InsertFromQueryGenerator.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/InsertFromQueryGenerator.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/InsertFromQueryGenerator.java
new file mode 100644
index 0000000..42cec0a
--- /dev/null
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/internal/query/generators/InsertFromQueryGenerator.java
@@ -0,0 +1,77 @@
+/*
+* 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.view.hive20.internal.query.generators;
+
+import com.google.common.base.Optional;
+import org.apache.ambari.view.hive20.client.ColumnDescription;
+import org.apache.ambari.view.hive20.exceptions.ServiceException;
+import org.apache.ambari.view.hive20.internal.dto.ColumnInfo;
+import org.apache.ambari.view.hive20.resources.uploads.query.InsertFromQueryInput;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class InsertFromQueryGenerator implements QueryGenerator{
+  protected final static Logger LOG =
+      LoggerFactory.getLogger(InsertFromQueryGenerator.class);
+
+  private InsertFromQueryInput insertFromQueryInput;
+
+  public InsertFromQueryGenerator(InsertFromQueryInput insertFromQueryInput) {
+    this.insertFromQueryInput = insertFromQueryInput;
+  }
+
+  @Override
+  public Optional<String> getQuery() throws ServiceException {
+    StringBuilder insertQuery = new StringBuilder("INSERT INTO TABLE `").append(insertFromQueryInput.getToDatabase()).append(".")
+        .append(insertFromQueryInput.getToTable()).append("`")
+        .append(" SELECT ");
+
+    boolean first = true;
+    for(ColumnInfo column : insertFromQueryInput.getHeader()){
+      String type = column.getType();
+      boolean unhex = insertFromQueryInput.getUnhexInsert() && (
+          ColumnDescription.DataTypes.STRING.toString().equals(type)
+              || ColumnDescription.DataTypes.VARCHAR.toString().equals(type)
+              || ColumnDescription.DataTypes.CHAR.toString().equals(type)
+      );
+
+      if(!first){
+        insertQuery.append(", ");
+      }
+
+      if(unhex) {
+        insertQuery.append("UNHEX(");
+      }
+
+      insertQuery.append(column.getName());
+
+      if(unhex) {
+        insertQuery.append(")");
+      }
+
+      first = false;
+    }
+
+    insertQuery.append(" FROM ").append("`").append(insertFromQueryInput.getFromDatabase()).append(".")
+        .append(insertFromQueryInput.getFromTable()).append("` ").append(";");
+    String query = insertQuery.toString();
+    LOG.info("Insert From Query : {}", query);
+    return Optional.of(query);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/JobService.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/JobService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/JobService.java
index 71cedd1..c5479e7 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/JobService.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/jobs/JobService.java
@@ -154,6 +154,7 @@ public class JobService extends BaseService {
     } catch (ItemNotFound itemNotFound) {
       throw new NotFoundFormattedException(itemNotFound.getMessage(), itemNotFound);
     } catch (Exception ex) {
+      LOG.error("exception while fetching status of job with id : {}", jobId, ex);
       throw new ServiceFormattedException(ex.getMessage(), ex);
     }
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/CSVParams.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/CSVParams.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/CSVParams.java
index 355ed6a..03ed895 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/CSVParams.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/CSVParams.java
@@ -16,7 +16,7 @@
  * limitations under the License.
  */
 
-package org.apache.ambari.view.hive.resources.uploads;
+package org.apache.ambari.view.hive20.resources.uploads;
 
 import java.io.Serializable;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/TableDataReader.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/TableDataReader.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/TableDataReader.java
index ee148b8..2855760 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/TableDataReader.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/TableDataReader.java
@@ -21,6 +21,7 @@ package org.apache.ambari.view.hive20.resources.uploads;
 import com.opencsv.CSVWriter;
 import org.apache.ambari.view.hive20.client.ColumnDescription;
 import org.apache.ambari.view.hive20.client.Row;
+import org.apache.ambari.view.hive20.internal.dto.ColumnInfo;
 import org.apache.commons.codec.binary.Hex;
 
 import java.io.IOException;
@@ -38,14 +39,14 @@ import java.util.List;
 public class TableDataReader extends Reader {
 
   private static final int CAPACITY = 1024;
-  private final List<ColumnDescriptionImpl> header;
+  private final List<ColumnInfo> header;
   private StringReader stringReader = new StringReader("");
 
   private Iterator<Row> iterator;
   private boolean encode = false;
   public static final char CSV_DELIMITER = '\001';
 
-  public TableDataReader(Iterator<Row> rowIterator, List<ColumnDescriptionImpl> header, boolean encode) {
+  public TableDataReader(Iterator<Row> rowIterator, List<ColumnInfo> header, boolean encode) {
     this.iterator = rowIterator;
     this.encode = encode;
     this.header = header;

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/TableInput.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/TableInput.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/TableInput.java
deleted file mode 100644
index 4f15c57..0000000
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/TableInput.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * 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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * 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.view.hive20.resources.uploads;
-
-import org.apache.ambari.view.hive20.resources.uploads.query.TableInfo;
-
-/**
- * used as input in REST call
- */
-class TableInput extends TableInfo {
-  public Boolean isFirstRowHeader = Boolean.FALSE;
-
-  public TableInput() {
-  }
-
-  public Boolean getIsFirstRowHeader() {
-    return isFirstRowHeader;
-  }
-
-  public void setIsFirstRowHeader(Boolean isFirstRowHeader) {
-    this.isFirstRowHeader = isFirstRowHeader;
-  }
-
-  public void validate(){
-    if( null == this.getHiveFileType()){
-      throw new IllegalArgumentException("fileType parameter cannot be null.");
-    }
-    if( null == this.getTableName()){
-      throw new IllegalArgumentException("tableName parameter cannot be null.");
-    }
-    if( null == this.getDatabaseName()){
-      throw new IllegalArgumentException("databaseName parameter cannot be null.");
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/UploadFromHdfsInput.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/UploadFromHdfsInput.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/UploadFromHdfsInput.java
index c755c02..60955a6 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/UploadFromHdfsInput.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/UploadFromHdfsInput.java
@@ -18,6 +18,8 @@
 
 package org.apache.ambari.view.hive20.resources.uploads;
 
+import org.apache.ambari.view.hive20.internal.dto.ColumnInfo;
+
 import java.io.Serializable;
 import java.util.List;
 
@@ -27,7 +29,7 @@ public class UploadFromHdfsInput implements Serializable{
   private String hdfsPath;
   private String tableName;
   private String databaseName;
-  private List<ColumnDescriptionImpl> header;
+  private List<ColumnInfo> header;
   private boolean containsEndlines;
 
   private String csvDelimiter;
@@ -41,11 +43,11 @@ public class UploadFromHdfsInput implements Serializable{
     return csvDelimiter;
   }
 
-  public List<ColumnDescriptionImpl> getHeader() {
+  public List<ColumnInfo> getHeader() {
     return header;
   }
 
-  public void setHeader(List<ColumnDescriptionImpl> header) {
+  public void setHeader(List<ColumnInfo> header) {
     this.header = header;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/UploadService.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/UploadService.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/UploadService.java
index 835626d..3164da0 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/UploadService.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/UploadService.java
@@ -18,16 +18,22 @@
 
 package org.apache.ambari.view.hive20.resources.uploads;
 
+import com.google.common.base.Optional;
 import com.sun.jersey.core.header.FormDataContentDisposition;
 import com.sun.jersey.multipart.FormDataParam;
 import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.hive.resources.uploads.CSVParams;
 import org.apache.ambari.view.hive20.BaseService;
 import org.apache.ambari.view.hive20.ConnectionFactory;
 import org.apache.ambari.view.hive20.ConnectionSystem;
 import org.apache.ambari.view.hive20.client.DDLDelegator;
 import org.apache.ambari.view.hive20.client.DDLDelegatorImpl;
 import org.apache.ambari.view.hive20.client.Row;
+import org.apache.ambari.view.hive20.exceptions.ServiceException;
+import org.apache.ambari.view.hive20.internal.dto.ColumnInfo;
+import org.apache.ambari.view.hive20.internal.dto.TableMeta;
+import org.apache.ambari.view.hive20.internal.query.generators.CreateTableQueryGenerator;
+import org.apache.ambari.view.hive20.internal.query.generators.DeleteTableQueryGenerator;
+import org.apache.ambari.view.hive20.internal.query.generators.InsertFromQueryGenerator;
 import org.apache.ambari.view.hive20.resources.jobs.viewJobs.Job;
 import org.apache.ambari.view.hive20.resources.jobs.viewJobs.JobController;
 import org.apache.ambari.view.hive20.resources.jobs.viewJobs.JobImpl;
@@ -37,8 +43,6 @@ import org.apache.ambari.view.hive20.resources.uploads.parsers.ParseOptions;
 import org.apache.ambari.view.hive20.resources.uploads.parsers.PreviewData;
 import org.apache.ambari.view.hive20.resources.uploads.query.DeleteQueryInput;
 import org.apache.ambari.view.hive20.resources.uploads.query.InsertFromQueryInput;
-import org.apache.ambari.view.hive20.resources.uploads.query.QueryGenerator;
-import org.apache.ambari.view.hive20.resources.uploads.query.TableInfo;
 import org.apache.ambari.view.hive20.utils.ServiceFormattedException;
 import org.apache.ambari.view.hive20.utils.SharedObjectsFactory;
 import org.apache.ambari.view.utils.ambari.AmbariApi;
@@ -52,11 +56,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import javax.inject.Inject;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import java.io.File;
@@ -163,7 +163,7 @@ public class UploadService extends BaseService {
     }
   }
 
-  @POST
+  @PUT
   @Path("/preview")
   @Consumes(MediaType.MULTIPART_FORM_DATA)
   public Response uploadForPreview(
@@ -225,29 +225,6 @@ public class UploadService extends BaseService {
   }
 
 
-  @Path("/createTable")
-  @POST
-  @Consumes(MediaType.APPLICATION_JSON)
-  @Produces(MediaType.APPLICATION_JSON)
-  public Response createTable(TableInput tableInput) {
-    try {
-      tableInput.validate();
-      String databaseName = tableInput.getDatabaseName();
-      String tableCreationQuery = generateCreateQuery(tableInput);
-      LOG.info("tableCreationQuery : {}", tableCreationQuery);
-
-      Job job = createJob(tableCreationQuery, databaseName);
-      LOG.info("job created for table creation {}", job);
-      return Response.ok(job).build();
-    } catch (WebApplicationException e) {
-      LOG.error(getErrorMessage(e), e);
-      throw e;
-    } catch (Throwable e) {
-      LOG.error(e.getMessage(), e);
-      throw new ServiceFormattedException(e);
-    }
-  }
-
   @Path("/uploadFromHDFS")
   @POST
   @Consumes(MediaType.APPLICATION_JSON)
@@ -281,7 +258,7 @@ public class UploadService extends BaseService {
   }
 
   @Path("/upload")
-  @POST
+  @PUT
   @Consumes(MediaType.MULTIPART_FORM_DATA)
   @Produces(MediaType.APPLICATION_JSON)
   public Response uploadFile(
@@ -301,7 +278,7 @@ public class UploadService extends BaseService {
     try {
       CSVParams csvParams = getCsvParams(csvDelimiter, csvQuote, csvEscape);
       ObjectMapper mapper = new ObjectMapper();
-      List<ColumnDescriptionImpl> columnList = mapper.readValue(header, new TypeReference<List<ColumnDescriptionImpl>>(){});
+      List<ColumnInfo> columnList = mapper.readValue(header, new TypeReference<List<ColumnInfo>>(){});
       String path = uploadFileFromStream(uploadedInputStream, isFirstRowHeader, inputFileType, tableName, databaseName, columnList, containsEndlines, csvParams);
 
       JSONObject jo = new JSONObject();
@@ -325,7 +302,9 @@ public class UploadService extends BaseService {
       String insertQuery = generateInsertFromQuery(input);
       LOG.info("insertQuery : {}", insertQuery);
 
-      Job job = createJob(insertQuery, "default");
+      Job job = createJob(insertQuery, input.getFromDatabase(), "Insert from " +
+              input.getFromDatabase() + "." + input.getFromTable() + " to " +
+              input.getToDatabase() + "." + input.getToTable());
       LOG.info("Job created for insert from temp table : {}", job);
       return Response.ok(job).build();
     } catch (WebApplicationException e) {
@@ -337,27 +316,6 @@ public class UploadService extends BaseService {
     }
   }
 
-  @Path("/deleteTable")
-  @POST
-  @Consumes(MediaType.APPLICATION_JSON)
-  @Produces(MediaType.APPLICATION_JSON)
-  public Response deleteTable(DeleteQueryInput input) {
-    try {
-      String deleteQuery = generateDeleteQuery(input);
-      LOG.info("deleteQuery : {}", deleteQuery);
-
-      Job job = createJob(deleteQuery, "default");
-      LOG.info("Job created for delete temp table : {} ", job);
-      return Response.ok(job).build();
-    } catch (WebApplicationException e) {
-      LOG.error(getErrorMessage(e), e);
-      throw e;
-    } catch (Throwable e) {
-      LOG.error(e.getMessage(), e);
-      throw new ServiceFormattedException(e);
-    }
-  }
-
   private String uploadIntoTable(Reader reader, String databaseName, String tempTableName) {
     try {
       String fullPath = getHiveMetaStoreLocation(databaseName, tempTableName);
@@ -388,23 +346,42 @@ public class UploadService extends BaseService {
     return ambariApi;
   }
 
-  private String generateCreateQuery(TableInfo ti) {
-    return new QueryGenerator().generateCreateQuery(ti);
+  private String generateCreateQuery(TableMeta ti) throws ServiceException {
+    CreateTableQueryGenerator createTableQueryGenerator = new CreateTableQueryGenerator(ti);
+    Optional<String> query = createTableQueryGenerator.getQuery();
+    if(query.isPresent()){
+      return query.get();
+    }else{
+      throw new ServiceException("Failed to generate create table query.");
+    }
   }
 
-  private String generateInsertFromQuery(InsertFromQueryInput input) {
-    return new QueryGenerator().generateInsertFromQuery(input);
+  private String generateInsertFromQuery(InsertFromQueryInput input) throws ServiceException {
+    InsertFromQueryGenerator queryGenerator = new InsertFromQueryGenerator(input);
+    Optional<String> query = queryGenerator.getQuery();
+    if(query.isPresent()){
+      return query.get();
+    }else{
+      throw new ServiceException("Failed to generate Insert From Query.");
+    }
   }
 
-  private String generateDeleteQuery(DeleteQueryInput deleteQueryInput) {
-    return new QueryGenerator().generateDropTableQuery(deleteQueryInput);
+  private String generateDeleteQuery(DeleteQueryInput deleteQueryInput) throws ServiceException {
+    DeleteTableQueryGenerator deleteQuery = new DeleteTableQueryGenerator(deleteQueryInput.getDatabase(), deleteQueryInput.getTable());
+    Optional<String> query = deleteQuery.getQuery();
+    if(query.isPresent()){
+      return query.get();
+    }else{
+      throw new ServiceException("Failed to generate delete table query.");
+    }
   }
 
-  private Job createJob(String query, String databaseName) throws Throwable{
+  private Job createJob(String query, String databaseName, String jobTitle) throws Throwable{
     Map jobInfo = new HashMap<>();
-    jobInfo.put("title", "Internal Job");
+    jobInfo.put("title", jobTitle);
     jobInfo.put("forcedContent", query);
     jobInfo.put("dataBase", databaseName);
+    jobInfo.put("referrer", JobImpl.REFERRER.INTERNAL.name());
 
     Job job = new JobImpl(jobInfo);
     LOG.info("creating job : {}", job);
@@ -523,7 +500,7 @@ public class UploadService extends BaseService {
     String inputFileType,   // the format of the file uploaded. CSV/JSON etc.
     String tableName,
     String databaseName,
-    List<ColumnDescriptionImpl> header,
+    List<ColumnInfo> header,
     boolean containsEndlines,
     CSVParams csvParams
   ) throws Exception {

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/Parser.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/Parser.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/Parser.java
index a012463..5586f8c 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/Parser.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/Parser.java
@@ -20,6 +20,7 @@ package org.apache.ambari.view.hive20.resources.uploads.parsers;
 
 import org.apache.ambari.view.hive20.client.ColumnDescription;
 import org.apache.ambari.view.hive20.client.Row;
+import org.apache.ambari.view.hive20.internal.dto.ColumnInfo;
 import org.apache.ambari.view.hive20.resources.uploads.ColumnDescriptionImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -74,7 +75,7 @@ public abstract class Parser implements IParser {
     LOG.info("generating preview for : {}", this.parseOptions );
 
     ArrayList<Row> previewRows;
-    List<ColumnDescription> header;
+    List<ColumnInfo> header;
 
     try {
       numberOfPreviewRows = (Integer) parseOptions.getOption(ParseOptions.OPTIONS_NUMBER_OF_PREVIEW_ROWS);
@@ -137,11 +138,11 @@ public abstract class Parser implements IParser {
     // find data types.
     header = generateHeader(headerRow,previewRows,numOfCols);
 
-    return new PreviewData(header,previewRows);
+    return new PreviewData(header, previewRows);
   }
 
-  private List<ColumnDescription> generateHeader(Row headerRow,List<Row> previewRows, int numOfCols) {
-    List<ColumnDescription> header = new ArrayList<>();
+  private List<ColumnInfo> generateHeader(Row headerRow, List<Row> previewRows, int numOfCols) {
+    List<ColumnInfo> header = new ArrayList<>();
 
     for (int colNum = 0; colNum < numOfCols; colNum++) {
       ColumnDescription.DataTypes type = getLikelyDataType(previewRows,colNum);
@@ -151,7 +152,7 @@ public abstract class Parser implements IParser {
       if (null != headerRow)
         colName = (String) headerRow.getRow()[colNum];
 
-      ColumnDescription cd = new ColumnDescriptionImpl(colName, type.toString(), colNum);
+      ColumnInfo cd = new ColumnInfo(colName, type.toString());
       header.add(cd);
     }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/PreviewData.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/PreviewData.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/PreviewData.java
index 50af529..dd31457 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/PreviewData.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/parsers/PreviewData.java
@@ -20,6 +20,7 @@ package org.apache.ambari.view.hive20.resources.uploads.parsers;
 
 import org.apache.ambari.view.hive20.client.ColumnDescription;
 import org.apache.ambari.view.hive20.client.Row;
+import org.apache.ambari.view.hive20.internal.dto.ColumnInfo;
 
 import java.util.List;
 
@@ -27,22 +28,22 @@ import java.util.List;
  * Encapsulating preview data from parser.
  */
 public class PreviewData {
-  private List<ColumnDescription> header;
+  private List<ColumnInfo> header;
   private List<Row> previewRows;
 
   public PreviewData() {
   }
 
-  public PreviewData(List<ColumnDescription> header, List<Row> previewRows) {
+  public PreviewData(List<ColumnInfo> header, List<Row> previewRows) {
     this.header = header;
     this.previewRows = previewRows;
   }
 
-  public List<ColumnDescription> getHeader() {
+  public List<ColumnInfo> getHeader() {
     return header;
   }
 
-  public void setHeader(List<ColumnDescription> header) {
+  public void setHeader(List<ColumnInfo> header) {
     this.header = header;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/InsertFromQueryInput.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/InsertFromQueryInput.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/InsertFromQueryInput.java
index 027baff..4ff61b4 100644
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/InsertFromQueryInput.java
+++ b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/InsertFromQueryInput.java
@@ -18,6 +18,7 @@
 
 package org.apache.ambari.view.hive20.resources.uploads.query;
 
+import org.apache.ambari.view.hive20.internal.dto.ColumnInfo;
 import org.apache.ambari.view.hive20.resources.uploads.ColumnDescriptionImpl;
 
 import java.util.List;
@@ -27,13 +28,14 @@ public class InsertFromQueryInput {
   private String fromTable;
   private String toDatabase;
   private String toTable;
-  private List<ColumnDescriptionImpl> header;
+  private List<ColumnInfo> header;
   private Boolean unhexInsert = Boolean.FALSE;
 
   public InsertFromQueryInput() {
   }
 
-  public InsertFromQueryInput(String fromDatabase, String fromTable, String toDatabase, String toTable, List<ColumnDescriptionImpl> header, Boolean unhexInsert) {
+  public InsertFromQueryInput(String fromDatabase, String fromTable, String toDatabase, String toTable,
+                              List<ColumnInfo> header, Boolean unhexInsert) {
     this.fromDatabase = fromDatabase;
     this.fromTable = fromTable;
     this.toDatabase = toDatabase;
@@ -42,11 +44,11 @@ public class InsertFromQueryInput {
     this.unhexInsert = unhexInsert;
   }
 
-  public List<ColumnDescriptionImpl> getHeader() {
+  public List<ColumnInfo> getHeader() {
     return header;
   }
 
-  public void setHeader(List<ColumnDescriptionImpl> header) {
+  public void setHeader(List<ColumnInfo> header) {
     this.header = header;
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/QueryGenerator.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/QueryGenerator.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/QueryGenerator.java
deleted file mode 100644
index dda178d..0000000
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/QueryGenerator.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/**
- * 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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * 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.view.hive20.resources.uploads.query;
-
-import org.apache.ambari.view.hive.resources.uploads.query.RowFormat;
-import org.apache.ambari.view.hive20.client.ColumnDescription;
-import org.apache.ambari.view.hive20.resources.uploads.ColumnDescriptionImpl;
-import org.apache.ambari.view.hive20.resources.uploads.HiveFileType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-/**
- * generates the sql query from given data
- */
-public class QueryGenerator {
-  protected final static Logger LOG =
-          LoggerFactory.getLogger(QueryGenerator.class);
-
-  public String generateCreateQuery(TableInfo tableInfo) {
-    String tableName = tableInfo.getTableName();
-    List<ColumnDescriptionImpl> cdList = tableInfo.getHeader();
-
-    StringBuilder query = new StringBuilder();
-    query.append("CREATE TABLE ").append(tableName).append(" (");
-    Collections.sort(cdList, new Comparator<ColumnDescription>() {
-      @Override
-      public int compare(ColumnDescription o1, ColumnDescription o2) {
-        return o1.getPosition() - o2.getPosition();
-      }
-    });
-
-    boolean first = true;
-    for (ColumnDescriptionImpl cd : cdList) {
-      if (first) {
-        first = false;
-      } else {
-        query.append(", ");
-      }
-
-      query.append(cd.getName()).append(" ").append(cd.getType());
-      if (cd.getPrecision() != null) {
-        query.append("(").append(cd.getPrecision());
-        if (cd.getScale() != null) {
-          query.append(",").append(cd.getScale());
-        }
-        query.append(")");
-      }
-
-    }
-
-    query.append(")");
-
-    if(tableInfo.getHiveFileType().equals(HiveFileType.TEXTFILE)) {
-      query.append(getRowFormatQuery(tableInfo.getRowFormat()));
-    }
-    query.append(" STORED AS ").append(tableInfo.getHiveFileType().toString());
-    String queryString = query.append(";").toString();
-    LOG.info("Query : {}", queryString);
-    return queryString;
-  }
-
-  private String getRowFormatQuery(RowFormat rowFormat) {
-    StringBuilder sb = new StringBuilder();
-    if(rowFormat != null) {
-      sb.append(" ROW FORMAT DELIMITED");
-      if(rowFormat.getFieldsTerminatedBy() != null ){
-        sb.append(" FIELDS TERMINATED BY '").append(rowFormat.getFieldsTerminatedBy()).append('\'');
-      }
-      if(rowFormat.getEscapedBy() != null){
-        String escape = String.valueOf(rowFormat.getEscapedBy());
-        if(rowFormat.getEscapedBy() == '\\'){
-          escape = escape + '\\'; // special handling of slash as its escape char for strings in hive as well.
-        }
-        sb.append(" ESCAPED BY '").append(escape).append('\'');
-      }
-    }
-
-    return sb.toString();
-  }
-
-  public String generateInsertFromQuery(InsertFromQueryInput ifqi) {
-    StringBuilder insertQuery = new StringBuilder("INSERT INTO TABLE ").append(ifqi.getToDatabase()).append(".")
-                                .append(ifqi.getToTable()).append(" SELECT ");
-
-    boolean first = true;
-    for(ColumnDescriptionImpl column : ifqi.getHeader()){
-      String type = column.getType();
-      boolean unhex = ifqi.getUnhexInsert() && (
-        ColumnDescription.DataTypes.STRING.toString().equals(type)
-          || ColumnDescription.DataTypes.VARCHAR.toString().equals(type)
-          || ColumnDescription.DataTypes.CHAR.toString().equals(type)
-      );
-
-      if(!first){
-        insertQuery.append(", ");
-      }
-
-      if(unhex) {
-        insertQuery.append("UNHEX(");
-      }
-
-      insertQuery.append(column.getName());
-
-      if(unhex) {
-        insertQuery.append(")");
-      }
-
-      first = false;
-    }
-
-    insertQuery.append(" FROM ").append(ifqi.getFromDatabase()).append(".").append(ifqi.getFromTable()).append(";");
-    String query = insertQuery.toString();
-    LOG.info("Insert Query : {}", query);
-    return query;
-  }
-
-  public String generateDropTableQuery(DeleteQueryInput deleteQueryInput) {
-    String dropQuery = new StringBuilder("DROP TABLE ").append(deleteQueryInput.getDatabase())
-                      .append(".").append(deleteQueryInput.getTable()).append(";").toString();
-    LOG.info("Drop Query : {}", dropQuery);
-    return dropQuery;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/RowFormat.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/RowFormat.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/RowFormat.java
deleted file mode 100644
index 4c1cb2b..0000000
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/RowFormat.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * 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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * 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.view.hive.resources.uploads.query;
-
-public class RowFormat {
-  private Character fieldsTerminatedBy;
-  private Character escapedBy;
-
-  private RowFormat() {
-  }
-
-  public RowFormat(Character fieldsTerminatedBy, Character escapedBy) {
-    this.fieldsTerminatedBy = fieldsTerminatedBy;
-    this.escapedBy = escapedBy;
-  }
-
-  public Character getFieldsTerminatedBy() {
-    return fieldsTerminatedBy;
-  }
-
-  public void setFieldsTerminatedBy(Character fieldsTerminatedBy) {
-    this.fieldsTerminatedBy = fieldsTerminatedBy;
-  }
-
-  public Character getEscapedBy() {
-    return escapedBy;
-  }
-
-  public void setEscapedBy(Character escapedBy) {
-    this.escapedBy = escapedBy;
-  }
-
-  @Override
-  public String toString() {
-    StringBuilder sb = new StringBuilder("RowFormat{ fieldsTerminatedBy='");
-    sb.append(fieldsTerminatedBy).append( '\'').append(", escapedBy='")
-      .append(escapedBy).append("\'}");
-
-    return sb.toString();
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/TableInfo.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/TableInfo.java b/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/TableInfo.java
deleted file mode 100644
index bb39271..0000000
--- a/contrib/views/hive20/src/main/java/org/apache/ambari/view/hive20/resources/uploads/query/TableInfo.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/**
- * 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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * 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.view.hive20.resources.uploads.query;
-
-import org.apache.ambari.view.hive.resources.uploads.query.RowFormat;
-import org.apache.ambari.view.hive20.resources.uploads.ColumnDescriptionImpl;
-import org.apache.ambari.view.hive20.resources.uploads.HiveFileType;
-
-import java.io.Serializable;
-import java.util.List;
-
-/**
- * used as input in Query generation
- */
-public class TableInfo implements Serializable{
-  private String tableName;
-  private String databaseName;
-  private List<ColumnDescriptionImpl> header;
-  private HiveFileType hiveFileType;
-
-  private RowFormat rowFormat;
-
-  public String getTableName() {
-    return tableName;
-  }
-
-  public void setTableName(String tableName) {
-    this.tableName = tableName;
-  }
-
-  public String getDatabaseName() {
-    return databaseName;
-  }
-
-  public void setDatabaseName(String databaseName) {
-    this.databaseName = databaseName;
-  }
-
-  public List<ColumnDescriptionImpl> getHeader() {
-    return header;
-  }
-
-  public void setHeader(List<ColumnDescriptionImpl> header) {
-    this.header = header;
-  }
-
-  public HiveFileType getHiveFileType() {
-    return hiveFileType;
-  }
-
-  public void setHiveFileType(HiveFileType hiveFileType) {
-    this.hiveFileType = hiveFileType;
-  }
-
-  public RowFormat getRowFormat() {
-    return rowFormat;
-  }
-
-  public void setRowFormat(RowFormat rowFormat) {
-    this.rowFormat = rowFormat;
-  }
-
-  public TableInfo(String databaseName, String tableName, List<ColumnDescriptionImpl> header, HiveFileType hiveFileType, RowFormat rowFormat) {
-    this.databaseName = databaseName;
-    this.tableName = tableName;
-    this.header = header;
-    this.hiveFileType = hiveFileType;
-    this.rowFormat = rowFormat;
-  }
-
-  public TableInfo(TableInfo tableInfo) {
-    this.tableName = tableInfo.tableName;
-    this.databaseName = tableInfo.databaseName;
-    this.header = tableInfo.header;
-    this.hiveFileType = tableInfo.hiveFileType;
-    this.rowFormat = tableInfo.rowFormat;
-  }
-
-  public TableInfo() {
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/adapters/file-uploader.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/file-uploader.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/file-uploader.js
new file mode 100644
index 0000000..34f52b1
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/file-uploader.js
@@ -0,0 +1,28 @@
+/**
+ * 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.
+ */
+
+import EmberUploader from 'ember-uploader';
+
+export default EmberUploader.Uploader.extend({
+  method: 'PUT',
+  ajaxSettings: {
+    headers: {
+      "X-Requested-By":"ambari"
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/adapters/upload-table.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/adapters/upload-table.js b/contrib/views/hive20/src/main/resources/ui/app/adapters/upload-table.js
new file mode 100644
index 0000000..3bfe15b
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/adapters/upload-table.js
@@ -0,0 +1,93 @@
+/**
+ * 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.
+ */
+
+import Ember from 'ember';
+import ApplicationAdapter from './application';
+import FileUploader from './file-uploader';
+
+export default ApplicationAdapter.extend({
+  tableOperations: Ember.inject.service(),
+
+  buildURL: function(){
+    return this._super(...arguments);
+  },
+
+  buildUploadURL: function (path) {
+    return  this.buildURL() + "/upload/" + path;
+  },
+
+  uploadFiles: function (path, files, extras) {
+    var uploadUrl = this.buildUploadURL(path);
+
+    console.log("uplaoder : uploadURL : ", uploadUrl, " extras : ", extras , "files : ", files);
+
+    var hdrs = Ember.$.extend(true, {},this.get('headers'));
+    delete hdrs['Content-Type'];
+    var uploader = FileUploader.create({
+      headers: hdrs,
+      url: uploadUrl
+    });
+
+    if (!Ember.isEmpty(files)) {
+      var promise = uploader.upload(files[0], extras);
+      return promise;
+    }
+  },
+
+  createTable: function (tableData) {
+    console.log("creating table with data :", tableData);
+    return this.doPost("createTable",tableData);
+  },
+
+  insertIntoTable: function(insertData){
+    console.log("inserting into table with data : ", insertData);
+    return this.doPost("insertIntoTable",insertData);
+  },
+
+  deleteTable: function(deleteData){
+    console.log("delete table with info : ", deleteData);
+    return this.get('tableOperations').deleteTable(deleteData.database, deleteData.table);
+  },
+
+  doPost : function(path,inputData){
+    var self = this;
+    return new Ember.RSVP.Promise(function(resolve,reject){
+                 Ember.$.ajax({
+                     url :  self.buildUploadURL(path),
+                     type : 'post',
+                     data: JSON.stringify(inputData),
+                     headers: self.get('headers'),
+                     dataType : 'json'
+                 }).done(function(data) {
+                     resolve(data);
+                 }).fail(function(error) {
+                     reject(error);
+                 });
+              });
+  },
+
+  previewFromHDFS : function(previewFromHdfsData){
+    console.log("preview from hdfs with info : ", previewFromHdfsData);
+    return this.doPost("previewFromHdfs",previewFromHdfsData)
+  },
+
+  uploadFromHDFS : function(uploadFromHdfsData){
+    console.log("upload from hdfs with info : ", uploadFromHdfsData);
+    return this.doPost("uploadFromHDFS",uploadFromHdfsData)
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/components/csv-format-params.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/csv-format-params.js b/contrib/views/hive20/src/main/resources/ui/app/components/csv-format-params.js
new file mode 100644
index 0000000..7a14ba8
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/csv-format-params.js
@@ -0,0 +1,77 @@
+/**
+ * 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.
+ */
+
+import Ember from 'ember';
+import Helpers from '../configs/helpers';
+
+export default Ember.Component.extend({
+  showCSVFormatInput: true,
+  DEFAULT_CSV_DELIMITER: ',',
+  DEFAULT_CSV_QUOTE: '"',
+  DEFAULT_CSV_ESCAPE: '\\',
+  DEFAULT_FILE_TYPE: 'CSV',
+  isFirstRowHeader: false, // is first row  header
+  csvParams: Ember.Object.create(),
+  inputFileTypes: Ember.computed(function () {
+    return Helpers.getUploadFileTypes();
+  }),
+  inputFileTypeCSV : Ember.computed.equal('fileFormatInfo.inputFileType.id',"CSV"),
+
+  terminationChars: Ember.computed(function () {
+    return Helpers.getAllTerminationCharacters();
+  }),
+
+  init: function(){
+    this._super(...arguments);
+    this.set('fileFormatInfo.csvParams.csvDelimiter',  this.get("terminationChars").findBy( "name", this.get('DEFAULT_CSV_DELIMITER') ));
+    this.set('fileFormatInfo.csvParams.csvQuote', this.get("terminationChars").findBy( "name",  this.get('DEFAULT_CSV_QUOTE')));
+    this.set('fileFormatInfo.csvParams.csvEscape', this.get("terminationChars").findBy( "name",  this.get('DEFAULT_CSV_ESCAPE')));
+    this.set("fileFormatInfo.inputFileType", this.get("inputFileTypes").findBy("name"),  this.get('DEFAULT_FILE_TYPE'));
+  },
+
+  actions: {
+    toggleCSVFormat: function () {
+      console.log("inside toggleCSVFormat");
+      this.toggleProperty('showCSVFormatInput');
+    },
+    clearColumnDelimter: function(){
+      this.set('fileFormatInfo.csvParams.csvDelimiter');
+    },
+    csvDelimiterSelected: function(terminator){
+      this.set('fileFormatInfo.csvParams.csvDelimiter', terminator);
+    },
+    csvEscapeSelected: function(terminator){
+      this.set('fileFormatInfo.csvParams.csvEscape', terminator);
+    },
+    clearEscapeCharacter: function(){
+      this.set('fileFormatInfo.csvParams.csvEscape');
+    },
+    csvQuoteSelected: function(terminator){
+      this.set('fileFormatInfo.csvParams.csvQuote', terminator);
+    },
+    clearCsvQuote: function(){
+      this.set('fileFormatInfo.csvParams.csvQuote');
+    },
+    inputFileTypeSelected: function(fileType){
+      this.set("fileFormatInfo.inputFileType", fileType);
+    },
+    clearInputFileType: function(){
+      this.set("fileFormatInfo.inputFileType");
+    },
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/components/radio-button.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/radio-button.js b/contrib/views/hive20/src/main/resources/ui/app/components/radio-button.js
new file mode 100644
index 0000000..066168c
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/radio-button.js
@@ -0,0 +1,40 @@
+/**
+ * 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.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+  tagName: 'input',
+  type: 'radio',
+  attributeBindings: ['type', 'htmlChecked:checked', 'value', 'name', 'disabled'],
+
+  htmlChecked: function() {
+    return this.get('value') === this.get('checked');
+  }.property('value', 'checked'),
+
+  change: function() {
+    console.log("value changed : ", this.get('value'));
+    this.set('checked', this.get('value'));
+  },
+
+  _updateElementValue: function() {
+    Ember.run.next(this, function() {
+      this.$().prop('checked', this.get('htmlChecked'));
+    });
+  }.observes('htmlChecked')
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/components/simple-table.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/simple-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/simple-table.js
new file mode 100644
index 0000000..8828275
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/simple-table.js
@@ -0,0 +1,22 @@
+/**
+ * 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.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/components/upload-table-source.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/upload-table-source.js b/contrib/views/hive20/src/main/resources/ui/app/components/upload-table-source.js
new file mode 100644
index 0000000..36da77d
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/upload-table-source.js
@@ -0,0 +1,48 @@
+/**
+ * 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.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+  showFileSourceInput: true,
+  showHdfsLocationInput: Ember.computed.equal("fileInfo.uploadSource", "hdfs"),
+  showLocalLocationInput: Ember.computed.equal("fileInfo.uploadSource", "local"),
+  isLocalUpload: Ember.computed.equal("fileInfo.uploadSource", "local"),
+
+  actions: {
+    toggleFileSource: function(){
+      this.toggleProperty("showFileSourceInput");
+    },
+    closeHdfsModal: function() {
+      this.set('showDirectoryViewer', false);
+    },
+    hdfsPathSelected: function(path) {
+      this.set('fileInfo.hdfsPath', path);
+      this.set('showDirectoryViewer', false);
+    },
+
+    toggleDirectoryViewer: function() {
+      this.set('showDirectoryViewer', true);
+    },
+    onFileChanged: function(file){
+      this.get("fileInfo.files")[0] = file;
+      console.log("setting fifilesUploadedles as : ", this.get("fileInfo.files"));
+      this.sendAction("onFileChanged");
+    },
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/components/upload-table.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/upload-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/upload-table.js
new file mode 100644
index 0000000..29e9891
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/upload-table.js
@@ -0,0 +1,60 @@
+/**
+ * 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.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+  showPreview: false,
+  fileFormatInfo: Ember.Object.create({
+    csvParams: Ember.Object.create(),
+    inputFileType: null,
+  }),
+  fileInfo: Ember.Object.create({
+    files: Ember.A(),
+    hdfsPath: null,
+    uploadSource: null,
+  }),
+  tableMeta: Ember.Object.create(),
+  actions: {
+    onFileChanged: function () {
+      console.log("inside files changed");
+      console.log("fileFormatInfo : ", this.get("fileFormatInfo"));
+      console.log("fileInfo : ", this.get("fileInfo"));
+      console.log("tableInfo : ", this.get("tableInfo"));
+      this.send("preview");
+    },
+    preview: function () {
+      let sourceObject = Ember.Object.create();
+      sourceObject.set("fileFormatInfo", this.get("fileFormatInfo"));
+      sourceObject.set("fileInfo", this.get("fileInfo"));
+      this.sendAction("preview", sourceObject);
+      this.set("showPreview", true);
+    },
+    toggleShowPreview: function(){
+      this.toggleProperty("showPreview");
+    },
+    createAndUpload: function(tableMeta){
+      this.set("tableMeta", tableMeta);
+      let tableData = Ember.Object.create();
+      tableData.set("fileFormatInfo", this.get("fileFormatInfo"));
+      tableData.set("fileInfo", this.get("fileInfo"));
+      tableData.set("tableMeta", this.get("tableMeta"));
+      this.sendAction("createAndUpload", tableData);
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/components/validated-text-field.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/validated-text-field.js b/contrib/views/hive20/src/main/resources/ui/app/components/validated-text-field.js
new file mode 100644
index 0000000..2379a15
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/validated-text-field.js
@@ -0,0 +1,62 @@
+/**
+ * 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.
+ */
+
+
+import Ember from 'ember';
+
+/** Example :
+ * {{#validated-text-field
+ * inputValue=bindedTextValue invalidClass='form-control red-border' validClass='form-control' regex="^[a-z]+$"
+ * allowEmpty=false tooltip="Enter valid word" errorMessage="Please enter valid word" placeholder="Enter Word"}}
+ * {{/validated-text-field}}
+ */
+export default Ember.Component.extend({
+  classNameBindings: ['tagClassName'],
+  tagClassName : false, // set it to non false value if you want a specific class to be assigned
+  allowEmpty: true,
+  valid: true,
+  setValid: function () {
+    this.set("valid", true);
+    this.set("inputClass", this.get("validClass"));
+    this.set("message", this.get("tooltip"));
+  },
+  setInvalid: function () {
+    this.set("valid", false);
+    this.set("inputClass", this.get("invalidClass"));
+    this.set("message", this.get("errorMessage"));
+  },
+  onChangeInputValue: function () {
+    var regStr = this.get("regex");
+    var regExp = new RegExp(regStr, "g");
+    if (this.get("inputValue")) {
+      var arr = this.get("inputValue").match(regExp);
+      if (arr != null && arr.length == 1) {
+        this.setValid();
+      }
+      else {
+        this.setInvalid();
+      }
+    } else {
+      if (this.get("allowEmpty")) {
+        this.setValid();
+      } else {
+        this.setInvalid();
+      }
+    }
+  }.observes("inputValue").on('init')
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/configs/helpers.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/configs/helpers.js b/contrib/views/hive20/src/main/resources/ui/app/configs/helpers.js
index 025caa6..ecefe55 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/configs/helpers.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/configs/helpers.js
@@ -142,10 +142,22 @@ export default Ember.Object.create({
    */
   getAllTerminationCharacters() {
     let arr = Ember.copy(nonPrintableChars);
-    for(let i=33; i < 127; i++) {
+    for (let i = 33; i < 127; i++) {
       arr.pushObject({id: i.toString(), name: String.fromCodePoint(i)});
     }
     return arr;
+  },
+
+  /**
+   * returns file types supported for upload-table feature.
+   */
+  getUploadFileTypes() {
+    let arr = [
+      {id: "CSV", name: "CSV"},
+      {id: "JSON", name: "JSON"},
+      {id: "XML", name: "XML"}
+    ];
+    return Ember.copy(arr);
   }
 
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/locales/en/translations.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/locales/en/translations.js b/contrib/views/hive20/src/main/resources/ui/app/locales/en/translations.js
new file mode 100644
index 0000000..b550dbe
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/locales/en/translations.js
@@ -0,0 +1,111 @@
+/**
+ * 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.
+ */
+
+export default {
+  "hive": {
+    "ui": {
+      "fileSource": {
+        'uploadFromLocal': "Upload from Local",
+        'uploadFromHdfs': "Upload from HDFS",
+        'selectFileType': "Select File Type",
+        'fileType': "File type",
+        "selectHdfsLocation": "Select HDFS Directory",
+        "enterHdfsPathLabel": "Enter Hdfs Path",
+        "selectLocalFileLabel": "Select Local File",
+      },
+      "csvFormatParams": {
+        'columnDelimterField': "Field Delimiter",
+        'columnDelimiterTooltip': "Delimiter for the column values. Default is comman (,).",
+        'escapeCharacterField': "Escape Character",
+        'escapeCharacterTooltip': "Escape character. Default is backslash (\).",
+        'quoteCharacterTooltip': 'Quote character. Default is double quote (").',
+        'quoteCharacterField': "Quote Character",
+      },
+      "uploadTable": {
+        'uploadProgress': "Upload Progress",
+        'uploading': "Uploading..",
+        'selectFromLocal': "Select from local",
+        'hdfsPath': "HDFS Path",
+        'selectDatabase': "Select a Database",
+        'tableName': "Table name",
+        'tableNameErrorMessage': "Only alphanumeric and underscore characters are allowed in table name.",
+        'tableNameTooltip': "Enter valid (alphanumeric + underscore) table name.",
+        'storedAs': "Stored as",
+        'isFirstRowHeader': "Is first row header ?",
+        'columnNameTooltip': "Enter valid (alphanumeric + underscore) column name.",
+        'columnNameErrorMessage': "Only alphanumeric and underscore characters are allowed in column names.",
+        'hdfsFieldTooltip': "Enter full HDFS path",
+        'hdfsFieldPlaceholder': "Enter full HDFS path",
+        'hdfsFieldErrorMessage': "Please enter complete path of hdfs file to upload.",
+        'containsEndlines': "Contains endlines?",
+        'fieldsTerminatedByField': "Fields Terminated By",
+        'escapedByField': "Escape By",
+        'escapedByTooltip': "Escaped By character for Hive table.",
+        'fieldsTerminatedByTooltip': "Fields Terminated By character for Hive table.",
+        'isFirstRowHeaderTooltip': "Check if the first row of CSV is a header.",
+        'showPreview': "Preview"
+      }
+    },
+    words :{
+      temporary : "Temporary",
+      actual : "Actual",
+      database : "Database"
+    },
+    errors: {
+      'no.query': "No query to process.",
+      'emptyDatabase': "Please select {{ database }}.",
+      'emptyTableName': "Please enter {{ tableNameField }}.",
+      'illegalTableName': "Illegal {{ tableNameField }} : '{{ tableName }}'",
+      'emptyIsFirstRow': "{{isFirstRowHeaderField}} cannot be null.",
+      'emptyHeaders': "Headers (containing column names) cannot be null.",
+      'emptyColumnName': "Column name cannot be null.",
+      'illegalColumnName': "Illegal column name : '{{columnName}}' in column number {{index}}",
+      'emptyHdfsPath': "HdfsPath Name cannot be null or empty.",
+      'illegalHdfPath': "Illegal hdfs path : {{hdfsPath}}"
+    },
+    messages: {
+      'generatingPreview': "Generating Preview.",
+      'startingToCreateActualTable': "Creating Actual table",
+      'waitingToCreateActualTable': "Waiting for creation of Actual table",
+      'successfullyCreatedActualTable': "Successfully created Actual table.",
+      'failedToCreateActualTable': "Failed to create Actual table.",
+      'startingToCreateTemporaryTable': "Creating Temporary table.",
+      'waitingToCreateTemporaryTable': "Waiting for creation of Temporary table.",
+      'successfullyCreatedTemporaryTable': "Successfully created Temporary table.",
+      'failedToCreateTemporaryTable': " Failed to create temporary table.",
+      'deletingTable': "Deleting {{table}} table.",
+      'succesfullyDeletedTable': "Successfully deleted {{ table}} table.",
+      'failedToDeleteTable': "Failed to delete {{table}} table.",
+      'startingToUploadFile': "Uploading file.",
+      'waitingToUploadFile': "Waiting for uploading file.",
+      'successfullyUploadedFile': "Successfully uploaded file.",
+      'failedToUploadFile': "Failed to upload file.",
+      'startingToInsertRows': "Inserting rows from temporary table to actual table.",
+      'waitingToInsertRows': "Waiting for insertion of rows from temporary table to actual table.",
+      'successfullyInsertedRows': "Successfully inserted rows from temporary table to actual table.",
+      'failedToInsertRows': "Failed to insert rows from temporary table to actual table.",
+      'startingToDeleteTemporaryTable': "Deleting temporary table.",
+      'waitingToDeleteTemporaryTable': "Waiting for deletion of temporary table.",
+      'successfullyDeletedTemporaryTable': "Successfully deleted temporary table",
+      'manuallyDeleteTable': "You will have to manually delete the table {{databaseName}}.{{tableName}}",
+      'uploadingFromHdfs': "Uploading file from HDFS ",
+      'successfullyUploadedTableMessage': "Table {{tableName}} created in database {{databaseName}}",
+      'successfullyUploadedTableHeader': "Uploaded Successfully"
+    },
+  }
+};

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/models/column.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/models/column.js b/contrib/views/hive20/src/main/resources/ui/app/models/column.js
index b1fa99c..1d9ccce 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/models/column.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/models/column.js
@@ -19,8 +19,7 @@
 import Ember from 'ember';
 import datatypes from '../configs/datatypes';
 import Helper from '../configs/helpers';
-
-export default Ember.Object.extend({
+let Column = Ember.Object.extend(Ember.Copyable,{
   name: '',
   type: datatypes[0],
   precision: null,
@@ -103,5 +102,23 @@ export default Ember.Object.extend({
 
     }
     return this.get('errors.length') === 0;
+  },
+
+  copy: function(){
+    return Column.create({
+      name: this.get("name"),
+      type: this.get("type"),
+      precision: this.get("percision"),
+      scale: this.get("scale"),
+      isPartitioned: this.get("isPartitioned"),
+      isClustered: this.get("isClustered"),
+      comment: this.get("comment"),
+
+      errors: this.get("errors").copy(),
+      editing: this.get("editing"),
+    });
   }
-})
+
+});
+
+export default Column;

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/router.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/router.js b/contrib/views/hive20/src/main/resources/ui/app/router.js
index 150a3fd..428cb43 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/router.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/router.js
@@ -38,6 +38,7 @@ Router.map(function() {
       this.route('tables', {path: '/tables'}, function() {
         this.route('new-database');
         this.route('new');
+        this.route('upload-table');
         this.route('table', {path: '/:name'}, function() {
           this.route('columns');
           this.route('partitions');
@@ -61,7 +62,6 @@ Router.map(function() {
 
     });
   });
-
 });
 
 export default Router;

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new.js
index 6dfdf29..c8ad239 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/new.js
@@ -27,42 +27,64 @@ export default Ember.Route.extend({
     controller.set('tabs', Ember.copy(tabs));
   },
 
+  // function is used in sub-classes
+  /**
+   * @param settings
+   * @param shouldTransition : should transition to other route?
+   * @returns {Promise.<TResult>|*}
+   */
+  createTable: function(settings, shouldTransition){
+    this.controller.set('showCreateTableModal', true);
+    this.controller.set('createTableMessage', 'Submitting request to create table');
+    let databaseModel = this.controllerFor('databases.database').get('model');
+    return this.get('tableOperations').submitCreateTable(databaseModel.get('name'), settings)
+      .then((job) => {
+        console.log('Created job: ', job.get('id'));
+        this.controller.set('createTableMessage', 'Waiting for the table to be created');
+        return this.get('tableOperations').waitForJobToComplete(job.get('id'), 5 * 1000)
+          .then((status) => {
+            this.controller.set('createTableMessage', "Successfully created table");
+            Ember.run.later(() => {
+            this.controller.set('showCreateTableModal', false);
+            this.controller.set('createTableMessage');
+            this._addTableToStoreLocally(databaseModel, settings.name);
+            this._resetModelInTablesController(databaseModel.get('tables'));
+              if(shouldTransition){
+                this._transitionToCreatedTable(databaseModel.get('name'), settings.name);
+              }
+            }, 2 * 1000);
+            return Ember.RSVP.Promise.resolve(job);
+          }, (error) => {
+            // TODO: handle error
+            Ember.run.later(() => {
+              this.controller.set('showCreateTableModal', false);
+              this.controller.set('createTableMessage');
+              if(shouldTransition) {
+                this.transitionTo('databases.database', databaseModel.get('name'));
+              }
+            }, 2 * 1000);
+
+            return Ember.RSVP.Promise.reject(error);
+          });
+      }, (error) => {
+        console.log("Error encountered", error);
+        this.controller.set('showCreateTableModal', true);
+        throw error;
+      });
+  },
   actions: {
     cancel() {
       let databaseController = this.controllerFor('databases.database');
       this.transitionTo('databases.database', databaseController.get('model'));
     },
+    toggleCSVFormat: function() {
+      console.log("inside new route toggleCSVFormat");
+      this.toggleProperty('showCSVFormatInput')
+    },
 
     create(settings) {
-      this.controller.set('showCreateTableModal', true);
-      this.controller.set('createTableMessage', 'Submitting request to create table');
-      let databaseModel = this.controllerFor('databases.database').get('model');
-      this.get('tableOperations').submitCreateTable(databaseModel.get('name'), settings)
-        .then((job) => {
-          console.log('Created job: ', job.get('id'));
-          this.controller.set('createTableMessage', 'Waiting for the table to be created');
-          this.get('tableOperations').waitForJobToComplete(job.get('id'), 5 * 1000)
-            .then((status) => {
-              this.controller.set('createTableMessage', "Successfully created table");
-              Ember.run.later(() => {
-                this.controller.set('showCreateTableModal', false);
-                this.controller.set('createTableMessage');
-                this._addTableToStoreLocally(databaseModel, settings.name);
-                this._resetModelInTablesController(databaseModel.get('tables'));
-                this._transitionToCreatedTable(databaseModel.get('name'), settings.name);
-              }, 2 * 1000);
-            }, (error) => {
-              // TODO: handle error
-              Ember.run.later(() => {
-                this.controller.set('showCreateTableModal', false);
-                this.controller.set('createTableMessage');
-                this.transitionTo('databases.database', databaseModel.get('name'));
-              }, 2 * 1000);
-            });
-        }, (error) => {
-          console.log("Error encountered", error);
-          this.controller.set('showCreateTableModal', true);
-        });
+      // keep this a function call call only as the createTable function is used in sub-classes
+      this.createTable(settings, true);
     }
   },
 


[17/51] [abbrv] ambari git commit: AMBARI-19594. configure kerberos authentication for Druid UIs (Nishant Bangarwa via smohanty)

Posted by rz...@apache.org.
AMBARI-19594. configure kerberos authentication for Druid UIs (Nishant Bangarwa via smohanty)

(cherry picked from commit caa69171b163a547341da5f4341ba6d0df66ceb5)

Change-Id: I01f34e79965ad7b8fb74d7ae8b08ec66e0dfc7f6


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: b09247fbf47477e41f977ac217419538078f3e5d
Parents: 14d78ab
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Fri Feb 3 13:24:24 2017 -0800
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 00:39:01 2017 -0800

----------------------------------------------------------------------
 .../DRUID/0.9.2/configuration/druid-common.xml   |  6 ++++++
 .../DRUID/0.9.2/package/scripts/druid.py         |  2 ++
 .../DRUID/0.9.2/package/scripts/params.py        |  5 ++++-
 .../stacks/HDP/2.6/services/DRUID/kerberos.json  | 19 ++++++++++++++++++-
 .../test/python/stacks/2.6/DRUID/test_druid.py   |  2 ++
 .../test/python/stacks/2.6/configs/default.json  |  3 ++-
 6 files changed, 34 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b09247fb/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-common.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-common.xml b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-common.xml
index e00480e..a494750 100644
--- a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-common.xml
+++ b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/configuration/druid-common.xml
@@ -46,6 +46,12 @@
     <on-ambari-upgrade add="false"/>
   </property>
   <property>
+    <name>druid.security.extensions.loadList</name>
+    <value>[]</value>
+    <description>A comma-separated list of one or more druid security extensions to load. This property will be set via the kerberos wizard and User will not be allowed to modify this when security is enabled.</description>
+    <on-ambari-upgrade add="false"/>
+  </property>
+  <property>
     <name>druid.zk.service.host</name>
     <value>localhost:2181</value>
     <description>

http://git-wip-us.apache.org/repos/asf/ambari/blob/b09247fb/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/druid.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/druid.py b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/druid.py
index 20eda92..18febeb 100644
--- a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/druid.py
+++ b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/druid.py
@@ -48,6 +48,8 @@ def druid(upgrade_type=None, nodeType=None):
     'druid.service']
   druid_common_config['druid.selectors.coordinator.serviceName'] = \
     params.config['configurations']['druid-coordinator']['druid.service']
+  druid_common_config['druid.extensions.loadList'] = json.dumps(eval(params.druid_extensions_load_list) +
+                                                     eval(params.druid_security_extensions_load_list))
 
   # delete the password and user if empty otherwiswe derby will fail.
   if 'derby' == druid_common_config['druid.metadata.storage.type']:

http://git-wip-us.apache.org/repos/asf/ambari/blob/b09247fb/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py
index 558087d..aed4043 100644
--- a/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/DRUID/0.9.2/package/scripts/params.py
@@ -74,6 +74,9 @@ druid_log_dir = config['configurations']['druid-env']['druid_log_dir']
 druid_classpath = config['configurations']['druid-env']['druid_classpath']
 druid_extensions = config['configurations']['druid-common']['druid.extensions.pullList']
 druid_repo_list = config['configurations']['druid-common']['druid.extensions.repositoryList']
+druid_extensions_load_list = config['configurations']['druid-common']['druid.extensions.loadList']
+druid_security_extensions_load_list = config['configurations']['druid-common']['druid.security.extensions.loadList']
+
 
 # status params
 druid_pid_dir = status_params.druid_pid_dir
@@ -121,7 +124,7 @@ hdfs_site = config['configurations']['hdfs-site']
 default_fs = config['configurations']['core-site']['fs.defaultFS']
 dfs_type = default("/commandParams/dfs_type", "")
 
-# Kerberose
+# Kerberos
 druid_principal_name = default('/configurations/druid-common/druid.hadoop.security.kerberos.principal',
                                'missing_principal')
 druid_user_keytab = default('/configurations/druid-common/druid.hadoop.security.kerberos.keytab', 'missing_keytab')

http://git-wip-us.apache.org/repos/asf/ambari/blob/b09247fb/ambari-server/src/main/resources/stacks/HDP/2.6/services/DRUID/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/DRUID/kerberos.json b/ambari-server/src/main/resources/stacks/HDP/2.6/services/DRUID/kerberos.json
index 1661285..251975b 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/DRUID/kerberos.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/DRUID/kerberos.json
@@ -4,7 +4,13 @@
       "name": "DRUID",
       "identities": [
         {
-          "name": "/spnego"
+          "name": "/spnego",
+          "principal": {
+            "configuration": "druid-common/druid.hadoop.security.spnego.principal"
+          },
+          "keytab": {
+            "configuration": "druid-common/druid.hadoop.security.spnego.keytab"
+          }
         },
         {
           "name": "druid",
@@ -72,6 +78,17 @@
             }
           ]
         }
+      ],
+      "configurations": [
+        {
+          "druid-common": {
+            "druid.hadoop.security.spnego.excludedPaths": "[\"/status\"]",
+            "druid.security.extensions.loadList" : "[\"druid-kerberos\"]"
+          }
+        }
+      ],
+      "auth_to_local_properties" : [
+        "druid-common/druid.hadoop.security.spnego.authToLocal|new_lines_escaped"
       ]
     }
   ]

http://git-wip-us.apache.org/repos/asf/ambari/blob/b09247fb/ambari-server/src/test/python/stacks/2.6/DRUID/test_druid.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.6/DRUID/test_druid.py b/ambari-server/src/test/python/stacks/2.6/DRUID/test_druid.py
index 0a143ae..422e9ba 100644
--- a/ambari-server/src/test/python/stacks/2.6/DRUID/test_druid.py
+++ b/ambari-server/src/test/python/stacks/2.6/DRUID/test_druid.py
@@ -445,6 +445,8 @@ class TestDruid(RMFTestCase):
     druid_common_config['druid.extensions.hadoopDependenciesDir'] = format('/usr/hdp/current/{role}/hadoop-dependencies')
     druid_common_config['druid.selectors.indexing.serviceName'] = 'druid/overlord'
     druid_common_config['druid.selectors.coordinator.serviceName'] = 'druid/coordinator'
+    druid_common_config['druid.extensions.loadList'] = '["mysql-metadata-storage", "druid-datasketches", "druid-kerberos"]'
+
 
     self.assertResourceCalled('PropertiesFile', 'common.runtime.properties',
                               dir=format("/usr/hdp/current/{role}/conf/_common"),

http://git-wip-us.apache.org/repos/asf/ambari/blob/b09247fb/ambari-server/src/test/python/stacks/2.6/configs/default.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.6/configs/default.json b/ambari-server/src/test/python/stacks/2.6/configs/default.json
index 963c4a4..4d9f98c 100644
--- a/ambari-server/src/test/python/stacks/2.6/configs/default.json
+++ b/ambari-server/src/test/python/stacks/2.6/configs/default.json
@@ -430,7 +430,8 @@
       "druid.indexer.logs.directory": "/user/druid/logs",
       "druid.extensions.pullList": "[\"custom-druid-extension\"]",
       "druid.extensions.repositoryList": "[\"http://custom-mvn-repo/public/release\"]",
-      "druid.extensions.loadList": "[\"mysql-metadata-storage\", \"druid-datasketches\"]"
+      "druid.extensions.loadList": "[\"mysql-metadata-storage\", \"druid-datasketches\"]",
+      "druid.security.extensions.loadList": "[\"druid-kerberos\"]"
     },
     "druid-historical" : {
       "druid.segmentCache.infoDir" : "/apps/druid/segmentCache/info_dir",


[08/51] [abbrv] ambari git commit: AMBARI-19871 - Config version switch/compare/revert doesn't work (rzang)

Posted by rz...@apache.org.
AMBARI-19871 - Config version switch/compare/revert doesn't work (rzang)

(cherry picked from commit bcf76586b6da2a704a5b986958050a28fd0c6d26)

Change-Id: Iefaac4b4d070656319b8c4ee4eb2bae4d35d323c


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 8ffb9892468777f6f9d1fe42537d2a9a25008983
Parents: 7dbbffb
Author: Richard Zang <rz...@apache.org>
Authored: Mon Feb 6 11:30:15 2017 -0800
Committer: Zuul <re...@hortonworks.com>
Committed: Mon Feb 6 20:33:59 2017 -0800

----------------------------------------------------------------------
 .../app/views/common/configs/config_history_flow.js | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/8ffb9892/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index a7b83b3..4f3ba97 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -45,11 +45,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
     COMPARE: 'compare',
     REVERT: 'revert'
   },
-
-  /**
-   * serviceVersion object that is currently being hovered in the dropdown menu
-   */
-  hoveredServiceVersion: null,
+  
   /**
    * flag to check if sub-menu popup is currently being hovered
    */
@@ -303,11 +299,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
    */
   switchVersion: function (event) {
     var version = event.context.get('version');
-    if(this.get('hoveredServiceVersion')) {
-      version = this.get('hoveredServiceVersion.version');
-    }
     var versionIndex = 0;
-
     this.set('compareServiceVersion', null);
     this.get('serviceVersions').forEach(function (serviceVersion, index) {
       if (serviceVersion.get('version') === version) {
@@ -326,7 +318,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
    * add a second version-info-bar for the chosen version
    */
   compare: function (event) {
-    var serviceConfigVersion = this.get('hoveredServiceVersion') || event.context;
+    var serviceConfigVersion = event.context;
     this.set('controller.compareServiceVersion', serviceConfigVersion);
     this.set('compareServiceVersion', serviceConfigVersion);
 
@@ -363,7 +355,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
    */
   revert: function (event) {
     var self = this;
-    var serviceConfigVersion = this.get('hoveredServiceVersion') || event.context || Em.Object.create({
+    var serviceConfigVersion = event.context || Em.Object.create({
       version: this.get('displayedServiceVersion.version'),
       serviceName: this.get('displayedServiceVersion.serviceName'),
       notes:''
@@ -591,9 +583,7 @@ App.ConfigHistoryDropdownRowView = Em.View.extend({
       var $el = $('#config_version_popup');
       var $currentTarget = $(event.currentTarget);
       var parentView = view.get('parentView');
-      parentView.set('hoveredServiceVersion', null);
       if (!serviceVersion.get("isDisplayed"))  {
-        parentView.set('hoveredServiceVersion', serviceVersion);
         parentView.set('isHovered', true);
         var elHeight = $el.outerHeight(),
           pagePosition = window.innerHeight + window.pageYOffset,


[12/51] [abbrv] ambari git commit: AMBARI-19746 Ambari HDFS Metric alerts turns to UNKNOWN status with error "argument of type 'NoneType' is not iterable" (dsen)

Posted by rz...@apache.org.
AMBARI-19746 Ambari HDFS Metric alerts turns to UNKNOWN status with error "argument of type 'NoneType' is not iterable" (dsen)

(cherry picked from commit c5ed48d798cb97b6573589f6eb3d280b1c5d48de)

Change-Id: I1beb1799ced2ffd83b772f81030cf052587d348b


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: dc51287821c0dc0d79caaa0c3de2548828f68dc5
Parents: 44f4519
Author: Dmytro Sen <ds...@apache.org>
Authored: Thu Feb 2 20:12:30 2017 +0200
Committer: Zuul <re...@hortonworks.com>
Committed: Mon Feb 6 21:54:30 2017 -0800

----------------------------------------------------------------------
 .../src/main/python/ambari_agent/ActionQueue.py  |  5 +++++
 .../ambari_commons/ambari_metrics_helper.py      | 19 +++++++++++++------
 2 files changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/dc512878/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
index 8514a88..5300b52 100644
--- a/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
+++ b/ambari-agent/src/main/python/ambari_agent/ActionQueue.py
@@ -36,6 +36,7 @@ from CommandStatusDict import CommandStatusDict
 from CustomServiceOrchestrator import CustomServiceOrchestrator
 from ambari_agent.BackgroundCommandExecutionHandle import BackgroundCommandExecutionHandle
 from ambari_commons.str_utils import split_on_chunks
+from resource_management.libraries.script import Script
 
 
 logger = logging.getLogger()
@@ -549,6 +550,10 @@ class ActionQueue(threading.Thread):
       else:
         globalConfig = {}
 
+      if not Script.config :
+        logger.debug('Setting Script.config to last status command configuration')
+        Script.config = command
+
       livestatus = LiveStatus(cluster, service, component,
                               globalConfig, self.config, self.configTags)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/dc512878/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py b/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py
index 7841bde..6444dfd 100644
--- a/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py
+++ b/ambari-common/src/main/python/ambari_commons/ambari_metrics_helper.py
@@ -24,7 +24,6 @@ from resource_management.libraries.functions import conf_select
 
 DEFAULT_COLLECTOR_SUFFIX = '.sink.timeline.collector.hosts'
 DEFAULT_METRICS2_PROPERTIES_FILE_NAME = 'hadoop-metrics2.properties'
-DEFAULT_HADOOP_CONF_DIR_PATH = '/usr/hdp/current/hadoop-client/conf/'
 
 def select_metric_collector_for_sink(sink_name):
   # TODO check '*' sink_name
@@ -46,10 +45,18 @@ def get_metric_collectors_from_properties_file(sink_name):
   try:
     hadoop_conf_dir = conf_select.get_hadoop_conf_dir()
   except Exception as e:
-    print "Can't get hadoop conf directory from conf_select.get_hadoop_conf_dir() - " + str(e)
-    hadoop_conf_dir = DEFAULT_HADOOP_CONF_DIR_PATH
-  props = load_properties_from_file(os.path.join(hadoop_conf_dir, DEFAULT_METRICS2_PROPERTIES_FILE_NAME))
-  return props.get(sink_name + DEFAULT_COLLECTOR_SUFFIX)
+    raise Exception("Couldn't define hadoop_conf_dir: {0}".format(e))
+  properties_filepath = os.path.join(hadoop_conf_dir, DEFAULT_METRICS2_PROPERTIES_FILE_NAME)
+
+  if not os.path.exists(properties_filepath):
+    raise Exception("Properties file doesn't exist : {0}. Can't define metric collector hosts".format(properties_filepath))
+  props = load_properties_from_file(properties_filepath)
+
+  property_key = sink_name + DEFAULT_COLLECTOR_SUFFIX
+  if property_key in props:
+    return props.get(property_key)
+  else:
+    raise Exception("Properties file doesn't contain {0}. Can't define metric collector hosts".format(property_key))
 
 def load_properties_from_file(filepath, sep='=', comment_char='#'):
   """
@@ -64,4 +71,4 @@ def load_properties_from_file(filepath, sep='=', comment_char='#'):
         key = key_value[0].strip()
         value = sep.join(key_value[1:]).strip('" \t')
         props[key] = value
-  return props
+  return props
\ No newline at end of file


[03/51] [abbrv] ambari git commit: AMBARI-19687. Set the logger for LLAP in hdp-2.6 stack. (sseth via Swapan Shridhar)

Posted by rz...@apache.org.
AMBARI-19687. Set the logger for LLAP in hdp-2.6 stack. (sseth via Swapan Shridhar)

(cherry picked from commit 7ee253841aa5ea7a96f063dce5f6e3b3ac8adeda)

Change-Id: I28c88e51733cac80a541aaa67f13ba354db7571b


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: ad7d916d6102686ad210cb272dc1f4006922f465
Parents: 53cefdb
Author: Swapan Shridhar <ss...@hortonworks.com>
Authored: Tue Jan 31 12:37:47 2017 -0800
Committer: Zuul <re...@hortonworks.com>
Committed: Mon Feb 6 18:09:48 2017 -0800

----------------------------------------------------------------------
 .../0.12.0.2.0/package/scripts/hive_server_interactive.py    | 3 +++
 .../HIVE/0.12.0.2.0/package/scripts/params_linux.py          | 1 +
 .../services/HIVE/configuration/hive-interactive-site.xml    | 8 ++++++++
 3 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ad7d916d/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
index e1b938f..6fca766 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/hive_server_interactive.py
@@ -303,6 +303,9 @@ class HiveServerInteractiveDefault(HiveServerInteractive):
                      "YARN NodeManager Memory({1})".format(params.llap_daemon_container_size, params.yarn_nm_mem))
         cmd += format(" --slider-placement {slider_placement} --skiphadoopversion --skiphbasecp")
 
+        # Setup the logger for the ga version only
+        cmd += format(" --logger {params.llap_logger}")
+
       if params.security_enabled:
         llap_keytab_splits = params.hive_llap_keytab_file.split("/")
         Logger.debug("llap_keytab_splits : {0}".format(llap_keytab_splits))

http://git-wip-us.apache.org/repos/asf/ambari/blob/ad7d916d/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
index 14688a6..a991f86 100644
--- a/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/HIVE/0.12.0.2.0/package/scripts/params_linux.py
@@ -692,6 +692,7 @@ if has_hive_interactive:
   num_llap_nodes = config['configurations']['hive-interactive-env']['num_llap_nodes']
   llap_daemon_container_size = config['configurations']['hive-interactive-site']['hive.llap.daemon.yarn.container.mb']
   llap_log_level = config['configurations']['hive-interactive-env']['llap_log_level']
+  llap_logger = default('/configurations/hive-interactive-site/hive.llap.daemon.logger', 'query-routing')
   hive_aux_jars = default('/configurations/hive-interactive-env/hive_aux_jars', '')
   hive_llap_io_mem_size = config['configurations']['hive-interactive-site']['hive.llap.io.memory.size']
   llap_heap_size = config['configurations']['hive-interactive-env']['llap_heap_size']

http://git-wip-us.apache.org/repos/asf/ambari/blob/ad7d916d/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-site.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-site.xml
index 101de44..befd0f9 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-site.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-site.xml
@@ -72,4 +72,12 @@ limitations under the License.
     <on-ambari-upgrade add="true"/>
   </property>
 
+  <property>
+    <name>hive.llap.daemon.logger</name>
+    <value>query-routing</value>
+    <description>Logger to be used by LLAP. (query-routing, RFA)</description>
+    <display-name>LLAP logger</display-name>
+    <on-ambari-upgrade add="true"/>
+  </property>
+
 </configuration>


[43/51] [abbrv] ambari git commit: AMBARI-19863 ADDENDUM Fix Log Search User Config bugs (mgergely)

Posted by rz...@apache.org.
AMBARI-19863 ADDENDUM Fix Log Search User Config bugs (mgergely)

Change-Id: I929e2f07128cfcd5b0ce710e282c75384b4aac0d
(cherry picked from commit ea50bd7b68caf590dadd26bae182c46734985ccb)


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 168f2649958d1f2e1a9dabdb9c38fc1c0d81d688
Parents: a34d6dc
Author: Miklos Gergely <mg...@hortonworks.com>
Authored: Tue Feb 7 11:25:10 2017 +0100
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 08:29:31 2017 -0800

----------------------------------------------------------------------
 .../converter/UserConfigRequestQueryConverterTest.java   | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/168f2649/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/UserConfigRequestQueryConverterTest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/UserConfigRequestQueryConverterTest.java b/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/UserConfigRequestQueryConverterTest.java
index a126df8..cbfab4f 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/UserConfigRequestQueryConverterTest.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/test/java/org/apache/ambari/logsearch/converter/UserConfigRequestQueryConverterTest.java
@@ -18,9 +18,7 @@
  */
 package org.apache.ambari.logsearch.converter;
 
-import org.apache.ambari.logsearch.common.LogSearchContext;
 import org.apache.ambari.logsearch.model.request.impl.UserConfigRequest;
-import org.apache.ambari.logsearch.web.model.User;
 import org.apache.solr.client.solrj.SolrQuery;
 import org.junit.Before;
 import org.junit.Test;
@@ -42,17 +40,10 @@ public class UserConfigRequestQueryConverterTest extends AbstractRequestConverte
     UserConfigRequest request = new UserConfigRequest();
     request.setRowType("myRowType"); // TODO: validate these 3 fields @Valid on UserConfigRequest object -> not null
     request.setFilterName("myFilterName");
-    
-    LogSearchContext context = new LogSearchContext();
-    User user = new User();
-    user.setUsername("myUserId");
-    context.setUser(user);
-    LogSearchContext.setContext(context);
     // WHEN
     SolrQuery queryResult = underTest.convert(request);
     // THEN
-    assertEquals("?q=*%3A*&fq=rowtype%3AmyRowType&fq=username%3AmyUserId+OR+share_username_list%3AmyUserId" +
-      "&fq=filtername%3A*myFilterName*&start=0&rows=10&sort=filtername+asc",
+    assertEquals("?q=*%3A*&fq=rowtype%3AmyRowType&fq=filtername%3A*myFilterName*&start=0&rows=10&sort=filtername+asc",
       queryResult.toQueryString());
   }
 }


[18/51] [abbrv] ambari git commit: AMBARI-19805. Add outputFormat attribute to all PXF Hive-related profiles.

Posted by rz...@apache.org.
AMBARI-19805. Add outputFormat attribute to all PXF Hive-related profiles.

(cherry picked from commit ccaa4a8a0b51dd3436db9bff9cbbb13e9455ec7c)

Change-Id: I85e79118a8d6dfb61d9f17b8fc7aa50d74a66509


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: df7037ec3db35b20a8b7222775fc0a7fdc0025b0
Parents: b09247f
Author: Oleksandr Diachenko <od...@pivotal.io>
Authored: Thu Feb 2 16:01:24 2017 -0800
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 00:49:01 2017 -0800

----------------------------------------------------------------------
 .../PXF/3.0.0/configuration/pxf-profiles.xml         | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/df7037ec/ambari-server/src/main/resources/common-services/PXF/3.0.0/configuration/pxf-profiles.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/PXF/3.0.0/configuration/pxf-profiles.xml b/ambari-server/src/main/resources/common-services/PXF/3.0.0/configuration/pxf-profiles.xml
index 77aa4fc..a3e587d 100644
--- a/ambari-server/src/main/resources/common-services/PXF/3.0.0/configuration/pxf-profiles.xml
+++ b/ambari-server/src/main/resources/common-services/PXF/3.0.0/configuration/pxf-profiles.xml
@@ -71,12 +71,16 @@ under the License.
     </profile>
     <profile>
         <name>Hive</name>
-        <description>This profile is suitable for using when connecting to Hive</description>
+        <description>
+            This profile is suitable for using when connecting to Hive.
+            Supports GPDBWritable output format, as specified in FORMAT header parameter.
+        </description>
         <plugins>
             <fragmenter>org.apache.hawq.pxf.plugins.hive.HiveDataFragmenter</fragmenter>
             <accessor>org.apache.hawq.pxf.plugins.hive.HiveAccessor</accessor>
             <resolver>org.apache.hawq.pxf.plugins.hive.HiveResolver</resolver>
             <metadata>org.apache.hawq.pxf.plugins.hive.HiveMetadataFetcher</metadata>
+            <outputFormat>org.apache.hawq.pxf.service.io.GPDBWritable</outputFormat>
         </plugins>
     </profile>
     <profile>
@@ -85,12 +89,15 @@ under the License.
             and serialized with either the ColumnarSerDe or the LazyBinaryColumnarSerDe.
             It is much faster than the general purpose Hive profile.
             DELIMITER parameter is mandatory.
+            Supports both GPDBWritable and TEXT output formats, as specified in FORMAT header parameter.
+            Primary optimized for TEXT output format.
         </description>
         <plugins>
             <fragmenter>org.apache.hawq.pxf.plugins.hive.HiveInputFormatFragmenter</fragmenter>
             <accessor>org.apache.hawq.pxf.plugins.hive.HiveRCFileAccessor</accessor>
             <resolver>org.apache.hawq.pxf.plugins.hive.HiveColumnarSerdeResolver</resolver>
             <metadata>org.apache.hawq.pxf.plugins.hive.HiveMetadataFetcher</metadata>
+            <outputFormat>org.apache.hawq.pxf.service.io.Text</outputFormat>
         </plugins>
     </profile>
     <profile>
@@ -98,12 +105,15 @@ under the License.
         <description>This profile is suitable only for Hive tables stored as Text files.
             It is much faster than the general purpose Hive profile.
             DELIMITER parameter is mandatory.
+            Supports both GPDBWritable and TEXT output formats, as specified in FORMAT header parameter.
+            Primary optimized for TEXT output format.
         </description>
         <plugins>
             <fragmenter>org.apache.hawq.pxf.plugins.hive.HiveInputFormatFragmenter</fragmenter>
             <accessor>org.apache.hawq.pxf.plugins.hive.HiveLineBreakAccessor</accessor>
             <resolver>org.apache.hawq.pxf.plugins.hive.HiveStringPassResolver</resolver>
             <metadata>org.apache.hawq.pxf.plugins.hive.HiveMetadataFetcher</metadata>
+            <outputFormat>org.apache.hawq.pxf.service.io.Text</outputFormat>
         </plugins>
     </profile>
     <profile>
@@ -111,13 +121,14 @@ under the License.
         <description>This profile is suitable only for Hive tables stored in ORC files
             and serialized with either the ColumnarSerDe or the LazyBinaryColumnarSerDe.
             It is much faster than the general purpose Hive profile.
-            DELIMITER parameter is mandatory.
+            Supports GPDBWritable output format, as specified in FORMAT header parameter.
         </description>
         <plugins>
             <fragmenter>org.apache.hawq.pxf.plugins.hive.HiveInputFormatFragmenter</fragmenter>
             <accessor>org.apache.hawq.pxf.plugins.hive.HiveORCAccessor</accessor>
             <resolver>org.apache.hawq.pxf.plugins.hive.HiveORCSerdeResolver</resolver>
             <metadata>org.apache.hawq.pxf.plugins.hive.HiveMetadataFetcher</metadata>
+            <outputFormat>org.apache.hawq.pxf.service.io.GPDBWritable</outputFormat>
         </plugins>
     </profile>
     <profile>


[24/51] [abbrv] ambari git commit: AMBARI-19872 : HiveView2.0 : added Upload CSV, JSON, XML to create table feature in the new view (nitirajrathore)

Posted by rz...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js
new file mode 100644
index 0000000..ba3260c
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/databases/database/tables/upload-table.js
@@ -0,0 +1,925 @@
+/**
+ * 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.
+ */
+
+import Ember from 'ember';
+import NewTable from './new';
+import constants from '../../../../utils/constants';
+import Column from '../../../../models/column';
+import datatypes from '../../../../configs/datatypes';
+
+export default NewTable.extend({
+  COLUMN_NAME_REGEX: "^[a-zA-Z]{1}[a-zA-Z0-9_]*$",
+  TABLE_NAME_REGEX: "^[a-zA-Z]{1}[a-zA-Z0-9_]*$",
+  HDFS_PATH_REGEX: "^[/]{1}.+",  // unix path allows everything but here we have to mention full path so starts with /
+  init: function () {
+    this._super();
+  },
+
+  COLUMN_NAME_PREFIX : "column",
+  i18n : Ember.inject.service('i18n'),
+  jobService: Ember.inject.service(constants.services.jobs),
+  notifyService: Ember.inject.service(constants.services.alertMessages),
+  showErrors: false,
+  baseUrl: "/resources/upload",
+  header: null,  // header received from server
+  files: null, // files that need to be uploaded only file[0] is relevant
+  firstRow: [], // the actual first row of the table.
+  rows: null,  // preview rows received from server
+  databaseName: null,
+  selectedDatabase: null,
+  filePath: null,
+  tableName: null,
+  uploadProgressInfos : [],
+  DEFAULT_DB_NAME : 'default',
+  showPreview : false,
+  containsEndlines: false,
+  storedAsTextFile : Ember.computed.equal("selectedFileType","TEXTFILE"),
+  storedAsNotTextFile : Ember.computed.not("storedAsTextFile"),
+  setupController(controller, model) {
+    this._super(controller, model);
+    this.controller.set("showUploadTableModal", false);
+  },
+  onChangeSelectedFileType: function(){
+    if(this.get('selectedFileType') === this.get('fileTypes')[1] && this.get('containsEndlines') === true){
+      this.set('containsEndlines', false);
+    }
+  }.observes("selectedFileType", "containsEndlines"),
+  getUploader(){
+    return this.get('store').adapterFor('upload-table');
+  },
+  onChangeUploadSource : function(){
+    this.clearFields();
+  }.observes("uploadSource"),
+  showCSVFormatInput: false,
+  uploadProgressInfo : Ember.computed("uploadProgressInfos.[]",function(){
+    var info = "";
+    for( var i = 0 ; i < this.get('uploadProgressInfos').length ; i++)
+      info += this.get('uploadProgressInfos').objectAt(i);
+
+    return new Ember.Handlebars.SafeString(info);
+  }),
+  _setHeaderElements : function(header,valueArray){
+    header.forEach(function (item, index) {
+      Ember.set(item, 'name',  valueArray[index]);
+    }, this);
+  },
+  isFirstRowHeaderDidChange: function () {
+    if (this.get('isFirstRowHeader') != null && typeof this.get('isFirstRowHeader') !== 'undefined') {
+      if (this.get('isFirstRowHeader') == false) {
+        if (this.get('rows')) {
+          this.get('rows').unshiftObject({row: this.get('firstRow')});
+          this._setHeaderElements(this.get('header'),this.get('defaultColumnNames'));
+        }
+      } else if (this.get('header')) { // headers are available
+        // take first row of
+        this._setHeaderElements(this.get('header'),this.get('firstRow'));
+        this.get('rows').removeAt(0);
+      }
+
+      this.printValues();
+    }
+  }.observes('isFirstRowHeader'),
+
+  popUploadProgressInfos: function () {
+    // var msg = this.get('uploadProgressInfos').popObject();
+  },
+
+  pushUploadProgressInfos : function(info){
+    this.controller.set("uploadTableMessage", info);
+    this.showUploadModal();
+    // this.get('uploadProgressInfos').pushObject(info);
+  },
+  clearUploadProgressModal : function(){
+    var len = this.get('uploadProgressInfos').length;
+    for( var i = 0 ; i < len ; i++){
+      this.popUploadProgressInfos();
+    }
+  },
+
+  hideUploadModal : function(){
+    this.controller.set("showUploadTableModal", false);
+    this.clearUploadProgressModal();
+  },
+
+  showUploadModal : function(){
+    this.controller.set("showUploadTableModal", true);
+  },
+
+  clearFields: function () {
+    this.set("showPreview",false);
+    this.set("hdfsPath");
+    this.set("header");
+    this.set("rows");
+    this.set("escapedBy");
+    this.set("fieldsTerminatedBy");
+    this.set("error");
+    this.set('files');
+    this.set("firstRow");
+    this.set("selectedDatabase",null);
+    this.set("databaseName");
+    this.set("filePath");
+    this.set('tableName');
+    this.clearUploadProgressModal();
+    this.printValues();
+  },
+
+  printValues: function () {
+    console.log("header : ", this.get('header'),
+      ". rows : ",this.get('rows'),". error : ", this.get('error'),
+      " isFirstRowHeader : ", this.get('isFirstRowHeader'),
+      "firstRow : ", this.get('firstRow'));
+  },
+
+  generateTempTableName: function () {
+    var text = "";
+    var possible = "abcdefghijklmnopqrstuvwxyz";
+
+    for (var i = 0; i < 30; i++)
+      text += possible.charAt(Math.floor(Math.random() * possible.length));
+
+    return text;
+  },
+
+  waitForJobStatus: function (jobId, resolve, reject) {
+    console.log("finding status of job: ", jobId);
+    var self = this;
+    var fetchJobPromise = this.get('jobService').getJob(jobId);
+    fetchJobPromise.then(function (data) {
+      console.log("waitForJobStatus : data : ", data);
+      var job = JSON.parse(JSON.stringify(data));
+      var status = job.status;
+      if (status == constants.statuses.succeeded ) {
+        console.log("resolving waitForJobStatus with : " , status);
+        resolve(job);
+      } else if (status == constants.statuses.canceled || status == constants.statuses.closed || status == constants.statuses.error) {
+        console.log("rejecting waitForJobStatus with : " + status);
+        reject(new Error(job.statusMessage));
+      } else {
+        Ember.run.later(function(){
+          console.log("retrying waitForJobStatus : ", jobId);
+          self.waitForJobStatus(jobId, resolve, reject);
+        }, 2000);
+      }
+    }, function (error) {
+      console.log("rejecting waitForJobStatus with : " + error);
+      reject(error);
+    })
+  },
+
+  uploadForPreview: function (sourceObject) {
+    console.log("uploaderForPreview called.");
+    let files = sourceObject.get("fileInfo.files");
+    let csvParams = sourceObject.get("fileFormatInfo.csvParams");
+
+    return this.getUploader().uploadFiles('preview', files, {
+      "isFirstRowHeader": sourceObject.get("isFirstRowHeader"),
+      "inputFileType": sourceObject.get("fileFormatInfo.inputFileType").id,
+      "csvDelimiter": csvParams.get("csvDelimiter").name,
+      "csvEscape": csvParams.get("csvEscape").name,
+      "csvQuote": csvParams.get("csvQuote").name
+    });
+  },
+
+  getAsciiChar : function(key){
+    if(!key){
+      return null;
+    }
+
+    var value = this.get(key);
+    if(value && value.id != -1) {
+      return String.fromCharCode(value.id);
+    }else{
+      return null;
+    }
+  },
+  getCSVParams : function(){
+    var csvd = this.getAsciiChar('csvDelimiter');
+    if(!csvd && csvd != 0) csvd = this.get('DEFAULT_CSV_DELIMITER');
+
+    var csvq = this.getAsciiChar('csvQuote');
+    if(!csvq && csvq != 0) csvq = this.get('DEFAULT_CSV_QUOTE');
+
+    var csve = this.getAsciiChar('csvEscape');
+    if(!csve && csve != 0) csve = this.get('DEFAULT_CSV_ESCAPE');
+
+    return {"csvDelimiter": csvd, "csvQuote" : csvq, "csvEscape": csve};
+  },
+
+  uploadForPreviewFromHDFS: function (sourceObject) {
+    console.log("uploadForPreviewFromHDFS called.");
+    // this.validateHDFSPath(hdfsPath);
+    var self = sourceObject;
+    var hdfsPath = sourceObject.get("fileInfo.hdfsPath");
+    var csvParams = sourceObject.get("fileFormatInfo.csvParams");
+
+    return this.getUploader().previewFromHDFS({
+      "isFirstRowHeader": sourceObject.get("fileFormatInfo.isFirstRowHeader"),
+      "inputFileType": sourceObject.get("fileFormatInfo.inputFileType").id,
+      "hdfsPath": hdfsPath,
+      "csvDelimiter": csvParams.get("csvDelimiter").name,
+      "csvEscape": csvParams.get("csvEscape").name,
+      "csvQuote": csvParams.get("csvQuote").name
+    });
+  },
+
+  generatePreview: function (sourceObject) {
+    var self = this;
+    var promise = null;
+    try {
+      this.waitForGeneratingPreview();
+      if (sourceObject.get('fileInfo.uploadSource') === "local" ) {
+        promise = this.uploadForPreview(sourceObject);
+      } else {
+        promise = this.uploadForPreviewFromHDFS(sourceObject);
+      }
+
+      return promise.then(function (data) {
+        self.onGeneratePreviewSuccess(data);
+      }, function (error) {
+        self.onGeneratePreviewFailure(error);
+      }).catch(function (error) {
+        console.log("inside catch : ", error);
+      }).finally(function () {
+        console.log("finally hide the modal always after preview.");
+        self.hideUploadModal();
+      });
+    }catch(e){
+      // exception before promise will be caught here.
+      console.log("exception before promise : ", e);
+      self.setError(e);
+    }finally{
+      console.log("finally hide the modal always after preview.");
+      self.hideUploadModal();
+    }
+  },
+
+  waitForGeneratingPreview: function () {
+    console.log("waitForGeneratingPreview");
+    this.showUploadModal();
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.generatingPreview'))
+  },
+
+  previewTable: function (data) {
+    console.log('inside previewTable. data : ', data);
+    var self = this;
+    var defaultColumnNames = data.header.map(function(item,index){
+      return { "name": self.COLUMN_NAME_PREFIX + (index + 1) }
+    });
+    this.set("defaultColumnNames",defaultColumnNames);
+    this.set("previewData", data);
+    this.set("header", this.get("previewData.header"));
+    this.set('isFirstRowHeader', this.get("previewData.isFirstRowHeader"));
+    this.set('tableName', this.get("previewData.tableName"));
+    if (data.isFirstRowHeader == true) {
+      this.set("firstRow", this.get("previewData.header"));
+    }else {
+      if(data.rows.length > 0){
+        this.set("firstRow", this.get("previewData.rows")[0].row);
+      }else{
+        this.set("firstRow", Ember.A());
+      }
+    }
+    this.set("rows", this.get("previewData.rows"));
+    this.controller.set('tableName', this.get("previewData.tableName"));
+    this.controller.set("rows", this.get("previewData.rows"));
+    this.controller.set("columns", this.transformToColumnModelList(this.get("previewData.header")));
+  },
+
+  transformToColumnModelList : function(columns){
+    var _this = this;
+    if(columns){
+      return columns.map(function(column){
+        return _this.transformToColumnModel(column);
+      });
+    }
+    return Ember.A();
+  },
+
+  transformToColumnModel: function (column) {
+    return Column.create({
+      name: column.name,
+      type: datatypes.findBy("label", column.type),
+      editing: true
+    })
+  },
+  onGeneratePreviewSuccess: function (data) {
+    console.log("onGeneratePreviewSuccess");
+    this.set("showPreview",true);
+    this.hideUploadModal();
+    this.previewTable(data);
+  },
+
+  onGeneratePreviewFailure: function (error) {
+    console.log("onGeneratePreviewFailure");
+    this.set("showPreview",false);
+    this.hideUploadModal();
+    this.setError(error);
+  },
+
+  createActualTable: function (tableData) {
+    console.log("createActualTable");
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.startingToCreateActualTable'));
+    var retValue = this.createTable(tableData.get("tableMeta"));
+    return retValue;
+    // var self = this;
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.startingToCreateActualTable'));
+    // var headers = this.get('header');
+    // var selectedDatabase = this.get('selectedDatabase');
+    // if (!selectedDatabase) {
+    //   throw new Error(this.translate('hive.errors.emptyDatabase', {database : this.translate("hive.words.database")}));
+    // }
+    //
+    // this.set('databaseName', this.get('selectedDatabase.id'));
+    // var databaseName = this.get('databaseName');
+    // var tableName = this.get("tableMeta").name;
+    // var isFirstRowHeader = this.get('isFirstRowHeader');
+    // var filetype = this.get("selectedFileType");
+    //
+    // this.validateInput(headers,tableName,databaseName,isFirstRowHeader);
+    // this.showUploadModal();
+    // var rowFormat = this.getRowFormat();
+    // return this.getUploader().createTable({
+    //   "isFirstRowHeader": isFirstRowHeader,
+    //   "header": headers,
+    //   "tableName": tableName,
+    //   "databaseName": databaseName,
+    //   "hiveFileType":filetype,
+    //   "rowFormat": { "fieldsTerminatedBy" : rowFormat.fieldsTerminatedBy, "escapedBy" : rowFormat.escapedBy}
+    // });
+  },
+  getRowFormat : function(){
+    var fieldsTerminatedBy = this.getAsciiChar('fieldsTerminatedBy');
+    var escapedBy = this.getAsciiChar('escapedBy');
+    return {"fieldsTerminatedBy": fieldsTerminatedBy, "escapedBy" : escapedBy};
+  },
+  waitForCreateActualTable: function (jobId) {
+    console.log("waitForCreateActualTable");
+    this.popUploadProgressInfos();
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.waitingToCreateActualTable'));
+    var self = this;
+    var p = new Ember.RSVP.Promise(function (resolve, reject) {
+      self.waitForJobStatus(jobId, resolve, reject);
+    });
+
+    return p;
+  },
+  onCreateActualTableSuccess: function () {
+    console.log("onCreateTableSuccess");
+    this.popUploadProgressInfos();
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.successfullyCreatedActualTable'));
+  },
+  onCreateActualTableFailure: function (error) {
+    console.log("onCreateActualTableFailure");
+    this.popUploadProgressInfos();
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.failedToCreateActualTable'));
+    this.setError(error);
+  },
+  createTempTable: function (tableData) {
+    let tableMeta = JSON.parse(JSON.stringify(tableData.get("tableMeta")));
+    // manually copy the columns as they are missing members when copying
+    let columns = tableData.get("tableMeta").columns.map(function(col){
+      return col.copy();
+    });
+    tableMeta.columns = columns;
+
+    console.log("tableMeta : ", tableMeta);
+
+    var self = this;
+    console.log("createTempTable");
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.startingToCreateTemporaryTable'));
+    var tempTableName = this.generateTempTableName();
+    tableMeta.name = tempTableName;
+
+    var headers = tableMeta.columns.map(function(column){
+      if(tableData.fileFormatInfo.containsEndlines){
+        column.type.label = "STRING";
+        delete column.scale;
+        delete column.precision;
+      }
+      return column;
+    });
+
+    tableMeta.columns = headers;
+    tableMeta.settings = {};
+    tableMeta.properties = [];
+    tableMeta.settings.fileFormat = {};
+    tableMeta.settings.fileFormat.type = "TEXTFILE";
+    this.set("tableData.tempTableMeta", tableMeta);
+    return this.createTable(tableMeta);
+    // return this.getUploader().createTable({
+    //   "isFirstRowHeader": this.get("isFirstRowHeader"),
+    //   "header": headers,
+    //   "tableName": tempTableName,
+    //   "databaseName": this.get('databaseName'),
+    //   "hiveFileType":"TEXTFILE",
+    //   "rowFormat": { "fieldsTerminatedBy" : parseInt('1', 10), "escapedBy" : null}
+    // });
+  },
+
+  waitForCreateTempTable: function (jobId) {
+    console.log("waitForCreateTempTable");
+    this.popUploadProgressInfos();
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.waitingToCreateTemporaryTable'));
+    var self = this;
+    var p = new Ember.RSVP.Promise(function (resolve, reject) {
+      self.waitForJobStatus(jobId, resolve, reject);
+    });
+
+    return p;
+  },
+
+  onCreateTempTableSuccess: function () {
+    console.log("onCreateTempTableSuccess");
+    this.popUploadProgressInfos();
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.successfullyCreatedTemporaryTable'));
+  },
+
+  deleteTable : function(databaseName, tableName){
+    console.log("deleting table ", databaseName , "." , tableName);
+    return this.getUploader().deleteTable({
+      "database":  databaseName,
+      "table": tableName
+    });
+  },
+
+  deleteTableOnError: function (databaseName, tableName, tableLabel) {
+    //delete table and wait for delete job
+    var self = this;
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.deletingTable',{table:tableLabel}));
+
+    return this.deleteTable(databaseName, tableName).then(function (job) {
+      return new Ember.RSVP.Promise(function (resolve, reject) {
+        self.waitForJobStatus(job.id, resolve, reject);
+      });
+    }).then(function () {
+      self.popUploadProgressInfos();
+      self.pushUploadProgressInfos(this.formatMessage('hive.messages.succesfullyDeletedTable',{table:tableLabel}));
+      return Ember.RSVP.Promise.resolve();
+    }, function (err) {
+      self.popUploadProgressInfos();
+      self.pushUploadProgressInfos(this.formatMessage('hive.messages.failedToDeleteTable',{table:tableLabel}));
+      self.setError(err);
+      return Ember.RSVP.Promise.reject();
+    });
+  },
+
+  rollBackActualTableCreation : function(){
+    return this.deleteTableOnError(this.get("database"),this.get("tableMeta").name,this.translate('hive.words.actual'));
+  },
+
+  translate : function(str,vars){
+    return this.get('i18n').t(str,vars);
+  },
+  formatMessage : function(messageId, vars){
+    return this.translate(messageId, vars);
+  },
+  onCreateTempTableFailure : function(error){
+    console.log("onCreateTempTableFailure");
+    this.setError(error);
+    this.popUploadProgressInfos();
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.failedToCreateTemporaryTable'));
+    return this.rollBackActualTableCreation().then(function(data){
+      return Ember.RSVP.Promise.reject(error); // always reject for the flow to stop
+    }, function (err) {
+      return Ember.RSVP.Promise.reject(error); // always reject for the flow to stop
+    });
+  },
+
+  uploadFile: function (tableData) {
+    console.log("uploadFile");
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.startingToUploadFile'));
+    let uploadSource = tableData.get("fileInfo").get("uploadSource");
+    if(uploadSource === "local"){
+      return this.uploadTable(tableData);
+    }else{
+      return this.uploadTableFromHdfs(tableData);
+    }
+  },
+
+  waitForUploadingFile: function (data) {
+    console.log("waitForUploadingFile");
+    this.popUploadProgressInfos();
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.waitingToUploadFile'));
+    if( data.jobId ){
+      var self = this;
+      var p = new Ember.RSVP.Promise(function (resolve, reject) {
+        self.waitForJobStatus(data.jobId, resolve, reject);
+      });
+      return p;
+    }else{
+      return  Ember.RSVP.Promise.resolve(data);
+    }
+  },
+
+  onUploadingFileSuccess: function () {
+    console.log("onUploadingFileSuccess");
+    this.popUploadProgressInfos();
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.successfullyUploadedFile') );
+  },
+
+  rollBackTempTableCreation: function () {
+    var self = this;
+    return this.deleteTableOnError(this.get("database"),this.get("tempTableMeta").name,this.translate('hive.words.temporary')).then(function(data){
+      return self.rollBackActualTableCreation();
+    },function(err){
+      return self.rollBackActualTableCreation();
+    })
+  },
+
+  onUploadingFileFailure: function (error) {
+    console.log("onUploadingFileFailure");
+    this.setError(error);
+    this.popUploadProgressInfos();
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.failedToUploadFile'));
+    return this.rollBackTempTableCreation().then(function(data){
+      return Ember.RSVP.Promise.reject(error); // always reject for the flow to stop
+    },function(err){
+      return Ember.RSVP.Promise.reject(error); // always reject for the flow to stop
+    });
+  },
+
+  rollBackUploadFile : function(){
+    return this.rollBackTempTableCreation();
+  },
+
+  insertIntoTable : function(tableData){
+    console.log("insertIntoTable");
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.startingToInsertRows'));
+
+    let headers = tableData.get("tableMeta").columns.map(function(column){
+        var header = JSON.parse(JSON.stringify(column));
+        header.type = column.type.label;
+        return header;
+    });
+
+    return this.getUploader().insertIntoTable({
+      "fromDatabase": tableData.get("database"),
+      "fromTable": tableData.get("tempTableMeta").name,
+      "toDatabase": tableData.get("database"),
+      "toTable": tableData.get("tableMeta").name,
+      "header": headers,
+      "unhexInsert": tableData.fileFormatInfo.containsEndlines
+    });
+  },
+
+  waitForInsertIntoTable: function (jobId) {
+    console.log("waitForInsertIntoTable");
+    this.popUploadProgressInfos();
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.waitingToInsertRows'));
+    var self = this;
+    var p = new Ember.RSVP.Promise(function (resolve, reject) {
+      self.waitForJobStatus(jobId, resolve, reject);
+    });
+
+    return p;
+  },
+
+  onInsertIntoTableSuccess: function () {
+    console.log("onInsertIntoTableSuccess");
+    this.popUploadProgressInfos();
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.successfullyInsertedRows'));
+  },
+
+  onInsertIntoTableFailure: function (error) {
+    console.log("onInsertIntoTableFailure");
+    this.setError(error);
+    this.popUploadProgressInfos();
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.failedToInsertRows'));
+    return this.rollBackUploadFile().then(function(data){
+      return Ember.RSVP.Promise.reject(error); // always reject for the flow to stop
+    },function(err){
+      return Ember.RSVP.Promise.reject(error); // always reject for the flow to stop
+    });
+  },
+  deleteTempTable : function(tableData){
+    console.log("deleteTempTable");
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.startingToDeleteTemporaryTable'));
+
+    return this.deleteTable(
+      tableData.get("database"),
+      tableData.get("tempTableMeta").name
+    );
+  },
+  waitForDeleteTempTable: function (jobId) {
+    console.log("waitForDeleteTempTable");
+    this.popUploadProgressInfos();
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.waitingToDeleteTemporaryTable'));
+    var self = this;
+    var p = new Ember.RSVP.Promise(function (resolve, reject) {
+      self.waitForJobStatus(jobId, resolve, reject);
+    });
+
+    return p;
+  },
+  onDeleteTempTableSuccess: function () {
+    console.log("onDeleteTempTableSuccess");
+    this.popUploadProgressInfos();
+    this.pushUploadProgressInfos(this.formatMessage('hive.messages.successfullyDeletedTemporaryTable'));
+    this.onUploadSuccessfull();
+  },
+  onDeleteTempTableFailure: function (error) {
+    console.log("onDeleteTempTableFailure");
+    this.setError(error);
+    this.setError(this.formatMessage('hive.messages.manuallyDeleteTable',{databaseName:this.get('databaseName'), tableName: this.get("tempTableName")}));
+  },
+  validateHDFSPath: function (hdfsPath) {
+    if (null == hdfsPath || hdfsPath == "") throw new Error(this.translate('hive.errors.emptyHdfsPath'));
+    var hdfsRegex = new RegExp(this.get("HDFS_PATH_REGEX"), "g");
+    var mArr = hdfsPath.match(hdfsRegex);
+    if (mArr == null || mArr.length != 1) throw new Error(this.translate('hive.errors.illegalHdfPath', {"hdfsPath": hdfsPath} ));
+  },
+  createTableAndUploadFile: function (tableData) {
+    let databaseModel = this.controllerFor('databases.database').get('model');
+    let database = databaseModel.get('name');
+    tableData.set("database", database);
+    this.set("tableData", tableData);
+
+    var self = this;
+    self.setError();
+    self.createActualTable(tableData)
+      .then(function(job){
+        console.log("1. received job : ", job);
+        return self.waitForCreateActualTable(job.id);
+      },function(error){
+        console.log("Error occurred: ", error);
+        self.onCreateActualTableFailure(error);
+        throw error;
+      })
+      .then(function(data){
+        self.onCreateActualTableSuccess(data);
+        return self.createTempTable(tableData);
+      },function(error){
+        if(!self.get('error')){
+          console.log("Error occurred: ", error);
+          self.onCreateActualTableFailure(error);
+        }
+        throw error;
+      })
+      .then(function(job){
+        return self.waitForCreateTempTable(job.id);
+      },function(error){
+        if(!self.get('error')){
+          console.log("Error occurred: ", error);
+          return self.onCreateTempTableFailure(error);
+        }
+        throw error;
+      })
+      .then(function(data){
+        self.onCreateTempTableSuccess(data);
+        return self.uploadFile(tableData);
+      },function(error){
+        if(!self.get('error')){
+          console.log("Error occurred: ", error);
+          return self.onCreateTempTableFailure(error);
+        }
+        throw error;
+      }).then(function(data){
+      return self.waitForUploadingFile(data);
+    },function(error){
+      if(!self.get('error')){
+        console.log("Error occurred: ", error);
+        return self.onUploadingFileFailure(error);
+      }
+      throw error;
+    })
+      .then(function(data){
+        self.onUploadingFileSuccess(data);
+        return self.insertIntoTable(tableData);
+      },function(error){
+        if(!self.get('error')){
+          console.log("Error occurred: ", error);
+          return self.onUploadingFileFailure(error);
+        }
+        throw error;
+      })
+      .then(function(job){
+        return self.waitForInsertIntoTable(job.id);
+      },function(error){
+        if(!self.get('error')){
+          console.log("Error occurred: ", error);
+          return self.onInsertIntoTableFailure(error);
+        }
+        throw error;
+      })
+      .then(function(data){
+        self.onInsertIntoTableSuccess(data);
+        return self.deleteTempTable(tableData);
+      },function(error){
+        if(!self.get('error')){
+          console.log("Error occurred: ", error);
+          return self.onInsertIntoTableFailure(error);
+        }
+        throw error;
+      })
+      .then(function(job){
+        return self.waitForDeleteTempTable(job.id);
+      },function(error){
+        if(!self.get('error')){
+          console.log("Error occurred: ", error);
+          self.onDeleteTempTableFailure(error);
+        }
+        throw error;
+      })
+      .then(function(data){
+        self.onDeleteTempTableSuccess(data);
+      },function(error){
+        if(!self.get('error')){
+          console.log("Error occurred: ", error);
+          self.onDeleteTempTableFailure(error);
+        }
+        throw error;
+      })
+      .catch(function(error){
+        console.log("inside catch : ", error);
+      })
+      .finally(function(){
+        console.log("finally hide the modal always");
+        self.hideUploadModal();
+      });
+  },
+  validateInput: function (headers,tableName,databaseName,isFirstRowHeader) {
+    // throw exception if invalid.
+    if(!headers || headers.length == 0) throw new Error(this.translate('hive.errors.emptyHeaders'));
+
+    var regex = new RegExp(this.get("COLUMN_NAME_REGEX"),"g");
+
+    headers.forEach(function(column,index){
+      if( !column  ) throw new Error(this.translate('hive.errors.emptyColumnName'));
+      var matchArr = column.name.match(regex);
+      if(matchArr == null || matchArr.length != 1 ) throw new Error(this.translate('hive.errors.illegalColumnName',{ columnName : column.name, index : (index + 1)}));
+    },this);
+
+    if(!tableName) throw new Error(this.translate('hive.errors.emptyTableName', {tableNameField : this.translate('hive.ui.tableName')}));
+    var tableRegex = new RegExp(this.get("TABLE_NAME_REGEX"),"g");
+    var mArr = tableName.match(tableRegex);
+    if(mArr == null || mArr.length != 1 ) throw new Error(this.translate('hive.errors.illegalTableName', {tableNameField:this.translate('hive.ui.tableName'),tableName:tableName}) );
+
+    if(!databaseName) throw new Error(this.translate('hive.errors.emptyDatabase', {database:this.translate('hive.words.database')}));
+
+    if (null == isFirstRowHeader || typeof isFirstRowHeader === 'undefined') { //this can be true or false. so explicitly checking for null/ undefined.
+      throw new Error(this.translate('hive.errors.emptyIsFirstRow', {isFirstRowHeaderField:this.translate('hive.ui.isFirstRowHeader')}));
+    }
+  },
+  setError: function (error) {
+    if(error){
+      console.log(" error : ", error);
+      this.set('error', JSON.stringify(error));
+      // this.get('notifyService').warn(error);
+      // TODO : add notifyService warn message.
+      console.log("TODO : add notifyService warn message.");
+    }else{
+      this.set("error");
+    }
+  },
+  previewError: function (error) {
+    this.setError(error);
+  },
+  uploadTableFromHdfs : function(tableData){
+    console.log("uploadTableFromHdfs called.");
+    // if(!(this.get("inputFileTypeCSV") == true && this.get("isFirstRowHeader") == false) ){
+      this.pushUploadProgressInfos(this.formatMessage('uploadingFromHdfs'));
+    // }
+    var csvParams = tableData.get("fileFormatInfo.csvParams");
+    let columns = tableData.get("tableMeta").columns.map(function(column){
+      return {"name": column.get("name"), "type": column.get("type.label")};
+    });
+    let header = columns; //JSON.stringify(columns);
+
+    return this.getUploader().uploadFromHDFS({
+      "isFirstRowHeader": tableData.get("fileFormatInfo.isFirstRowHeader"),
+      "databaseName": tableData.get("database"),
+      "tableName": tableData.get("tempTableMeta").name,
+      "inputFileType": tableData.get("fileFormatInfo.inputFileType").id,
+      "hdfsPath": tableData.get("fileInfo.hdfsPath"),
+      "header": header,
+      "containsEndlines": tableData.get("fileFormatInfo.containsEndlines"),
+      "csvDelimiter": csvParams.get("csvDelimiter").name,
+      "csvEscape": csvParams.get("csvEscape").name,
+      "csvQuote": csvParams.get("csvQuote").name
+    });
+  },
+  uploadTable: function (tableData) {
+    this.printValues();
+    var csvParams = tableData.get("fileFormatInfo.csvParams");
+    let columns = tableData.get("tableMeta").columns.map(function(column){
+      return {"name": column.get("name"), "type": column.get("type.label")};
+    });
+    let header = JSON.stringify(columns);
+    return this.getUploader().uploadFiles('upload', tableData.get("fileInfo.files"), {
+      "isFirstRowHeader": tableData.get("fileFormatInfo.isFirstRowHeader"),
+      "databaseName" :  tableData.get("database"),
+      "tableName" : tableData.get("tempTableMeta").name,
+      "inputFileType" : tableData.get("fileFormatInfo.inputFileType").id,
+      "header": header,
+      "containsEndlines": tableData.get("fileFormatInfo.containsEndlines"),
+      "csvDelimiter": csvParams.get("csvDelimiter").name,
+      "csvEscape": csvParams.get("csvEscape").name,
+      "csvQuote": csvParams.get("csvQuote").name
+    });
+  },
+
+  onUploadSuccessfull: function (data) {
+    console.log("onUploadSuccessfull : ", data);
+    this._transitionToCreatedTable(this.get("tableData").get('database'), this.get("tableData").get('tableMeta').name);
+
+    // this.get('notifyService').success(this.translate('hive.messages.successfullyUploadedTableHeader'),
+    //   this.translate('hive.messages.successfullyUploadedTableMessage' ,{tableName:this.get("tableData").get("tableMeta").name ,databaseName:this.get("tableData").get("database")}));
+    this.clearFields();
+  },
+
+  onUploadError: function (error) {
+    console.log("onUploadError : ", error);
+    this.setError(error);
+  },
+  showOrHide: function () {
+    if (this.get('show') == false) {
+      this.set("displayOption", "display:none");
+      this.set("showMoreOrLess", "Show More");
+    } else {
+      this.set("displayOption", "display:table-row");
+      this.set("showMoreOrLess", "Show Less");
+    }
+  },
+
+  displayOption: "display:none",
+  actions: {
+  toggleCSVFormat: function() {
+    console.log("inside toggleCSVFormat");
+    this.toggleProperty('showCSVFormatInput');
+  },
+  hideInputParamModal : function(){
+      Ember.$("#inputParamsModal").modal("hide");
+    },
+    showInputParamModal : function(){
+      if(this.get('inputFileTypeCSV')){
+        Ember.$("#inputParamsModal").modal("show");
+      }
+    },
+    hideRowFormatModal : function(){
+      Ember.$("#rowFormatModal").modal("hide");
+    },
+    showRowFormatModal : function(){
+      if(this.get('storedAsTextFile')) {
+        Ember.$("#rowFormatModal").modal("show");
+      }
+    },
+    toggleErrors: function () {
+      this.toggleProperty('showErrors');
+    },
+    // filesUploaded: function (files) {
+    //   console.log("upload-table.js : uploaded new files : ", files);
+    //   this.clearFields();
+    //
+    //   this.set('files', files);
+    //   var name = files[0].name;
+    //   var i = name.indexOf(".");
+    //   var tableName = name.substr(0, i);
+    //   this.set('tableName', tableName);
+    //   var self = this;
+    //   return this.generatePreview(sourceObject)
+    // },
+    preview: function (previewObject) {
+      console.log("upload-table.js : uploaded new files : ", previewObject);
+      this.clearFields();
+
+      this.set('previewObject', previewObject);
+      // var name = previewObject.get("fileInfo").get("files")[0].name;
+      // var i = name.indexOf(".");
+      // var tableName = name.substr(0, i);
+      // this.set('tableName', tableName);
+      // var self = this;
+      return this.generatePreview(previewObject)
+    },
+    previewFromHdfs: function () {
+      return this.generatePreview();
+    },
+    uploadTable: function (tableData) {
+      console.log("tableData", tableData);
+      try {
+        this.createTableAndUploadFile(tableData);
+      } catch (e) {
+        console.log("exception occured : ", e);
+        this.setError(e);
+        this.hideUploadModal();
+      }
+    },
+    uploadFromHDFS: function () {
+      this.set("isLocalUpload", false);
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js b/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js
index 453eb12..8503715 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/services/jobs.js
@@ -66,4 +66,7 @@ export default Ember.Service.extend({
     this.get('store').adapterFor('job').fetchResult(jobId);
   },
 
+  getJob: function (jobId) {
+    return this.get('store').findRecord('job', jobId, {reload: true})
+  }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js b/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
index 2a0aeed..e442a36 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/services/table-operations.js
@@ -35,7 +35,7 @@ export default Ember.Service.extend({
       detailedInfo: detailedInfo,
       storageInfo: storageInfo
     });
-    return new Promise((resolve, reject) => {
+    return new Ember.RSVP.Promise((resolve, reject) => {
       this.get('store').adapterFor('table').createTable(tableInfo).then((data) => {
         this.get('store').pushPayload(data);
         resolve(this.get('store').peekRecord('job', data.job.id));
@@ -46,7 +46,7 @@ export default Ember.Service.extend({
   },
 
   deleteTable(database, table) {
-    return new Promise((resolve, reject) => {
+    return new Ember.RSVP.Promise((resolve, reject) => {
       this.get('store').adapterFor('table').deleteTable(database, table).then((data) => {
         this.get('store').pushPayload(data);
         resolve(this.get('store').peekRecord('job', data.job.id));

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/templates/components/csv-format-params.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/csv-format-params.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/csv-format-params.hbs
new file mode 100644
index 0000000..a7cb862
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/csv-format-params.hbs
@@ -0,0 +1,118 @@
+{{!
+* 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.
+}}
+
+<div class="panel panel-info">
+  <div class="panel-heading">
+    <div class="panel-title">
+      <button class="btn btn-primary {{if showCSVFormatInput 'active'}}" {{action
+      "toggleCSVFormat"}}>
+      {{fa-icon (if showCSVFormatInput "minus" "plus")}}
+      </button>
+      &nbsp;&nbsp;&nbsp;Select File Format
+    </div>
+  </div>
+  {{#if showCSVFormatInput}}
+  <div class="panel-body rowformat-custom-row">
+    <div class="row">
+      <div class="col-md-6 form-horizontal">
+        <div class="form-group">
+          <label class="col-md-4 control-label">{{t 'hive.ui.fileSource.fileType'}}</label>
+          <div class="col-md-7">
+            {{#power-select
+            selected=fileFormatInfo.inputFileType
+            options=inputFileTypes
+            searchField="name"
+            searchPlaceholder=(t 'hive.ui.fileSource.selectFileType')
+            onchange=(action "inputFileTypeSelected") as |parameter|}}
+            {{parameter.name}}{{#if parameter.description}} - {{parameter.description}}{{/if}}
+            {{/power-select}}
+          </div>
+          <div class="col-md-1">
+            <a class="text-danger" {{action "clearInputFileType"}}>{{fa-icon "times" size="lg"}}</a>
+          </div>
+        </div>
+      </div>
+    </div>
+    {{#if inputFileTypeCSV}}
+
+    <div class="row">
+      <div class="col-md-6 form-horizontal">
+        <div class="form-group">
+          <label class="col-md-4 control-label">{{t 'hive.ui.csvFormatParams.columnDelimterField'}}</label>
+          <div class="col-md-7">
+            {{#power-select
+            selected=fileFormatInfo.csvParams.csvDelimiter
+            options=terminationChars
+            searchField="name"
+            searchPlaceholder=(t 'hive.ui.csvFormatParams.columnDelimiterTooltip')
+            onchange=(action "csvDelimiterSelected") as |parameter|}}
+            {{parameter.name}}{{#if parameter.description}} - {{parameter.description}}{{/if}}
+            {{/power-select}}
+          </div>
+          <div class="col-md-1">
+            <a class="text-danger" {{action "clearColumnDelimter"}}>{{fa-icon "times" size="lg"}}</a>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="row">
+      <div class="col-md-6 form-horizontal">
+        <div class="form-group">
+          <label class="col-md-4 control-label">{{t 'hive.ui.csvFormatParams.escapeCharacterField'}}</label>
+          <div class="col-md-7">
+            {{#power-select
+            selected=fileFormatInfo.csvParams.csvEscape
+            options=terminationChars
+            searchField="name"
+            searchPlaceholder=(t 'hive.ui.csvFormatParams.escapeCharacterTooltip')
+            onchange=(action "csvEscapeSelected") as |parameter|}}
+            {{parameter.name}}{{#if parameter.description}} - {{parameter.description}}{{/if}}
+            {{/power-select}}
+          </div>
+          <div class="col-md-1">
+            <a class="text-danger" {{action "clearEscapeCharacter"}}>{{fa-icon "times" size="lg"}}</a>
+          </div>
+        </div>
+      </div>
+    </div>
+    <div class="row">
+      <div class="col-md-6 form-horizontal">
+        <div class="form-group">
+          <label class="col-md-4 control-label">{{t 'hive.ui.csvFormatParams.quoteCharacterField'}}</label>
+          <div class="col-md-7">
+            {{#power-select
+            selected=fileFormatInfo.csvParams.csvQuote
+            options=terminationChars
+            searchField="name"
+            searchPlaceholder=(t 'hive.ui.csvFormatParams.quoteCharacterTooltip')
+            onchange=(action "csvQuoteSelected") as |parameter|}}
+            {{parameter.name}}{{#if parameter.description}} - {{parameter.description}}{{/if}}
+            {{/power-select}}
+          </div>
+          <div class="col-md-1">
+            <a class="text-danger" {{action "clearCsvQuote"}}>{{fa-icon "times" size="lg"}}</a>
+          </div>
+        </div>
+      </div>
+    </div>
+    {{/if}}
+  </div>
+  {{/if}}
+</div>
+
+{{yield}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/templates/components/radio-button.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/radio-button.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/radio-button.hbs
new file mode 100644
index 0000000..6ae472f
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/radio-button.hbs
@@ -0,0 +1,19 @@
+{{!
+* 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.
+}}
+
+{{yield}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/templates/components/simple-table.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/simple-table.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/simple-table.hbs
new file mode 100644
index 0000000..1a76cc6
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/simple-table.hbs
@@ -0,0 +1,42 @@
+{{!
+* 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.
+}}
+
+<div>
+  <table class="table table-expandable no-border">
+    <thead>
+    <tr>
+      {{#each header as |column|}}
+      <th>
+        {{column.name}}
+      </th>
+      {{/each}}
+    </tr>
+    </thead>
+    <tbody>
+    {{#each rows as |row|}}
+    <tr>
+      {{#each row.row as |item|}}
+      <td>{{item}}</td>
+      {{/each}}
+    </tr>
+    {{/each}}
+    </tbody>
+  </table>
+</div>
+
+{{yield}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/templates/components/upload-table-source.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/upload-table-source.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/upload-table-source.hbs
new file mode 100644
index 0000000..c8e57e7
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/upload-table-source.hbs
@@ -0,0 +1,112 @@
+{{!
+* 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.
+}}
+
+<div class="panel panel-info">
+  <div class="panel-heading">
+    <div class="panel-title">
+      <button class="btn btn-primary {{if showFileSourceInput 'active'}}" {{action
+      "toggleFileSource"}}>
+      {{fa-icon (if showFileSourceInput "minus" "plus")}}
+      </button>
+      &nbsp;&nbsp;&nbsp;Select File Source
+    </div>
+  </div>
+  {{#if showFileSourceInput}}
+  <div class="panel-body rowformat-custom-row">
+    <div class="row">
+      <div class="col-md-12 form-horizontal">
+        <div class="form-group">
+          <label class="col-md-3 control-label">{{t 'hive.ui.fileSource.uploadFromHdfs'}}</label>
+          <div class="col-md-3">
+            {{radio-button value='hdfs' checked=fileInfo.uploadSource}}
+          </div>
+          <label class="col-md-3 control-label">{{t 'hive.ui.fileSource.uploadFromLocal'}}</label>
+          <div class="col-md-3">
+            {{radio-button value='local' checked=fileInfo.uploadSource}}
+          </div>
+        </div>
+      </div>
+    </div>
+
+    {{#if showHdfsLocationInput}}
+    <div class="panel-body">
+      <div class="row">
+        <div class="col-md-12 form-horizontal">
+          <div class="form-group">
+            <label class="col-md-3 control-label">{{t 'hive.ui.fileSource.enterHdfsPathLabel'}}</label>
+            <div class="col-md-6">
+              {{input type="text" class="form-control" value=fileInfo.hdfsPath}}
+            </div>
+          </div>
+        </div>
+
+        <!--
+        <button class="btn btn-success" {{action
+        "toggleDirectoryViewer"}}>{{t 'hive.ui.fileSource.selectHdfsLocation'}}</button>
+        -->
+      </div>
+      <!--
+      {{#if showDirectoryViewer}}
+      {{hdfs-viewer-modal
+      showSelectedPath=true
+      close="closeHdfsModal"
+      selected="hdfsPath"
+      }}
+      {{/if}}
+      -->
+    </div>
+    {{/if}}
+
+    {{#if showLocalLocationInput}}
+    <div class="panel-body">
+      <div class="row">
+        <div class="col-md-12 form-horizontal">
+          <div class="form-group">
+            <label class="col-md-3 control-label">{{t 'hive.ui.fileSource.selectLocalFileLabel'}}</label>
+            <div class="col-md-6">
+              {{#file-picker fileLoaded="onFileChanged" preview=false}}
+              <div class="text-center vert-align-middle">
+                {{fa-icon "cloud-upload" size="4"}}
+                <h4> Drag file to upload or click to browse</h4>
+              </div>
+              {{/file-picker}}
+            </div>
+          </div>
+        </div>
+
+        <!--
+        <button class="btn btn-success" {{action
+        "toggleDirectoryViewer"}}>{{t 'hive.ui.fileSource.selectHdfsLocation'}}</button>
+        -->
+      </div>
+      <!--
+      {{#if showDirectoryViewer}}
+      {{hdfs-viewer-modal
+      showSelectedPath=true
+      close="closeHdfsModal"
+      selected="hdfsPath"
+      }}
+      {{/if}}
+      -->
+    </div>
+    {{/if}}
+  </div>
+  {{/if}}
+</div>
+
+{{yield}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/templates/components/upload-table.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/upload-table.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/upload-table.hbs
new file mode 100644
index 0000000..e4388f0
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/upload-table.hbs
@@ -0,0 +1,59 @@
+{{!
+* 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.
+}}
+
+<div class="table-body">
+  {{csv-format-params fileFormatInfo=fileFormatInfo}}
+</div>
+
+<div class="table-body">
+  {{upload-table-source onFileChanged='onFileChanged' fileInfo=fileInfo}}
+</div>
+
+
+<div class="create-table-controls">
+  <button class="btn btn-success" {{action
+  "preview"}}>{{fa-icon "eye"}} Preview</button>
+</div>
+
+<div class="table-body">
+  <div class="panel panel-info">
+    <div class="panel-heading">
+      <div class="panel-title">
+        <button class="btn btn-primary {{if showPreview 'active'}}" {{action
+        "toggleShowPreview"}}>
+        {{fa-icon (if showPreview "minus" "plus")}}
+        </button>
+        &nbsp;&nbsp;&nbsp;Table Preview
+      </div>
+    </div>
+    {{#if showPreview}}
+    {{simple-table header=columns rows=rows }}
+    {{/if}}
+  </div>
+</div>
+
+
+<div class="col-md-12 table-info">
+  <div class="table-body">
+    {{create-table tabs=tabs
+    cancel="cancel"
+    create="createAndUpload" columns=columns tableName=tableName }}
+  </div>
+</div>
+
+{{yield}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/templates/components/validated-text-field.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/validated-text-field.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/validated-text-field.hbs
new file mode 100644
index 0000000..7cf0fcf
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/validated-text-field.hbs
@@ -0,0 +1,23 @@
+{{!
+* 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.
+}}
+
+{{!
+* see example in validated-text-field.js component file
+}}
+
+{{input class=inputClass value=inputValue title=message placeholder=placeholder}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/new.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/new.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/new.hbs
index 39b7a9e..4f3b98a 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/new.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/new.hbs
@@ -32,7 +32,11 @@
     {{/modal-dialog}}
   {{/if}}
   <div class="table-header row">
-    <p class="text-uppercase">table<strong>&nbsp;&nbsp;>&nbsp;&nbsp;create table</strong></p>
+    <p class="text-uppercase">table<strong>&nbsp;&nbsp;>&nbsp;&nbsp;create table</strong>
+    <div class="pull-right">
+    {{#link-to "databases.database.tables.upload-table" }}<p class="text-uppercase">{{fa-icon "upload"}}&nbsp;upload table</p>{{/link-to}}
+    </div>
+  </p>
   </div>
   <div class="table-body">
     {{create-table tabs=tabs

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/upload-table.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/upload-table.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/upload-table.hbs
new file mode 100644
index 0000000..0091ede
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/databases/database/tables/upload-table.hbs
@@ -0,0 +1,45 @@
+{{!
+* 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.
+}}
+<div class="col-md-12 table-info">
+
+<div class="table-body">
+  <div class="table-header row">
+    <p class="text-uppercase">table<strong>&nbsp;&nbsp;>&nbsp;&nbsp;upload table</strong></p>
+  </div>
+</div>
+
+<div class="col-md-12 table-info">
+{{#if showUploadTableModal}}
+{{#modal-dialog
+translucentOverlay=true
+container-class="modal-dialog modal-sm"}}
+<div class="modal-content">
+  <div class="modal-header text-danger">
+    <p class="modal-title">{{fa-icon "plus"}}&nbsp;&nbsp;&nbsp; Upload Table</p>
+  </div>
+  <div class="modal-body text-center text-primary">
+    <p>{{uploadTableMessage}}</p>
+  </div>
+</div><!-- /.modal-content -->
+{{/modal-dialog}}
+{{/if}}
+</div>
+
+{{upload-table tabs=tabs columns=columns rows=rows tableName=tableName tableMeta=tableMeta cancel="cancel" createAndUpload="uploadTable" preview="preview"}}
+</div>
+{{yield}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/app/utils/constants.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/utils/constants.js b/contrib/views/hive20/src/main/resources/ui/app/utils/constants.js
new file mode 100644
index 0000000..5405773
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/utils/constants.js
@@ -0,0 +1,64 @@
+/**
+ * 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.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Object.create({
+  /**
+   * This should reflect the naming conventions accross the application.
+   * Changing one value also means changing the filenames for the chain of files
+   * represented by that value (routes, controllers, models etc).
+   * This dependency goes both ways.
+  */
+  namingConventions: {
+    routes: {
+    },
+
+    subroutes: {
+    },
+
+    job: 'job'
+  },
+
+  services: {
+    alertMessages: 'alert-messages',
+    jobs: 'jobs',
+  },
+
+  jobReferrer: {
+    sample: 'SAMPLE',
+    explain: 'EXPLAIN',
+    visualExplain: 'VISUALEXPLAIN',
+    job: 'JOB',
+    user: 'USER',
+    internal: 'INTERNAL'
+  },
+
+  statuses: {
+    unknown: "UNKNOWN",
+    initialized: "INITIALIZED",
+    running: "RUNNING",
+    succeeded: "SUCCEEDED",
+    canceled: "CANCELED",
+    closed: "CLOSED",
+    error: "ERROR",
+    failed: 'FAILED',
+    killed: 'KILLED',
+    pending: "PENDING"
+  },
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/bower.json
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/bower.json b/contrib/views/hive20/src/main/resources/ui/bower.json
index 4eadee7..a4ce788 100644
--- a/contrib/views/hive20/src/main/resources/ui/bower.json
+++ b/contrib/views/hive20/src/main/resources/ui/bower.json
@@ -6,6 +6,7 @@
     "ember-qunit-notifications": "0.1.0",
     "font-awesome": "~4.5.0",
     "codemirror": "~5.15.0",
-    "bootstrap-treeview": "~1.2.0"
+    "bootstrap-treeview": "~1.2.0",
+    "blob": "*"
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/config/environment.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/config/environment.js b/contrib/views/hive20/src/main/resources/ui/config/environment.js
index 9efd491..98b3c8c 100644
--- a/contrib/views/hive20/src/main/resources/ui/config/environment.js
+++ b/contrib/views/hive20/src/main/resources/ui/config/environment.js
@@ -60,5 +60,9 @@ module.exports = function(environment) {
 
   }
 
+  ENV.i18n = {
+    defaultLocale: 'en'
+  };
+
   return ENV;
 };

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/main/resources/ui/package.json
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/package.json b/contrib/views/hive20/src/main/resources/ui/package.json
index ed7a299..a066bfd 100644
--- a/contrib/views/hive20/src/main/resources/ui/package.json
+++ b/contrib/views/hive20/src/main/resources/ui/package.json
@@ -30,6 +30,7 @@
     "ember-cli-babel": "^5.1.6",
     "ember-cli-daterangepicker": "0.3.0",
     "ember-cli-dependency-checker": "^1.2.0",
+    "ember-cli-file-picker": "0.0.10",
     "ember-cli-flash": "1.4.0",
     "ember-cli-htmlbars": "^1.0.3",
     "ember-cli-htmlbars-inline-precompile": "^0.3.1",
@@ -46,6 +47,7 @@
     "ember-data": "^2.7.0",
     "ember-export-application-global": "^1.0.5",
     "ember-font-awesome": "2.2.0",
+    "ember-i18n": "4.5.0",
     "ember-light-table": "1.8.0",
     "ember-load-initializers": "^0.5.1",
     "ember-modal-dialog": "0.9.0",
@@ -54,6 +56,7 @@
     "ember-resolver": "^2.0.3",
     "ember-responsive": "2.0.0",
     "ember-sass-bootstrap": "0.1.2",
+    "ember-uploader": "1.2.3",
     "loader.js": "^4.0.1"
   },
   "ember-addon": {

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/DataParserCSVTest.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/DataParserCSVTest.java b/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/DataParserCSVTest.java
index 8006e91..5939b03 100644
--- a/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/DataParserCSVTest.java
+++ b/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/DataParserCSVTest.java
@@ -21,6 +21,7 @@ package org.apache.ambari.view.hive20.resources.upload;
 import org.apache.ambari.view.hive20.client.ColumnDescription;
 import org.apache.ambari.view.hive20.client.ColumnDescriptionShort;
 import org.apache.ambari.view.hive20.client.Row;
+import org.apache.ambari.view.hive20.internal.dto.ColumnInfo;
 import org.apache.ambari.view.hive20.resources.uploads.ColumnDescriptionImpl;
 import org.apache.ambari.view.hive20.resources.uploads.parsers.DataParser;
 import org.apache.ambari.view.hive20.resources.uploads.parsers.ParseOptions;
@@ -54,8 +55,8 @@ public class DataParserCSVTest {
       Assert.assertNotNull(pd.getHeader());
       Assert.assertEquals(2, pd.getPreviewRows().size()); // now it will not return the first row which is header
       Assert.assertEquals(2, pd.getHeader().size());
-      ColumnDescription[] cd = {new ColumnDescriptionImpl("1", ColumnDescriptionShort.DataTypes.INT.toString(), 0),
-              new ColumnDescriptionImpl("a", ColumnDescriptionShort.DataTypes.CHAR.toString(), 1)};
+      ColumnInfo[] cd = {new ColumnInfo("1", ColumnDescriptionShort.DataTypes.INT.toString()),
+              new ColumnInfo("a", ColumnDescriptionShort.DataTypes.CHAR.toString())};
 
       Object cols2[] = new Object[2];
       cols2[0] = "2";
@@ -102,15 +103,15 @@ public class DataParserCSVTest {
       PreviewData pd = dp.parsePreview();
       Assert.assertNotNull(pd.getHeader());
       Assert.assertEquals(4, pd.getHeader().size());
-      ColumnDescription[] cd = {
+      ColumnInfo[] cd = {
         // as row 3 contains 2.2
-        new ColumnDescriptionImpl("1", ColumnDescriptionShort.DataTypes.DOUBLE.toString(), 0),
+        new ColumnInfo("1", ColumnDescriptionShort.DataTypes.DOUBLE.toString()),
         // as all are chars
-        new ColumnDescriptionImpl("a", ColumnDescriptionShort.DataTypes.CHAR.toString(), 1),
+        new ColumnInfo("a", ColumnDescriptionShort.DataTypes.CHAR.toString()),
         // as row 4 contains abc
-        new ColumnDescriptionImpl("10", ColumnDescriptionShort.DataTypes.STRING.toString(), 2),
+        new ColumnInfo("10", ColumnDescriptionShort.DataTypes.STRING.toString()),
         // although row 1 contains k but it is in header and not counted in detecting datatype
-        new ColumnDescriptionImpl("k", ColumnDescriptionShort.DataTypes.INT.toString(), 3)};
+        new ColumnInfo("k", ColumnDescriptionShort.DataTypes.INT.toString())};
 
       Assert.assertArrayEquals("Header Not Correct.", cd, pd.getHeader().toArray());
     }
@@ -146,16 +147,16 @@ public class DataParserCSVTest {
       PreviewData pd = dp.parsePreview();
       Assert.assertNotNull(pd.getHeader());
       Assert.assertEquals(4, pd.getHeader().size());
-      ColumnDescription[] cd = {
+      ColumnInfo[] cd = {
         // as row 3 contains 2.2
-        new ColumnDescriptionImpl("1", ColumnDescriptionShort.DataTypes.DOUBLE.toString(), 0),
+        new ColumnInfo("1", ColumnDescriptionShort.DataTypes.DOUBLE.toString()),
         // as all are chars
-        new ColumnDescriptionImpl("a", ColumnDescriptionShort.DataTypes.CHAR.toString(), 1),
+        new ColumnInfo("a", ColumnDescriptionShort.DataTypes.CHAR.toString()),
         // some are int, char and some double .. nothing other than 'string' satisfies all the rows
-        new ColumnDescriptionImpl("10", ColumnDescriptionShort.DataTypes.STRING.toString(), 2),
+        new ColumnInfo("10", ColumnDescriptionShort.DataTypes.STRING.toString()),
         // although row 1 contains k but it is in header and not counted in detecting datatype
         // but row 2 also has a char p which will be acconted for datatype detection
-        new ColumnDescriptionImpl("k", ColumnDescriptionShort.DataTypes.CHAR.toString(), 3)};
+        new ColumnInfo("k", ColumnDescriptionShort.DataTypes.CHAR.toString())};
 
       Assert.assertArrayEquals("Header Not Correct.", cd, pd.getHeader().toArray());
     }
@@ -184,8 +185,8 @@ public class DataParserCSVTest {
       Assert.assertNotNull(pd.getHeader());
       Assert.assertEquals(1, pd.getPreviewRows().size());
       Assert.assertEquals(2, pd.getHeader().size());
-      ColumnDescription[] cd = {new ColumnDescriptionImpl("column1", ColumnDescriptionShort.DataTypes.INT.toString(), 0),
-        new ColumnDescriptionImpl("column2", ColumnDescriptionShort.DataTypes.CHAR.toString(), 1)};
+      ColumnInfo[] cd = {new ColumnInfo("column1", ColumnDescriptionShort.DataTypes.INT.toString()),
+        new ColumnInfo("column2", ColumnDescriptionShort.DataTypes.CHAR.toString())};
 
       Object cols1[] = new Object[2];
       cols1[0] = "1";

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/DataParserJSONTest.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/DataParserJSONTest.java b/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/DataParserJSONTest.java
index a15e5d4..2c7e5e8 100644
--- a/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/DataParserJSONTest.java
+++ b/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/DataParserJSONTest.java
@@ -21,6 +21,7 @@ package org.apache.ambari.view.hive20.resources.upload;
 import org.apache.ambari.view.hive20.client.ColumnDescription;
 import org.apache.ambari.view.hive20.client.ColumnDescriptionShort;
 import org.apache.ambari.view.hive20.client.Row;
+import org.apache.ambari.view.hive20.internal.dto.ColumnInfo;
 import org.apache.ambari.view.hive20.resources.uploads.ColumnDescriptionImpl;
 import org.apache.ambari.view.hive20.resources.uploads.parsers.DataParser;
 import org.apache.ambari.view.hive20.resources.uploads.parsers.ParseOptions;
@@ -71,20 +72,20 @@ public class DataParserJSONTest {
       Assert.assertNotNull(pd.getHeader());
       Assert.assertEquals(7, pd.getPreviewRows().size()); // header row + preview rows
       Assert.assertEquals(14, pd.getHeader().size());
-      ColumnDescription[] cd = {new ColumnDescriptionImpl("col1", ColumnDescriptionShort.DataTypes.CHAR.toString(), 0),
-              new ColumnDescriptionImpl("col2", ColumnDescriptionShort.DataTypes.STRING.toString(), 1),
-              new ColumnDescriptionImpl("col3", ColumnDescriptionShort.DataTypes.STRING.toString(), 2),
-              new ColumnDescriptionImpl("col4", ColumnDescriptionShort.DataTypes.STRING.toString(), 3),
-              new ColumnDescriptionImpl("col5", ColumnDescriptionShort.DataTypes.STRING.toString(), 4),
-              new ColumnDescriptionImpl("col6", ColumnDescriptionShort.DataTypes.STRING.toString(), 5),
-              new ColumnDescriptionImpl("col7", ColumnDescriptionShort.DataTypes.STRING.toString(), 6),
-              new ColumnDescriptionImpl("col8", ColumnDescriptionShort.DataTypes.STRING.toString(), 7),
-              new ColumnDescriptionImpl("col9", ColumnDescriptionShort.DataTypes.STRING.toString(), 8),
-              new ColumnDescriptionImpl("col10", ColumnDescriptionShort.DataTypes.STRING.toString(), 9),
-              new ColumnDescriptionImpl("col11", ColumnDescriptionShort.DataTypes.STRING.toString(), 10),
-              new ColumnDescriptionImpl("col12", ColumnDescriptionShort.DataTypes.STRING.toString(), 11),
-              new ColumnDescriptionImpl("col13", ColumnDescriptionShort.DataTypes.STRING.toString(), 12),
-              new ColumnDescriptionImpl("col14", ColumnDescriptionShort.DataTypes.DOUBLE.toString(), 13)};
+      ColumnInfo[] cd = {new ColumnInfo("col1", ColumnDescriptionShort.DataTypes.CHAR.toString()),
+              new ColumnInfo("col2", ColumnDescriptionShort.DataTypes.STRING.toString()),
+              new ColumnInfo("col3", ColumnDescriptionShort.DataTypes.STRING.toString()),
+              new ColumnInfo("col4", ColumnDescriptionShort.DataTypes.STRING.toString()),
+              new ColumnInfo("col5", ColumnDescriptionShort.DataTypes.STRING.toString()),
+              new ColumnInfo("col6", ColumnDescriptionShort.DataTypes.STRING.toString()),
+              new ColumnInfo("col7", ColumnDescriptionShort.DataTypes.STRING.toString()),
+              new ColumnInfo("col8", ColumnDescriptionShort.DataTypes.STRING.toString()),
+              new ColumnInfo("col9", ColumnDescriptionShort.DataTypes.STRING.toString()),
+              new ColumnInfo("col10", ColumnDescriptionShort.DataTypes.STRING.toString()),
+              new ColumnInfo("col11", ColumnDescriptionShort.DataTypes.STRING.toString()),
+              new ColumnInfo("col12", ColumnDescriptionShort.DataTypes.STRING.toString()),
+              new ColumnInfo("col13", ColumnDescriptionShort.DataTypes.STRING.toString()),
+              new ColumnInfo("col14", ColumnDescriptionShort.DataTypes.DOUBLE.toString())};
 
       Row row2 = new Row(new Object[]{"a", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "4.4"});
       Row row3 = new Row(new Object[]{"b", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "abcd", "5.4"});
@@ -207,8 +208,8 @@ public class DataParserJSONTest {
       Assert.assertNotNull(pd.getHeader());
       Assert.assertEquals(1, pd.getPreviewRows().size());
       Assert.assertEquals(2, pd.getHeader().size());
-      ColumnDescription[] cd = {new ColumnDescriptionImpl("col1", ColumnDescriptionShort.DataTypes.CHAR.toString(), 0),
-        new ColumnDescriptionImpl("col2", ColumnDescriptionShort.DataTypes.STRING.toString(), 1)};
+      ColumnInfo[] cd = {new ColumnInfo("col1", ColumnDescriptionShort.DataTypes.CHAR.toString()),
+        new ColumnInfo("col2", ColumnDescriptionShort.DataTypes.STRING.toString())};
 
       Object cols1[] = new Object[2];
       cols1[0] = "d";
@@ -246,8 +247,8 @@ public class DataParserJSONTest {
       Assert.assertNotNull(pd.getHeader());
       Assert.assertEquals(1, pd.getPreviewRows().size());
       Assert.assertEquals(2, pd.getHeader().size());
-      ColumnDescription[] cd = {new ColumnDescriptionImpl("column1", ColumnDescriptionShort.DataTypes.CHAR.toString(), 0),
-        new ColumnDescriptionImpl("column2", ColumnDescriptionShort.DataTypes.STRING.toString(), 1)};
+      ColumnInfo[] cd = {new ColumnInfo("column1", ColumnDescriptionShort.DataTypes.CHAR.toString()),
+        new ColumnInfo("column2", ColumnDescriptionShort.DataTypes.STRING.toString())};
 
       Object cols1[] = new Object[2];
       cols1[0] = "d";

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/DataParserXMLTest.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/DataParserXMLTest.java b/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/DataParserXMLTest.java
index 07e7c7c..bcdcfc0 100644
--- a/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/DataParserXMLTest.java
+++ b/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/DataParserXMLTest.java
@@ -21,7 +21,7 @@ package org.apache.ambari.view.hive20.resources.upload;
 import org.apache.ambari.view.hive20.client.ColumnDescription;
 import org.apache.ambari.view.hive20.client.ColumnDescriptionShort;
 import org.apache.ambari.view.hive20.client.Row;
-import org.apache.ambari.view.hive20.resources.uploads.ColumnDescriptionImpl;
+import org.apache.ambari.view.hive20.internal.dto.ColumnInfo;
 import org.apache.ambari.view.hive20.resources.uploads.parsers.DataParser;
 import org.apache.ambari.view.hive20.resources.uploads.parsers.ParseOptions;
 import org.apache.ambari.view.hive20.resources.uploads.parsers.PreviewData;
@@ -68,11 +68,11 @@ public class DataParserXMLTest {
       Assert.assertNotNull(pd.getHeader());
       Assert.assertEquals(2, pd.getPreviewRows().size()); // header row + preview rows
       Assert.assertEquals(5, pd.getHeader().size());
-      ColumnDescription[] cd = {new ColumnDescriptionImpl("col1", ColumnDescriptionShort.DataTypes.STRING.toString(), 0),
-              new ColumnDescriptionImpl("col2", ColumnDescriptionShort.DataTypes.STRING.toString(), 1),
-              new ColumnDescriptionImpl("col3", ColumnDescriptionShort.DataTypes.STRING.toString(), 2),
-              new ColumnDescriptionImpl("col4", ColumnDescriptionShort.DataTypes.INT.toString(), 3),
-              new ColumnDescriptionImpl("col5", ColumnDescriptionShort.DataTypes.INT.toString(), 4)
+      ColumnInfo[] cd = {new ColumnInfo("col1", ColumnDescriptionShort.DataTypes.STRING.toString()),
+              new ColumnInfo("col2", ColumnDescriptionShort.DataTypes.STRING.toString()),
+              new ColumnInfo("col3", ColumnDescriptionShort.DataTypes.STRING.toString()),
+              new ColumnInfo("col4", ColumnDescriptionShort.DataTypes.INT.toString()),
+              new ColumnInfo("col5", ColumnDescriptionShort.DataTypes.INT.toString())
       };
 
       Row row2 = new Row(new Object[]{"row1-col1-Value", "row1-col2-Value", "row1-col3-Value", "10", "11"});
@@ -236,8 +236,8 @@ public class DataParserXMLTest {
       Assert.assertNotNull(pd.getHeader());
       Assert.assertEquals(1, pd.getPreviewRows().size());
       Assert.assertEquals(2, pd.getHeader().size());
-      ColumnDescription[] cd = {new ColumnDescriptionImpl("col1", ColumnDescriptionShort.DataTypes.STRING.toString(), 0),
-        new ColumnDescriptionImpl("col2", ColumnDescriptionShort.DataTypes.INT.toString(), 1)};
+      ColumnInfo[] cd = {new ColumnInfo("col1", ColumnDescriptionShort.DataTypes.STRING.toString()),
+        new ColumnInfo("col2", ColumnDescriptionShort.DataTypes.INT.toString())};
 
       Object cols1[] = new Object[2];
       cols1[0] = "row1-col1-Value";
@@ -278,8 +278,8 @@ public class DataParserXMLTest {
       Assert.assertNotNull(pd.getHeader());
       Assert.assertEquals(1, pd.getPreviewRows().size());
       Assert.assertEquals(2, pd.getHeader().size());
-      ColumnDescription[] cd = {new ColumnDescriptionImpl("column1", ColumnDescriptionShort.DataTypes.STRING.toString(), 0),
-        new ColumnDescriptionImpl("column2", ColumnDescriptionShort.DataTypes.INT.toString(), 1)};
+      ColumnInfo[] cd = {new ColumnInfo("column1", ColumnDescriptionShort.DataTypes.STRING.toString()),
+        new ColumnInfo("column2", ColumnDescriptionShort.DataTypes.INT.toString())};
 
       Object cols1[] = new Object[2];
       cols1[0] = "row1-col1-Value";

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/QueryGeneratorTest.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/QueryGeneratorTest.java b/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/QueryGeneratorTest.java
deleted file mode 100644
index 1a0d34a..0000000
--- a/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/QueryGeneratorTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * 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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * 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.view.hive20.resources.upload;
-
-import org.apache.ambari.view.hive.resources.uploads.query.RowFormat;
-import org.apache.ambari.view.hive20.client.ColumnDescription;
-import org.apache.ambari.view.hive20.resources.uploads.ColumnDescriptionImpl;
-import org.apache.ambari.view.hive20.resources.uploads.HiveFileType;
-import org.apache.ambari.view.hive20.resources.uploads.query.DeleteQueryInput;
-import org.apache.ambari.view.hive20.resources.uploads.query.InsertFromQueryInput;
-import org.apache.ambari.view.hive20.resources.uploads.query.QueryGenerator;
-import org.apache.ambari.view.hive20.resources.uploads.query.TableInfo;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class QueryGeneratorTest {
-  @Test
-  public void testCreateTextFile() {
-
-    List<ColumnDescriptionImpl> cdl = new ArrayList<>(4);
-    cdl.add(new ColumnDescriptionImpl("col1", ColumnDescription.DataTypes.CHAR.toString(), 0, 10));
-    cdl.add(new ColumnDescriptionImpl("col2", ColumnDescription.DataTypes.STRING.toString(), 1));
-    cdl.add(new ColumnDescriptionImpl("col3", ColumnDescription.DataTypes.DECIMAL.toString(), 2, 10, 5));
-    cdl.add(new ColumnDescriptionImpl("col4", ColumnDescription.DataTypes.VARCHAR.toString(), 3, 40));
-    cdl.add(new ColumnDescriptionImpl("col5", ColumnDescription.DataTypes.INT.toString(), 4));
-
-    TableInfo ti = new TableInfo("databaseName", "tableName", cdl, HiveFileType.TEXTFILE, new RowFormat(',', '\\'));
-
-    QueryGenerator qg = new QueryGenerator();
-    Assert.assertEquals("Create query for text file not correct ","CREATE TABLE tableName (col1 CHAR(10), col2 STRING," +
-      " col3 DECIMAL(10,5), col4 VARCHAR(40), col5 INT) ROW FORMAT DELIMITED FIELDS TERMINATED BY ','" +
-      " ESCAPED BY '\\\\' STORED AS TEXTFILE;",qg.generateCreateQuery(ti));
-  }
-
-  @Test
-  public void testCreateORC() {
-
-    List<ColumnDescriptionImpl> cdl = new ArrayList<>(4);
-    cdl.add(new ColumnDescriptionImpl("col1", ColumnDescription.DataTypes.CHAR.toString(), 0, 10));
-    cdl.add(new ColumnDescriptionImpl("col2", ColumnDescription.DataTypes.STRING.toString(), 1));
-    cdl.add(new ColumnDescriptionImpl("col3", ColumnDescription.DataTypes.DECIMAL.toString(), 2, 10, 5));
-    cdl.add(new ColumnDescriptionImpl("col4", ColumnDescription.DataTypes.VARCHAR.toString(), 3, 40));
-    cdl.add(new ColumnDescriptionImpl("col5", ColumnDescription.DataTypes.INT.toString(), 4));
-
-    TableInfo ti = new TableInfo("databaseName", "tableName", cdl, HiveFileType.ORC, new RowFormat(',', '\\'));
-
-    QueryGenerator qg = new QueryGenerator();
-    Assert.assertEquals("Create query for text file not correct ","CREATE TABLE tableName (col1 CHAR(10), col2 STRING, col3 DECIMAL(10,5), col4 VARCHAR(40), col5 INT) STORED AS ORC;",qg.generateCreateQuery(ti));
-  }
-
-  @Test
-  public void testInsertWithoutUnhexFromQuery() {
-    List<ColumnDescriptionImpl> cdl = new ArrayList<>(4);
-    cdl.add(new ColumnDescriptionImpl("col1", ColumnDescription.DataTypes.CHAR.toString(), 0, 10));
-    cdl.add(new ColumnDescriptionImpl("col2", ColumnDescription.DataTypes.STRING.toString(), 1));
-    cdl.add(new ColumnDescriptionImpl("col3", ColumnDescription.DataTypes.DECIMAL.toString(), 2, 10, 5));
-    cdl.add(new ColumnDescriptionImpl("col4", ColumnDescription.DataTypes.VARCHAR.toString(), 3, 40));
-    cdl.add(new ColumnDescriptionImpl("col5", ColumnDescription.DataTypes.INT.toString(), 4));
-
-    InsertFromQueryInput ifqi = new InsertFromQueryInput("fromDB","fromTable","toDB","toTable", cdl, Boolean.FALSE);
-
-    QueryGenerator qg = new QueryGenerator();
-    Assert.assertEquals("insert from one table to another not correct ","INSERT INTO TABLE toDB.toTable SELECT col1, col2, col3, col4, col5 FROM fromDB.fromTable;",qg.generateInsertFromQuery(ifqi));
-  }
-
-  @Test
-  public void testInsertWithUnhexFromQuery() {
-    List<ColumnDescriptionImpl> cdl = new ArrayList<>(4);
-    cdl.add(new ColumnDescriptionImpl("col1", ColumnDescription.DataTypes.CHAR.toString(), 0, 10));
-    cdl.add(new ColumnDescriptionImpl("col2", ColumnDescription.DataTypes.STRING.toString(), 1));
-    cdl.add(new ColumnDescriptionImpl("col3", ColumnDescription.DataTypes.DECIMAL.toString(), 2, 10, 5));
-    cdl.add(new ColumnDescriptionImpl("col4", ColumnDescription.DataTypes.VARCHAR.toString(), 3, 40));
-    cdl.add(new ColumnDescriptionImpl("col5", ColumnDescription.DataTypes.INT.toString(), 4));
-
-    InsertFromQueryInput ifqi = new InsertFromQueryInput("fromDB","fromTable","toDB","toTable", cdl, Boolean.TRUE);
-
-    QueryGenerator qg = new QueryGenerator();
-    Assert.assertEquals("insert from one table to another not correct ","INSERT INTO TABLE toDB.toTable SELECT UNHEX(col1), UNHEX(col2), col3, UNHEX(col4), col5 FROM fromDB.fromTable;",qg.generateInsertFromQuery(ifqi));
-  }
-
-  @Test
-  public void testDropTableQuery() {
-
-    DeleteQueryInput deleteQueryInput = new DeleteQueryInput("dbName","tableName");
-
-    QueryGenerator qg = new QueryGenerator();
-    Assert.assertEquals("drop table query not correct ","DROP TABLE dbName.tableName;",qg.generateDropTableQuery(deleteQueryInput ));
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/53e6c8d4/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/TableDataReaderTest.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/TableDataReaderTest.java b/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/TableDataReaderTest.java
index 340a921..325aed8 100644
--- a/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/TableDataReaderTest.java
+++ b/contrib/views/hive20/src/test/java/org/apache/ambari/view/hive20/resources/upload/TableDataReaderTest.java
@@ -20,6 +20,7 @@ package org.apache.ambari.view.hive20.resources.upload;
 
 import org.apache.ambari.view.hive20.client.ColumnDescription;
 import org.apache.ambari.view.hive20.client.Row;
+import org.apache.ambari.view.hive20.internal.dto.ColumnInfo;
 import org.apache.ambari.view.hive20.resources.uploads.ColumnDescriptionImpl;
 import org.apache.ambari.view.hive20.resources.uploads.TableDataReader;
 import org.junit.Assert;
@@ -78,9 +79,9 @@ public class TableDataReaderTest {
   @Test
   public void testCSVReader() throws IOException {
     RowIter rowIter = new RowIter(10,10);
-    List<ColumnDescriptionImpl> colDescs = new LinkedList<>();
+    List<ColumnInfo> colDescs = new LinkedList<>();
     for(int i = 0 ; i < 10 ; i++ ) {
-      ColumnDescriptionImpl cd = new ColumnDescriptionImpl("col" + (i+1) , ColumnDescription.DataTypes.STRING.toString(), i);
+      ColumnInfo cd = new ColumnInfo("col" + (i+1) , ColumnDescription.DataTypes.STRING.toString());
       colDescs.add(cd);
     }
 


[26/51] [abbrv] ambari git commit: AMBARI-19878 Log Search Portal time zone selection bug (mgergely)

Posted by rz...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/e3b9ef3c/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/Init.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/Init.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/Init.js
index cc16129..ed940041 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/Init.js
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/Init.js
@@ -16,224 +16,223 @@
   * limitations under the License.
   */
 
- require.config({
-
-     //    baseUrl: "/scripts",
-
-     urlArgs: 'ver=build.version',
-
-     /* starting point for application */
-     deps: ['backbone.marionette', 'bootstrap', 'Main', 'globalize', 'utils/LangSupport'],
-
-     waitSeconds: 30,
-
-     shim: {
-         'backbone': {
-             deps: ['underscore', 'jquery'],
-             exports: 'Backbone'
-         },
-         'underscore': {
-             exports: '_'
-         },
-         'backbone.marionette': {
-             deps: ['backbone']
-         },
-         bootstrap: {
-             deps: ['jquery'],
-             exports: 'jquery'
-         },
-         'backgrid': {
-             deps: ['backbone', 'jquery'],
-             exports: 'Backgrid'
-         },
-         'backgrid-paginator': {
-             deps: ['backbone', 'backgrid']
-         },
-         'backgrid-filter': {
-             deps: ['backbone', 'backgrid']
-         },
-         'backgrid-select-all': {
-             deps: ['backbone', 'backgrid']
-         },
-         'backgrid-filter': {
-             deps: ['backbone', 'backgrid']
-         },
-         'backgrid-columnmanager': {
-             deps: ['backbone', 'backgrid'],
-         },
-         'backgrid-sizeable': {
-             deps: ['backbone', 'backgrid'],
-         },
-         'backgrid-orderable': {
-             deps: ['backbone', 'backgrid'],
-         },
-         /*         'backbone-forms.templates': {
-                      deps: ['backbone-forms.list', 'backbone-forms']
-                  },
-                  'backbone-forms.XAOverrides': {
-                      deps: ['backbone-forms']
-                  },*/
-         'Backbone.BootstrapModal': {
-             deps: ['jquery', 'underscore', 'backbone']
-         },
-         'bootstrap-editable': {
+require.config({
+
+    //    baseUrl: "/scripts",
+
+    urlArgs: 'ver=build.version',
+
+    /* starting point for application */
+    deps: ['backbone.marionette', 'bootstrap', 'Main', 'globalize', 'utils/LangSupport'],
+
+    waitSeconds: 30,
+
+    shim: {
+        'backbone': {
+            deps: ['underscore', 'jquery'],
+            exports: 'Backbone'
+        },
+        'underscore': {
+            exports: '_'
+        },
+        'backbone.marionette': {
+            deps: ['backbone']
+        },
+        bootstrap: {
+            deps: ['jquery'],
+            exports: 'jquery'
+        },
+        'backgrid': {
+            deps: ['backbone', 'jquery'],
+            exports: 'Backgrid'
+        },
+        'backgrid-paginator': {
+            deps: ['backbone', 'backgrid']
+        },
+        'backgrid-filter': {
+            deps: ['backbone', 'backgrid']
+        },
+        'backgrid-select-all': {
+            deps: ['backbone', 'backgrid']
+        },
+        'backgrid-filter': {
+            deps: ['backbone', 'backgrid']
+        },
+        'backgrid-columnmanager': {
+            deps: ['backbone', 'backgrid'],
+        },
+        'backgrid-sizeable': {
+            deps: ['backbone', 'backgrid'],
+        },
+        'backgrid-orderable': {
+            deps: ['backbone', 'backgrid'],
+        },
+        /* 'backbone-forms.templates': {
+            deps: ['backbone-forms.list', 'backbone-forms']
+        },
+        'backbone-forms.XAOverrides': {
+            deps: ['backbone-forms']
+        },*/
+        'Backbone.BootstrapModal': {
+            deps: ['jquery', 'underscore', 'backbone']
+        },
+        'bootstrap-editable': {
+            deps: ['bootstrap']
+        },
+        /* 'jquery-toggles': {
+            deps: ['jquery']
+        },
+        'jquery.cookie': {
+            deps: ['jquery']
+        },
+        'tag-it': {
+            deps: ['jquery', 'jquery-ui']
+        },*/
+        'jquery-ui': {
+            deps: ['jquery']
+        },
+        'globalize': {
+            exports: 'Globalize'
+        },
+        /*  'bootstrap-datepicker': {
              deps: ['bootstrap']
-         },
-         /*         'jquery-toggles': {
-                      deps: ['jquery']
-                  },
-                  'jquery.cookie': {
-                      deps: ['jquery']
-                  },
-                  'tag-it': {
-                      deps: ['jquery', 'jquery-ui']
-                  },*/
-         'jquery-ui': {
-             deps: ['jquery']
-         },
-         'globalize': {
-             exports: 'Globalize'
-         },
-         /*  'bootstrap-datepicker': {
-              deps: ['bootstrap']
-          },*/
-         'bootstrap-daterangepicker': {
-             deps: ['bootstrap', 'jquery', 'moment'],
-             exports: 'daterangepicker'
-         },
-         /*
-                  'bootstrap-notify': {
-                      deps: ['jquery', 'bootstrap'],
-                  },*/
-         moment: {
-             deps: [],
-             exports: 'moment'
-         },
-         'moment-tz': {
-             deps: ['moment']
-         },
-         'localstorage': {
-             deps: ['backbone', 'underscore', 'jquery']
-         },
-         'backbone-fetch-cache': {
-             deps: ['backbone', 'underscore', 'jquery']
-         },
-         'visualsearch': {
-             deps: ['jquery', 'jquery-ui', 'backbone', 'underscore']
-         },
-         'select2': {
-             deps: ['jquery', 'bootstrap']
-         },
-         'bootbox': {
-             deps: ['jquery']
-         },
-         'd3.tip': {
-             deps: ['d3']
-         },
-         'nv': {
-             deps: ['d3'],
-             exports: 'nv'
-         },
-         noty: {
-             deps: ['jquery'],
-         },
-         WorldMapGenerator: {
-             deps: ['jquery']
-         },
-         jstimezonedetect: {
-             exports: 'jstz'
-         },
-         sparkline: {
-             deps: ['jquery']
-         },
-         gridster: {
-             deps: ['jquery']
-         },
-         dashboard: {
-             deps: ['jquery', 'jquery-ui', 'gridster']
-         },
-         tour : {
-            exports : 'tour'
-         }
-
-     },
-
-     paths: {
-
-         jquery: '../libs/bower/jquery/js/jquery.min',
-         'jquery-ui': '../libs/other/jquery-ui/js/jquery-ui-1.11.4.min',
-         backbone: '../libs/bower/backbone-amd/js/backbone',
-         underscore: '../libs/bower/underscore-amd/js/underscore',
-
-         /* alias all marionette libs */
-         'backbone.marionette': '../libs/bower/backbone.marionette/js/backbone.marionette',
-         'backbone.wreqr': '../libs/bower/backbone.wreqr/js/backbone.wreqr',
-         'backbone.babysitter': '../libs/bower/backbone.babysitter/js/backbone.babysitter',
-
-         /* alias the bootstrap js lib */
-         bootstrap: '../libs/bower/bootstrap/bootstrap',
-
-         /* BackGrid for Tables */
-         'backgrid': '../libs/bower/backgrid/js/backgrid.min',
-         'backgrid-filter': '../libs/bower/backgrid-filter/js/backgrid-filter.min',
-         'backgrid-select-all': '../libs/bower/backgrid-select-all/js/backgrid-select-all.min',
-         'backbone.paginator': '../libs/bower/backbone.paginator/js/backbone.paginator.min',
-         'backgrid-paginator': '../libs/bower/backgrid-paginator/js/backgrid-paginator.min',
-         'backgrid-columnmanager': '../libs/bower/backgrid-columnmanager/Backgrid.ColumnManager',
-         'backgrid-sizeable': '../libs/bower/backgrid-sizeable/js/backgrid-sizeable-columns',
-         'backgrid-orderable': '../libs/bower/backgrid-sizeable/backgrid-orderable-columns',
-
-         'backbone-pageable': '../libs/bower/backbone-pageable/js/backbone-pageable',
-         'localstorage': '../libs/bower/backbone.localstorage/backbone.localStorage',
-         /*'backbone-forms': '../libs/bower/backbone-forms/js/backbone-forms',
-         'backbone-forms.list': '../libs/bower/backbone-forms/js/list',
- '        backbone-forms.templates': '../libs/bower/backbone-forms/js/bootstrap',
-         'backbone-forms.XAOverrides': '../libs/fsOverrides/BBFOverrides',*/
-
-         /*'Backbone.BootstrapModal': '../libs/bower/backbone.bootstrap-modal/js/backbone.bootstrap-modal',
-         'bootstrap-editable': '../libs/bower/x-editable/js/bootstrap-editable',
-         'bootstrap-datepicker': '../libs/other/datepicker/js/bootstrap-datepicker',
-         'bootstrap-notify': '../libs/bower/bootstrap-notify/js/bootstrap-notify',*/
-         'bootstrap-daterangepicker': '../libs/other/daterangepicker/js/daterangepicker',
-
-
-         /*'jquery.cookie': '../libs/other/jquery-cookie/js/jquery.cookie',
-          'jquery-toggles': '../libs/bower/jquery-toggles/js/toggles.min',
-          'tag-it': '../libs/bower/tag-it/js/tag-it',*/
-         'select2': '../libs/bower/select2/select2',
-         'bootbox': '../libs/bower/bootbox/js/bootbox.min',
-         'moment': '../libs/bower/moment/js/moment.min',
-         'moment-tz': '../libs/bower/moment/js/moment-timezone-with-data.min',
-         'visualsearch': '../libs/other/custom/visualsearch/visualsearch',
-         'globalize': '../libs/bower/globalize/lib/globalize',
-         /*'handlebars from the require handlerbars plugin below */
-         'handlebars': '../libs/bower/require-handlebars-plugin/js/Handlebars',
-         /* require handlebars plugin - Alex Sexton */
-         'i18nprecompile': '../libs/bower/require-handlebars-plugin/js/i18nprecompile',
-         'json2': '../libs/bower/require-handlebars-plugin/js/json2',
-         'hbs': '../libs/bower/require-handlebars-plugin/js/hbs',
-         'd3': "../libs/other/d3/d3.min",
-         'd3.tip': "../libs/other/d3/d3.tip",
-         'nv': "../libs/other/nvd3/js/nv.d3",
-         'noty': '../libs/other/noty/jquery.noty.packaged',
-         'tmpl': '../templates',
-         'WorldMapGenerator': '../libs/other/timezone/WorldMapGenerator',
-         'jstimezonedetect': '../libs/other/timezone/jstz-1.0.4.min',
-         'sparkline': '../libs/other/sparkline/jquery.sparkline',
-         'gridster': '../libs/other/gridster/js/jquery.gridster',
-         'dashboard': '../libs/other/dashboard/dashboard',
-         'tour' : '../libs/other/bootstrap-tour-0.10.3/js/bootstrap-tour.min'
-
-
-     },
-
-     hbs: {
-         disableI18n: true,
-         helperPathCallback: // Callback to determine the path to look for helpers
-             function(name) { // ('/template/helpers/'+name by default)
-             return "../helpers/Helpers";
-         },
-         templateExtension: "html",
-         compileOptions: {}
-     }
- });
+         },*/
+        'bootstrap-daterangepicker': {
+            deps: ['bootstrap', 'jquery', 'moment'],
+            exports: 'daterangepicker'
+        },
+        /* 'bootstrap-notify': {
+            deps: ['jquery', 'bootstrap'],
+        },*/
+        moment: {
+            deps: [],
+            exports: 'moment'
+        },
+        'moment-tz': {
+            deps: ['moment']
+        },
+        'localstorage': {
+            deps: ['backbone', 'underscore', 'jquery']
+        },
+        'backbone-fetch-cache': {
+            deps: ['backbone', 'underscore', 'jquery']
+        },
+        'visualsearch': {
+            deps: ['jquery', 'jquery-ui', 'backbone', 'underscore']
+        },
+        'select2': {
+            deps: ['jquery', 'bootstrap']
+        },
+        'bootbox': {
+            deps: ['jquery']
+        },
+        'd3.tip': {
+            deps: ['d3']
+        },
+        'nv': {
+            deps: ['d3'],
+            exports: 'nv'
+        },
+        noty: {
+            deps: ['jquery'],
+        },
+        WorldMapGenerator: {
+            deps: ['jquery']
+        },
+        jstimezonedetect: {
+            exports: 'jstz'
+        },
+        sparkline: {
+            deps: ['jquery']
+        },
+        gridster: {
+            deps: ['jquery']
+        },
+        dashboard: {
+            deps: ['jquery', 'jquery-ui', 'gridster']
+        },
+        tour : {
+           exports : 'tour'
+        }
+
+    },
+
+    paths: {
+
+        jquery: '../libs/bower/jquery/js/jquery.min',
+        'jquery-ui': '../libs/other/jquery-ui/js/jquery-ui-1.11.4.min',
+        backbone: '../libs/bower/backbone-amd/js/backbone',
+        underscore: '../libs/bower/underscore-amd/js/underscore',
+
+        /* alias all marionette libs */
+        'backbone.marionette': '../libs/bower/backbone.marionette/js/backbone.marionette',
+        'backbone.wreqr': '../libs/bower/backbone.wreqr/js/backbone.wreqr',
+        'backbone.babysitter': '../libs/bower/backbone.babysitter/js/backbone.babysitter',
+
+        /* alias the bootstrap js lib */
+        bootstrap: '../libs/bower/bootstrap/bootstrap',
+
+        /* BackGrid for Tables */
+        'backgrid': '../libs/bower/backgrid/js/backgrid.min',
+        'backgrid-filter': '../libs/bower/backgrid-filter/js/backgrid-filter.min',
+        'backgrid-select-all': '../libs/bower/backgrid-select-all/js/backgrid-select-all.min',
+        'backbone.paginator': '../libs/bower/backbone.paginator/js/backbone.paginator.min',
+        'backgrid-paginator': '../libs/bower/backgrid-paginator/js/backgrid-paginator.min',
+        'backgrid-columnmanager': '../libs/bower/backgrid-columnmanager/Backgrid.ColumnManager',
+        'backgrid-sizeable': '../libs/bower/backgrid-sizeable/js/backgrid-sizeable-columns',
+        'backgrid-orderable': '../libs/bower/backgrid-sizeable/backgrid-orderable-columns',
+
+        'backbone-pageable': '../libs/bower/backbone-pageable/js/backbone-pageable',
+        'localstorage': '../libs/bower/backbone.localstorage/backbone.localStorage',
+        /*'backbone-forms': '../libs/bower/backbone-forms/js/backbone-forms',
+        'backbone-forms.list': '../libs/bower/backbone-forms/js/list',
+        'backbone-forms.templates': '../libs/bower/backbone-forms/js/bootstrap',
+        'backbone-forms.XAOverrides': '../libs/fsOverrides/BBFOverrides',*/
+
+        /*'Backbone.BootstrapModal': '../libs/bower/backbone.bootstrap-modal/js/backbone.bootstrap-modal',
+        'bootstrap-editable': '../libs/bower/x-editable/js/bootstrap-editable',
+        'bootstrap-datepicker': '../libs/other/datepicker/js/bootstrap-datepicker',
+        'bootstrap-notify': '../libs/bower/bootstrap-notify/js/bootstrap-notify',*/
+        'bootstrap-daterangepicker': '../libs/custom/daterangepicker/js/daterangepicker',
+
+
+        /*'jquery.cookie': '../libs/other/jquery-cookie/js/jquery.cookie',
+        'jquery-toggles': '../libs/bower/jquery-toggles/js/toggles.min',
+        'tag-it': '../libs/bower/tag-it/js/tag-it',*/
+        'select2': '../libs/bower/select2/select2',
+        'bootbox': '../libs/bower/bootbox/js/bootbox.min',
+        'moment': '../libs/bower/moment/js/moment.min',
+        'moment-tz': '../libs/bower/moment/js/moment-timezone-with-data.min',
+        'visualsearch': '../libs/other/custom/visualsearch/visualsearch',
+        'globalize': '../libs/bower/globalize/lib/globalize',
+        /*'handlebars from the require handlerbars plugin below */
+        'handlebars': '../libs/bower/require-handlebars-plugin/js/Handlebars',
+        /* require handlebars plugin - Alex Sexton */
+        'i18nprecompile': '../libs/bower/require-handlebars-plugin/js/i18nprecompile',
+        'json2': '../libs/bower/require-handlebars-plugin/js/json2',
+        'hbs': '../libs/bower/require-handlebars-plugin/js/hbs',
+        'd3': "../libs/other/d3/d3.min",
+        'd3.tip': "../libs/other/d3/d3.tip",
+        'nv': "../libs/other/nvd3/js/nv.d3",
+        'noty': '../libs/other/noty/jquery.noty.packaged',
+        'tmpl': '../templates',
+        'WorldMapGenerator': '../libs/custom/timezone/WorldMapGenerator',
+        'jstimezonedetect': '../libs/custom/timezone/jstz-1.0.4.min',
+        'sparkline': '../libs/other/sparkline/jquery.sparkline',
+        'gridster': '../libs/other/gridster/js/jquery.gridster',
+        'dashboard': '../libs/other/dashboard/dashboard',
+        'tour' : '../libs/other/bootstrap-tour-0.10.3/js/bootstrap-tour.min'
+
+
+    },
+
+    hbs: {
+        disableI18n: true,
+        helperPathCallback: // Callback to determine the path to look for helpers
+            function(name) { // ('/template/helpers/'+name by default)
+            return "../helpers/Helpers";
+        },
+        templateExtension: "html",
+        compileOptions: {}
+    }
+});


[14/51] [abbrv] ambari git commit: AMBARI-19843. Publish asset has issues when different users logins (Madhan Mohan Reddy via gauravn7)

Posted by rz...@apache.org.
AMBARI-19843. Publish asset has issues when different users logins (Madhan Mohan Reddy via gauravn7)

(cherry picked from commit 919500f2fe00e4f2ab923d39ef3ab02f19a78b48)

Change-Id: I07e0757f2c68521cf0606a61b6d60e34c4fff034


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 0ef121498f2667c4909d055cf41a0b72ee227b10
Parents: ffaa961
Author: Gaurav Nagar <gr...@gmail.com>
Authored: Thu Feb 2 18:15:52 2017 +0530
Committer: Zuul <re...@hortonworks.com>
Committed: Mon Feb 6 23:24:16 2017 -0800

----------------------------------------------------------------------
 .../java/org/apache/oozie/ambari/view/assets/AssetResource.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0ef12149/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/assets/AssetResource.java
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/assets/AssetResource.java b/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/assets/AssetResource.java
index af86810..ef3b508 100644
--- a/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/assets/AssetResource.java
+++ b/contrib/views/wfmanager/src/main/java/org/apache/oozie/ambari/view/assets/AssetResource.java
@@ -115,7 +115,7 @@ public class AssetResource {
     String workflowXml = oozieUtils.generateWorkflowXml(postBody);
     try {
       Map<String, String> result = new HashMap<>();
-      String tempWfPath = "/tmp" + "/tmpooziewfs/tempwf.xml";
+      String tempWfPath = "/tmp" + "/tmpooziewfs/tempwf_" + Math.round(Math.random()*100000) + ".xml";
       hdfsFileUtils.writeToFile(tempWfPath, workflowXml, true);
       queryParams.put("oozieparam.action", getAsList("dryrun"));
       queryParams.put("oozieconfig.rerunOnFailure", getAsList("false"));
@@ -125,6 +125,7 @@ public class AssetResource {
         tempWfPath, queryParams, JobType.WORKFLOW);
       LOGGER.info(String.format("resp from validating asset=[%s]",
         dryRunResp));
+      hdfsFileUtils.deleteFile(tempWfPath);
       if (dryRunResp != null && dryRunResp.trim().startsWith("{")) {
         JsonElement jsonElement = new JsonParser().parse(dryRunResp);
         JsonElement idElem = jsonElement.getAsJsonObject().get("id");


[32/51] [abbrv] ambari git commit: AMBARI-19878 Log Search Portal time zone selection bug (mgergely)

Posted by rz...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/e3b9ef3c/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/daterangepicker/js/daterangepicker.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/daterangepicker/js/daterangepicker.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/daterangepicker/js/daterangepicker.js
new file mode 100644
index 0000000..e88b45f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/custom/daterangepicker/js/daterangepicker.js
@@ -0,0 +1,1560 @@
+/**
+* @version: 2.1.24
+* @author: Dan Grossman http://www.dangrossman.info/
+* @copyright: Copyright (c) 2012-2016 Dan Grossman. All rights reserved.
+* @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php
+* @website: https://www.improvely.com/
+*/
+// Follow the UMD template https://github.com/umdjs/umd/blob/master/templates/returnExportsGlobal.js
+(function (root, factory) {
+    if (typeof define === 'function' && define.amd) {
+        // AMD. Make globaly available as well
+        define(['moment', 'jquery'], function (moment, jquery) {
+            return (root.daterangepicker = factory(moment, jquery));
+        });
+    } else if (typeof module === 'object' && module.exports) {
+        // Node / Browserify
+        //isomorphic issue
+        var jQuery = (typeof window != 'undefined') ? window.jQuery : undefined;
+        if (!jQuery) {
+            jQuery = require('jquery');
+            if (!jQuery.fn) jQuery.fn = {};
+        }
+        module.exports = factory(require('moment'), jQuery);
+    } else {
+        // Browser globals
+        root.daterangepicker = factory(root.moment, root.jQuery);
+    }
+}(this, function(moment, $) {
+    var DateRangePicker = function(element, options, cb) {
+
+        //default settings for options
+        this.parentEl = 'body';
+        this.element = $(element);
+        this.startDate = moment().startOf('day');
+        this.endDate = moment().endOf('day');
+        this.minDate = false;
+        this.maxDate = false;
+        this.dateLimit = false;
+        this.autoApply = false;
+        this.singleDatePicker = false;
+        this.showDropdowns = false;
+        this.showWeekNumbers = false;
+        this.showISOWeekNumbers = false;
+        this.showCustomRangeLabel = true;
+        this.timePicker = false;
+        this.timePicker24Hour = false;
+        this.timePickerIncrement = 1;
+        this.timePickerSeconds = false;
+        this.linkedCalendars = true;
+        this.autoUpdateInput = true;
+        this.alwaysShowCalendars = false;
+
+        this.opens = 'right';
+        if (this.element.hasClass('pull-right'))
+            this.opens = 'left';
+
+        this.drops = 'down';
+        if (this.element.hasClass('dropup'))
+            this.drops = 'up';
+
+        this.buttonClasses = 'btn btn-sm';
+        this.applyClass = 'btn-success';
+        this.cancelClass = 'btn-default';
+
+        this.locale = {
+            direction: 'ltr',
+            format: 'MM/DD/YYYY',
+            separator: ' - ',
+            applyLabel: 'Apply',
+            cancelLabel: 'Cancel',
+            weekLabel: 'W',
+            customRangeLabel: 'Custom Range',
+            daysOfWeek: moment.weekdaysMin(),
+            monthNames: moment.monthsShort(),
+            firstDay: moment.localeData().firstDayOfWeek()
+        };
+
+        this.callback = function() { };
+
+        //some state information
+        this.isShowing = false;
+        this.leftCalendar = {};
+        this.rightCalendar = {};
+
+        //custom options from user
+        if (typeof options !== 'object' || options === null)
+            options = {};
+
+        //allow setting options with data attributes
+        //data-api options will be overwritten with custom javascript options
+        options = $.extend(this.element.data(), options);
+
+        //html template for the picker UI
+        if (typeof options.template !== 'string' && !(options.template instanceof $))
+            options.template = '<div class="daterangepicker dropdown-menu">' +
+                '<div class="calendar left">' +
+                    '<div class="daterangepicker_input">' +
+                      '<input class="input-mini form-control" type="text" name="daterangepicker_start" value="" />' +
+                      '<i class="fa fa-calendar glyphicon glyphicon-calendar"></i>' +
+                      '<div class="calendar-time">' +
+                        '<div></div>' +
+                        '<i class="fa fa-clock-o glyphicon glyphicon-time"></i>' +
+                      '</div>' +
+                    '</div>' +
+                    '<div class="calendar-table"></div>' +
+                '</div>' +
+                '<div class="calendar right">' +
+                    '<div class="daterangepicker_input">' +
+                      '<input class="input-mini form-control" type="text" name="daterangepicker_end" value="" />' +
+                      '<i class="fa fa-calendar glyphicon glyphicon-calendar"></i>' +
+                      '<div class="calendar-time">' +
+                        '<div></div>' +
+                        '<i class="fa fa-clock-o glyphicon glyphicon-time"></i>' +
+                      '</div>' +
+                    '</div>' +
+                    '<div class="calendar-table"></div>' +
+                '</div>' +
+                '<div class="ranges">' +
+                    '<div class="range_inputs">' +
+                        '<button class="applyBtn" disabled="disabled" type="button"></button> ' +
+                        '<button class="cancelBtn" type="button"></button>' +
+                    '</div>' +
+                '</div>' +
+            '</div>';
+
+        this.parentEl = (options.parentEl && $(options.parentEl).length) ? $(options.parentEl) : $(this.parentEl);
+        this.container = $(options.template).appendTo(this.parentEl);
+
+        //
+        // handle all the possible options overriding defaults
+        //
+
+        if (typeof options.locale === 'object') {
+
+            if (typeof options.locale.direction === 'string')
+                this.locale.direction = options.locale.direction;
+
+            if (typeof options.locale.format === 'string')
+                this.locale.format = options.locale.format;
+
+            if (typeof options.locale.separator === 'string')
+                this.locale.separator = options.locale.separator;
+
+            if (typeof options.locale.daysOfWeek === 'object')
+                this.locale.daysOfWeek = options.locale.daysOfWeek.slice();
+
+            if (typeof options.locale.monthNames === 'object')
+              this.locale.monthNames = options.locale.monthNames.slice();
+
+            if (typeof options.locale.firstDay === 'number')
+              this.locale.firstDay = options.locale.firstDay;
+
+            if (typeof options.locale.applyLabel === 'string')
+              this.locale.applyLabel = options.locale.applyLabel;
+
+            if (typeof options.locale.cancelLabel === 'string')
+              this.locale.cancelLabel = options.locale.cancelLabel;
+
+            if (typeof options.locale.weekLabel === 'string')
+              this.locale.weekLabel = options.locale.weekLabel;
+
+            if (typeof options.locale.customRangeLabel === 'string')
+              this.locale.customRangeLabel = options.locale.customRangeLabel;
+
+        }
+        this.container.addClass(this.locale.direction);
+
+        if (typeof options.startDate === 'string')
+            this.startDate = moment(options.startDate, this.locale.format);
+
+        if (typeof options.endDate === 'string')
+            this.endDate = moment(options.endDate, this.locale.format);
+
+        if (typeof options.minDate === 'string')
+            this.minDate = moment(options.minDate, this.locale.format);
+
+        if (typeof options.maxDate === 'string')
+            this.maxDate = moment(options.maxDate, this.locale.format);
+
+        if (typeof options.startDate === 'object')
+            this.startDate = moment(options.startDate);
+
+        if (typeof options.endDate === 'object')
+            this.endDate = moment(options.endDate);
+
+        if (typeof options.minDate === 'object')
+            this.minDate = moment(options.minDate);
+
+        if (typeof options.maxDate === 'object')
+            this.maxDate = moment(options.maxDate);
+
+        // sanity check for bad options
+        if (this.minDate && this.startDate.isBefore(this.minDate))
+            this.startDate = this.minDate.clone();
+
+        // sanity check for bad options
+        if (this.maxDate && this.endDate.isAfter(this.maxDate))
+            this.endDate = this.maxDate.clone();
+
+        if (typeof options.applyClass === 'string')
+            this.applyClass = options.applyClass;
+
+        if (typeof options.cancelClass === 'string')
+            this.cancelClass = options.cancelClass;
+
+        if (typeof options.dateLimit === 'object')
+            this.dateLimit = options.dateLimit;
+
+        if (typeof options.opens === 'string')
+            this.opens = options.opens;
+
+        if (typeof options.drops === 'string')
+            this.drops = options.drops;
+
+        if (typeof options.showWeekNumbers === 'boolean')
+            this.showWeekNumbers = options.showWeekNumbers;
+
+        if (typeof options.showISOWeekNumbers === 'boolean')
+            this.showISOWeekNumbers = options.showISOWeekNumbers;
+
+        if (typeof options.buttonClasses === 'string')
+            this.buttonClasses = options.buttonClasses;
+
+        if (typeof options.buttonClasses === 'object')
+            this.buttonClasses = options.buttonClasses.join(' ');
+
+        if (typeof options.showDropdowns === 'boolean')
+            this.showDropdowns = options.showDropdowns;
+
+        if (typeof options.showCustomRangeLabel === 'boolean')
+            this.showCustomRangeLabel = options.showCustomRangeLabel;
+
+        if (typeof options.singleDatePicker === 'boolean') {
+            this.singleDatePicker = options.singleDatePicker;
+            if (this.singleDatePicker)
+                this.endDate = this.startDate.clone();
+        }
+
+        if (typeof options.timePicker === 'boolean')
+            this.timePicker = options.timePicker;
+
+        if (typeof options.timePickerSeconds === 'boolean')
+            this.timePickerSeconds = options.timePickerSeconds;
+
+        if (typeof options.timePickerIncrement === 'number')
+            this.timePickerIncrement = options.timePickerIncrement;
+
+        if (typeof options.timePicker24Hour === 'boolean')
+            this.timePicker24Hour = options.timePicker24Hour;
+
+        if (typeof options.autoApply === 'boolean')
+            this.autoApply = options.autoApply;
+
+        if (typeof options.autoUpdateInput === 'boolean')
+            this.autoUpdateInput = options.autoUpdateInput;
+
+        if (typeof options.linkedCalendars === 'boolean')
+            this.linkedCalendars = options.linkedCalendars;
+
+        if (typeof options.isInvalidDate === 'function')
+            this.isInvalidDate = options.isInvalidDate;
+
+        if (typeof options.isCustomDate === 'function')
+            this.isCustomDate = options.isCustomDate;
+
+        if (typeof options.alwaysShowCalendars === 'boolean')
+            this.alwaysShowCalendars = options.alwaysShowCalendars;
+
+        // update day names order to firstDay
+        if (this.locale.firstDay != 0) {
+            var iterator = this.locale.firstDay;
+            while (iterator > 0) {
+                this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift());
+                iterator--;
+            }
+        }
+
+        var start, end, range;
+
+        //if no start/end dates set, check if an input element contains initial values
+        if (typeof options.startDate === 'undefined' && typeof options.endDate === 'undefined') {
+            if ($(this.element).is('input[type=text]')) {
+                var val = $(this.element).val(),
+                    split = val.split(this.locale.separator);
+
+                start = end = null;
+
+                if (split.length == 2) {
+                    start = moment(split[0], this.locale.format);
+                    end = moment(split[1], this.locale.format);
+                } else if (this.singleDatePicker && val !== "") {
+                    start = moment(val, this.locale.format);
+                    end = moment(val, this.locale.format);
+                }
+                if (start !== null && end !== null) {
+                    this.setStartDate(start);
+                    this.setEndDate(end);
+                }
+            }
+        }
+
+        if (typeof options.ranges === 'object') {
+            var list = '<ul>';
+            for (range of options.ranges) {
+                list += '<li data-range-key="' + range + '">' + range + '</li>';
+            }
+            if (this.showCustomRangeLabel) {
+                list += '<li data-range-key="' + this.locale.customRangeLabel + '">' + this.locale.customRangeLabel + '</li>';
+            }
+            list += '</ul>';
+            this.container.find('.ranges').prepend(list);
+        }
+
+        if (typeof cb === 'function') {
+            this.callback = cb;
+        }
+
+        if (!this.timePicker) {
+            this.startDate = this.startDate.startOf('day');
+            this.endDate = this.endDate.endOf('day');
+            this.container.find('.calendar-time').hide();
+        }
+
+        //can't be used together for now
+        if (this.timePicker && this.autoApply)
+            this.autoApply = false;
+
+        if (this.autoApply && typeof options.ranges !== 'object') {
+            this.container.find('.ranges').hide();
+        } else if (this.autoApply) {
+            this.container.find('.applyBtn, .cancelBtn').addClass('hide');
+        }
+
+        if (this.singleDatePicker) {
+            this.container.addClass('single');
+            this.container.find('.calendar.left').addClass('single');
+            this.container.find('.calendar.left').show();
+            this.container.find('.calendar.right').hide();
+            this.container.find('.daterangepicker_input input, .daterangepicker_input > i').hide();
+            if (this.timePicker) {
+                this.container.find('.ranges ul').hide();
+            } else {
+                this.container.find('.ranges').hide();
+            }
+        }
+
+        if ((typeof options.ranges === 'undefined' && !this.singleDatePicker) || this.alwaysShowCalendars) {
+            this.container.addClass('show-calendar');
+        }
+
+        this.container.addClass('opens' + this.opens);
+
+        //swap the position of the predefined ranges if opens right
+        if (typeof options.ranges !== 'undefined' && this.opens == 'right') {
+            this.container.find('.ranges').prependTo( this.container.find('.calendar.left').parent() );
+        }
+
+        //apply CSS classes and labels to buttons
+        this.container.find('.applyBtn, .cancelBtn').addClass(this.buttonClasses);
+        if (this.applyClass.length)
+            this.container.find('.applyBtn').addClass(this.applyClass);
+        if (this.cancelClass.length)
+            this.container.find('.cancelBtn').addClass(this.cancelClass);
+        this.container.find('.applyBtn').html(this.locale.applyLabel);
+        this.container.find('.cancelBtn').html(this.locale.cancelLabel);
+
+        //
+        // event listeners
+        //
+
+        this.container.find('.calendar')
+            .on('click.daterangepicker', '.prev', $.proxy(this.clickPrev, this))
+            .on('click.daterangepicker', '.next', $.proxy(this.clickNext, this))
+            .on('mousedown.daterangepicker', 'td.available', $.proxy(this.clickDate, this))
+            .on('mouseenter.daterangepicker', 'td.available', $.proxy(this.hoverDate, this))
+            .on('mouseleave.daterangepicker', 'td.available', $.proxy(this.updateFormInputs, this))
+            .on('change.daterangepicker', 'select.yearselect', $.proxy(this.monthOrYearChanged, this))
+            .on('change.daterangepicker', 'select.monthselect', $.proxy(this.monthOrYearChanged, this))
+            .on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.secondselect,select.ampmselect', $.proxy(this.timeChanged, this))
+            .on('click.daterangepicker', '.daterangepicker_input input', $.proxy(this.showCalendars, this))
+            .on('focus.daterangepicker', '.daterangepicker_input input', $.proxy(this.formInputsFocused, this))
+            .on('blur.daterangepicker', '.daterangepicker_input input', $.proxy(this.formInputsBlurred, this))
+            .on('change.daterangepicker', '.daterangepicker_input input', $.proxy(this.formInputsChanged, this));
+
+        this.container.find('.ranges')
+            .on('click.daterangepicker', 'button.applyBtn', $.proxy(this.clickApply, this))
+            .on('click.daterangepicker', 'button.cancelBtn', $.proxy(this.clickCancel, this))
+            .on('click.daterangepicker', 'li', $.proxy(this.clickRange, this))
+            .on('mouseenter.daterangepicker', 'li', $.proxy(this.hoverRange, this))
+            .on('mouseleave.daterangepicker', 'li', $.proxy(this.updateFormInputs, this));
+
+        if (this.element.is('input') || this.element.is('button')) {
+            this.element.on({
+                'click.daterangepicker': $.proxy(this.show, this),
+                'focus.daterangepicker': $.proxy(this.show, this),
+                'keyup.daterangepicker': $.proxy(this.elementChanged, this),
+                'keydown.daterangepicker': $.proxy(this.keydown, this)
+            });
+        } else {
+            this.element.on('click.daterangepicker', $.proxy(this.toggle, this));
+        }
+
+        //
+        // if attached to a text input, set the initial value
+        //
+
+        if (this.element.is('input') && !this.singleDatePicker && this.autoUpdateInput) {
+            this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
+            this.element.trigger('change');
+        } else if (this.element.is('input') && this.autoUpdateInput) {
+            this.element.val(this.startDate.format(this.locale.format));
+            this.element.trigger('change');
+        }
+
+    };
+
+    DateRangePicker.prototype = {
+
+        constructor: DateRangePicker,
+
+        setStartDate: function(startDate) {
+            if (typeof startDate === 'string')
+                this.startDate = moment(startDate, this.locale.format);
+
+            if (typeof startDate === 'object')
+                this.startDate = moment(startDate);
+
+            if (!this.timePicker)
+                this.startDate = this.startDate.startOf('day');
+
+            if (this.timePicker && this.timePickerIncrement)
+                this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
+
+            if (this.minDate && this.startDate.isBefore(this.minDate)) {
+                this.startDate = this.minDate;
+                if (this.timePicker && this.timePickerIncrement)
+                    this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
+            }
+
+            if (this.maxDate && this.startDate.isAfter(this.maxDate)) {
+                this.startDate = this.maxDate;
+                if (this.timePicker && this.timePickerIncrement)
+                    this.startDate.minute(Math.floor(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
+            }
+
+            if (!this.isShowing)
+                this.updateElement();
+
+            this.updateMonthsInView();
+        },
+
+        setEndDate: function(endDate) {
+            if (typeof endDate === 'string')
+                this.endDate = moment(endDate, this.locale.format);
+
+            if (typeof endDate === 'object')
+                this.endDate = moment(endDate);
+
+            if (!this.timePicker)
+                this.endDate = this.endDate.endOf('day');
+
+            if (this.timePicker && this.timePickerIncrement)
+                this.endDate.minute(Math.round(this.endDate.minute() / this.timePickerIncrement) * this.timePickerIncrement);
+
+            if (this.endDate.isBefore(this.startDate))
+                this.endDate = this.startDate.clone();
+
+            if (this.maxDate && this.endDate.isAfter(this.maxDate))
+                this.endDate = this.maxDate;
+
+            if (this.dateLimit && this.startDate.clone().add(this.dateLimit).isBefore(this.endDate))
+                this.endDate = this.startDate.clone().add(this.dateLimit);
+
+            this.previousRightTime = this.endDate.clone();
+
+            if (!this.isShowing)
+                this.updateElement();
+
+            this.updateMonthsInView();
+        },
+
+        isInvalidDate: function() {
+            return false;
+        },
+
+        isCustomDate: function() {
+            return false;
+        },
+
+        updateView: function() {
+            if (this.timePicker) {
+                this.renderTimePicker('left');
+                this.renderTimePicker('right');
+                if (!this.endDate) {
+                    this.container.find('.right .calendar-time select').attr('disabled', 'disabled').addClass('disabled');
+                } else {
+                    this.container.find('.right .calendar-time select').removeAttr('disabled').removeClass('disabled');
+                }
+            }
+            if (this.endDate) {
+                this.container.find('input[name="daterangepicker_end"]').removeClass('active');
+                this.container.find('input[name="daterangepicker_start"]').addClass('active');
+            } else {
+                this.container.find('input[name="daterangepicker_end"]').addClass('active');
+                this.container.find('input[name="daterangepicker_start"]').removeClass('active');
+            }
+            this.updateMonthsInView();
+            this.updateCalendars();
+            this.updateFormInputs();
+        },
+
+        updateMonthsInView: function() {
+            if (this.endDate) {
+
+                //if both dates are visible already, do nothing
+                if (!this.singleDatePicker && this.leftCalendar.month && this.rightCalendar.month &&
+                    (this.startDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.startDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM'))
+                    &&
+                    (this.endDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.endDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM'))
+                    ) {
+                    return;
+                }
+
+                this.leftCalendar.month = this.startDate.clone().date(2);
+                if (!this.linkedCalendars && (this.endDate.month() != this.startDate.month() || this.endDate.year() != this.startDate.year())) {
+                    this.rightCalendar.month = this.endDate.clone().date(2);
+                } else {
+                    this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month');
+                }
+
+            } else {
+                if (this.leftCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM') && this.rightCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM')) {
+                    this.leftCalendar.month = this.startDate.clone().date(2);
+                    this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month');
+                }
+            }
+            if (this.maxDate && this.linkedCalendars && !this.singleDatePicker && this.rightCalendar.month > this.maxDate) {
+              this.rightCalendar.month = this.maxDate.clone().date(2);
+              this.leftCalendar.month = this.maxDate.clone().date(2).subtract(1, 'month');
+            }
+        },
+
+        updateCalendars: function() {
+
+            if (this.timePicker) {
+                var hour, minute, second;
+                if (this.endDate) {
+                    hour = parseInt(this.container.find('.left .hourselect').val(), 10);
+                    minute = parseInt(this.container.find('.left .minuteselect').val(), 10);
+                    second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0;
+                    if (!this.timePicker24Hour) {
+                        var ampm = this.container.find('.left .ampmselect').val();
+                        if (ampm === 'PM' && hour < 12)
+                            hour += 12;
+                        if (ampm === 'AM' && hour === 12)
+                            hour = 0;
+                    }
+                } else {
+                    hour = parseInt(this.container.find('.right .hourselect').val(), 10);
+                    minute = parseInt(this.container.find('.right .minuteselect').val(), 10);
+                    second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0;
+                    if (!this.timePicker24Hour) {
+                        var ampm = this.container.find('.right .ampmselect').val();
+                        if (ampm === 'PM' && hour < 12)
+                            hour += 12;
+                        if (ampm === 'AM' && hour === 12)
+                            hour = 0;
+                    }
+                }
+                this.leftCalendar.month.hour(hour).minute(minute).second(second);
+                this.rightCalendar.month.hour(hour).minute(minute).second(second);
+            }
+
+            this.renderCalendar('left');
+            this.renderCalendar('right');
+
+            //highlight any predefined range matching the current start and end dates
+            this.container.find('.ranges li').removeClass('active');
+            this.chosenLabel = this.container.find('.ranges li:last').addClass('active').html();
+            if (this.endDate == null) return;
+            this.showCalendars();
+        },
+
+        renderCalendar: function(side) {
+
+            //
+            // Build the matrix of dates that will populate the calendar
+            //
+
+            var calendar = side == 'left' ? this.leftCalendar : this.rightCalendar;
+            var month = calendar.month.month();
+            var year = calendar.month.year();
+            var hour = calendar.month.hour();
+            var minute = calendar.month.minute();
+            var second = calendar.month.second();
+            var daysInMonth = moment([year, month]).daysInMonth();
+            var firstDay = moment([year, month, 1]);
+            var lastDay = moment([year, month, daysInMonth]);
+            var lastMonth = moment(firstDay).subtract(1, 'month').month();
+            var lastYear = moment(firstDay).subtract(1, 'month').year();
+            var daysInLastMonth = moment([lastYear, lastMonth]).daysInMonth();
+            var dayOfWeek = firstDay.day();
+
+            //initialize a 6 rows x 7 columns array for the calendar
+            var calendar = [];
+            calendar.firstDay = firstDay;
+            calendar.lastDay = lastDay;
+
+            for (var i = 0; i < 6; i++) {
+                calendar[i] = [];
+            }
+
+            //populate the calendar with date objects
+            var curDate;
+            var startDay = daysInLastMonth - dayOfWeek + this.locale.firstDay + 1;
+            if (startDay == daysInLastMonth + 1)
+                curDate = moment([year, month, 1, 12, minute, second]);
+            else if (startDay > daysInLastMonth )
+                curDate = moment([lastYear, lastMonth, startDay-7, 12, minute, second]);
+            else
+                curDate = moment([lastYear, lastMonth, startDay, 12, minute, second]);
+
+            var col, row;
+            for (var i = 0, col = 0, row = 0; i < 42; i++, col++, curDate = moment(curDate).add(24, 'hour')) {
+                if (i > 0 && col % 7 === 0) {
+                    col = 0;
+                    row++;
+                    if (curDate.month() != month)
+                        break
+                }
+                calendar[row][col] = curDate.clone().hour(hour).minute(minute).second(second);
+                curDate.hour(12);
+
+                if (this.minDate && calendar[row][col].format('YYYY-MM-DD') == this.minDate.format('YYYY-MM-DD') && calendar[row][col].isBefore(this.minDate) && side == 'left') {
+                    calendar[row][col] = this.minDate.clone();
+                }
+
+                if (this.maxDate && calendar[row][col].format('YYYY-MM-DD') == this.maxDate.format('YYYY-MM-DD') && calendar[row][col].isAfter(this.maxDate) && side == 'right') {
+                    calendar[row][col] = this.maxDate.clone();
+                }
+
+            }
+
+            //make the calendar object available to hoverDate/clickDate
+            if (side == 'left') {
+                this.leftCalendar.calendar = calendar;
+            } else {
+                this.rightCalendar.calendar = calendar;
+            }
+
+            //
+            // Display the calendar
+            //
+
+            var minDate = side == 'left' ? this.minDate : this.startDate;
+            var maxDate = this.maxDate;
+            var selected = side == 'left' ? this.startDate : this.endDate;
+            var arrow = this.locale.direction == 'ltr' ? {left: 'chevron-left', right: 'chevron-right'} : {left: 'chevron-right', right: 'chevron-left'};
+
+            var html = '<table class="table-condensed">';
+            html += '<thead>';
+            html += '<tr>';
+
+            // add empty cell for week number
+            if (this.showWeekNumbers || this.showISOWeekNumbers)
+                html += '<th></th>';
+
+            if ((!minDate || minDate.isBefore(calendar.firstDay)) && (!this.linkedCalendars || side == 'left')) {
+                html += '<th class="prev available"><i class="fa fa-' + arrow.left + ' glyphicon glyphicon-' + arrow.left + '"></i></th>';
+            } else {
+                html += '<th></th>';
+            }
+
+            var dateHtml = this.locale.monthNames[calendar[1][1].month()] + " " + calendar[1][1].year();
+
+            if (this.showDropdowns) {
+                var currentMonth = calendar[1][1].month();
+                var currentYear = calendar[1][1].year();
+                var maxYear = (maxDate && maxDate.year()) || (currentYear + 5);
+                var minYear = (minDate && minDate.year()) || (currentYear - 50);
+                var inMinYear = currentYear == minYear;
+                var inMaxYear = currentYear == maxYear;
+
+                var monthHtml = '<select class="monthselect">';
+                for (var m = 0; m < 12; m++) {
+                    if ((!inMinYear || m >= minDate.month()) && (!inMaxYear || m <= maxDate.month())) {
+                        monthHtml += "<option value='" + m + "'" +
+                            (m === currentMonth ? " selected='selected'" : "") +
+                            ">" + this.locale.monthNames[m] + "</option>";
+                    } else {
+                        monthHtml += "<option value='" + m + "'" +
+                            (m === currentMonth ? " selected='selected'" : "") +
+                            " disabled='disabled'>" + this.locale.monthNames[m] + "</option>";
+                    }
+                }
+                monthHtml += "</select>";
+
+                var yearHtml = '<select class="yearselect">';
+                for (var y = minYear; y <= maxYear; y++) {
+                    yearHtml += '<option value="' + y + '"' +
+                        (y === currentYear ? ' selected="selected"' : '') +
+                        '>' + y + '</option>';
+                }
+                yearHtml += '</select>';
+
+                dateHtml = monthHtml + yearHtml;
+            }
+
+            html += '<th colspan="5" class="month">' + dateHtml + '</th>';
+            if ((!maxDate || maxDate.isAfter(calendar.lastDay)) && (!this.linkedCalendars || side == 'right' || this.singleDatePicker)) {
+                html += '<th class="next available"><i class="fa fa-' + arrow.right + ' glyphicon glyphicon-' + arrow.right + '"></i></th>';
+            } else {
+                html += '<th></th>';
+            }
+
+            html += '</tr>';
+            html += '<tr>';
+
+            // add week number label
+            if (this.showWeekNumbers || this.showISOWeekNumbers)
+                html += '<th class="week">' + this.locale.weekLabel + '</th>';
+
+            $.each(this.locale.daysOfWeek, function(index, dayOfWeek) {
+                html += '<th>' + dayOfWeek + '</th>';
+            });
+
+            html += '</tr>';
+            html += '</thead>';
+            html += '<tbody>';
+
+            //adjust maxDate to reflect the dateLimit setting in order to
+            //grey out end dates beyond the dateLimit
+            if (this.endDate == null && this.dateLimit) {
+                var maxLimit = this.startDate.clone().add(this.dateLimit).endOf('day');
+                if (!maxDate || maxLimit.isBefore(maxDate)) {
+                    maxDate = maxLimit;
+                }
+            }
+
+            for (var row = 0; row < 6; row++) {
+                if (calendar[row].length == 0)
+                    continue
+
+                html += '<tr>';
+
+                // add week number
+                if (this.showWeekNumbers)
+                    html += '<td class="week">' + calendar[row][0].week() + '</td>';
+                else if (this.showISOWeekNumbers)
+                    html += '<td class="week">' + calendar[row][0].isoWeek() + '</td>';
+
+                for (var col = 0; col < 7; col++) {
+
+                    var classes = [];
+
+                    //highlight today's date
+                    if (calendar[row][col].isSame(new Date(), "day"))
+                        classes.push('today');
+
+                    //highlight weekends
+                    if (calendar[row][col].isoWeekday() > 5)
+                        classes.push('weekend');
+
+                    //grey out the dates in other months displayed at beginning and end of this calendar
+                    if (calendar[row][col].month() != calendar[1][1].month())
+                        classes.push('off');
+
+                    //don't allow selection of dates before the minimum date
+                    if (this.minDate && calendar[row][col].isBefore(this.minDate, 'day'))
+                        classes.push('off', 'disabled');
+
+                    //don't allow selection of dates after the maximum date
+                    if (maxDate && calendar[row][col].isAfter(maxDate, 'day'))
+                        classes.push('off', 'disabled');
+
+                    //don't allow selection of date if a custom function decides it's invalid
+                    if (this.isInvalidDate(calendar[row][col]))
+                        classes.push('off', 'disabled');
+
+                    //highlight the currently selected start date
+                    if (calendar[row][col].format('YYYY-MM-DD') == this.startDate.format('YYYY-MM-DD'))
+                        classes.push('active', 'start-date');
+
+                    //highlight the currently selected end date
+                    if (this.endDate != null && calendar[row][col].format('YYYY-MM-DD') == this.endDate.format('YYYY-MM-DD'))
+                        classes.push('active', 'end-date');
+
+                    //highlight dates in-between the selected dates
+                    if (this.endDate != null && calendar[row][col] > this.startDate && calendar[row][col] < this.endDate)
+                        classes.push('in-range');
+
+                    //apply custom classes for this date
+                    var isCustom = this.isCustomDate(calendar[row][col]);
+                    if (isCustom !== false) {
+                        if (typeof isCustom === 'string')
+                            classes.push(isCustom);
+                        else
+                            Array.prototype.push.apply(classes, isCustom);
+                    }
+
+                    var cname = '', disabled = false;
+                    for (var i = 0; i < classes.length; i++) {
+                        cname += classes[i] + ' ';
+                        if (classes[i] == 'disabled')
+                            disabled = true;
+                    }
+                    if (!disabled)
+                        cname += 'available';
+
+                    html += '<td class="' + cname.replace(/^\s+|\s+$/g, '') + '" data-title="' + 'r' + row + 'c' + col + '">' + calendar[row][col].date() + '</td>';
+
+                }
+                html += '</tr>';
+            }
+
+            html += '</tbody>';
+            html += '</table>';
+
+            this.container.find('.calendar.' + side + ' .calendar-table').html(html);
+
+        },
+
+        renderTimePicker: function(side) {
+
+            // Don't bother updating the time picker if it's currently disabled
+            // because an end date hasn't been clicked yet
+            if (side == 'right' && !this.endDate) return;
+
+            var html, selected, minDate, maxDate = this.maxDate;
+
+            if (this.dateLimit && (!this.maxDate || this.startDate.clone().add(this.dateLimit).isAfter(this.maxDate)))
+                maxDate = this.startDate.clone().add(this.dateLimit);
+
+            if (side == 'left') {
+                selected = this.startDate.clone();
+                minDate = this.minDate;
+            } else if (side == 'right') {
+                selected = this.endDate.clone();
+                minDate = this.startDate;
+
+                //Preserve the time already selected
+                var timeSelector = this.container.find('.calendar.right .calendar-time div');
+                if (!this.endDate && timeSelector.html() != '') {
+
+                    selected.hour(timeSelector.find('.hourselect option:selected').val() || selected.hour());
+                    selected.minute(timeSelector.find('.minuteselect option:selected').val() || selected.minute());
+                    selected.second(timeSelector.find('.secondselect option:selected').val() || selected.second());
+
+                    if (!this.timePicker24Hour) {
+                        var ampm = timeSelector.find('.ampmselect option:selected').val();
+                        if (ampm === 'PM' && selected.hour() < 12)
+                            selected.hour(selected.hour() + 12);
+                        if (ampm === 'AM' && selected.hour() === 12)
+                            selected.hour(0);
+                    }
+
+                }
+
+                if (selected.isBefore(this.startDate))
+                    selected = this.startDate.clone();
+
+                if (maxDate && selected.isAfter(maxDate))
+                    selected = maxDate.clone();
+
+            }
+
+            //
+            // hours
+            //
+
+            html = '<select class="hourselect">';
+
+            var start = this.timePicker24Hour ? 0 : 1;
+            var end = this.timePicker24Hour ? 23 : 12;
+
+            for (var i = start; i <= end; i++) {
+                var i_in_24 = i;
+                if (!this.timePicker24Hour)
+                    i_in_24 = selected.hour() >= 12 ? (i == 12 ? 12 : i + 12) : (i == 12 ? 0 : i);
+
+                var time = selected.clone().hour(i_in_24);
+                var disabled = false;
+                if (minDate && time.minute(59).isBefore(minDate))
+                    disabled = true;
+                if (maxDate && time.minute(0).isAfter(maxDate))
+                    disabled = true;
+
+                if (i_in_24 == selected.hour() && !disabled) {
+                    html += '<option value="' + i + '" selected="selected">' + i + '</option>';
+                } else if (disabled) {
+                    html += '<option value="' + i + '" disabled="disabled" class="disabled">' + i + '</option>';
+                } else {
+                    html += '<option value="' + i + '">' + i + '</option>';
+                }
+            }
+
+            html += '</select> ';
+
+            //
+            // minutes
+            //
+
+            html += ': <select class="minuteselect">';
+
+            for (var i = 0; i < 60; i += this.timePickerIncrement) {
+                var padded = i < 10 ? '0' + i : i;
+                var time = selected.clone().minute(i);
+
+                var disabled = false;
+                if (minDate && time.second(59).isBefore(minDate))
+                    disabled = true;
+                if (maxDate && time.second(0).isAfter(maxDate))
+                    disabled = true;
+
+                if (selected.minute() == i && !disabled) {
+                    html += '<option value="' + i + '" selected="selected">' + padded + '</option>';
+                } else if (disabled) {
+                    html += '<option value="' + i + '" disabled="disabled" class="disabled">' + padded + '</option>';
+                } else {
+                    html += '<option value="' + i + '">' + padded + '</option>';
+                }
+            }
+
+            html += '</select> ';
+
+            //
+            // seconds
+            //
+
+            if (this.timePickerSeconds) {
+                html += ': <select class="secondselect">';
+
+                for (var i = 0; i < 60; i++) {
+                    var padded = i < 10 ? '0' + i : i;
+                    var time = selected.clone().second(i);
+
+                    var disabled = false;
+                    if (minDate && time.isBefore(minDate))
+                        disabled = true;
+                    if (maxDate && time.isAfter(maxDate))
+                        disabled = true;
+
+                    if (selected.second() == i && !disabled) {
+                        html += '<option value="' + i + '" selected="selected">' + padded + '</option>';
+                    } else if (disabled) {
+                        html += '<option value="' + i + '" disabled="disabled" class="disabled">' + padded + '</option>';
+                    } else {
+                        html += '<option value="' + i + '">' + padded + '</option>';
+                    }
+                }
+
+                html += '</select> ';
+            }
+
+            //
+            // AM/PM
+            //
+
+            if (!this.timePicker24Hour) {
+                html += '<select class="ampmselect">';
+
+                var am_html = '';
+                var pm_html = '';
+
+                if (minDate && selected.clone().hour(12).minute(0).second(0).isBefore(minDate))
+                    am_html = ' disabled="disabled" class="disabled"';
+
+                if (maxDate && selected.clone().hour(0).minute(0).second(0).isAfter(maxDate))
+                    pm_html = ' disabled="disabled" class="disabled"';
+
+                if (selected.hour() >= 12) {
+                    html += '<option value="AM"' + am_html + '>AM</option><option value="PM" selected="selected"' + pm_html + '>PM</option>';
+                } else {
+                    html += '<option value="AM" selected="selected"' + am_html + '>AM</option><option value="PM"' + pm_html + '>PM</option>';
+                }
+
+                html += '</select>';
+            }
+
+            this.container.find('.calendar.' + side + ' .calendar-time div').html(html);
+
+        },
+
+        updateFormInputs: function() {
+
+            //ignore mouse movements while an above-calendar text input has focus
+            if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus"))
+                return;
+
+            this.container.find('input[name=daterangepicker_start]').val(this.startDate.format(this.locale.format));
+            if (this.endDate)
+                this.container.find('input[name=daterangepicker_end]').val(this.endDate.format(this.locale.format));
+
+            if (this.singleDatePicker || (this.endDate && (this.startDate.isBefore(this.endDate) || this.startDate.isSame(this.endDate)))) {
+                this.container.find('button.applyBtn').removeAttr('disabled');
+            } else {
+                this.container.find('button.applyBtn').attr('disabled', 'disabled');
+            }
+
+        },
+
+        move: function() {
+            var parentOffset = { top: 0, left: 0 },
+                containerTop;
+            var parentRightEdge = $(window).width();
+            if (!this.parentEl.is('body')) {
+                parentOffset = {
+                    top: this.parentEl.offset().top - this.parentEl.scrollTop(),
+                    left: this.parentEl.offset().left - this.parentEl.scrollLeft()
+                };
+                parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left;
+            }
+
+            if (this.drops == 'up')
+                containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top;
+            else
+                containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top;
+            this.container[this.drops == 'up' ? 'addClass' : 'removeClass']('dropup');
+
+            if (this.opens == 'left') {
+                this.container.css({
+                    top: containerTop,
+                    right: parentRightEdge - this.element.offset().left - this.element.outerWidth(),
+                    left: 'auto'
+                });
+                if (this.container.offset().left < 0) {
+                    this.container.css({
+                        right: 'auto',
+                        left: 9
+                    });
+                }
+            } else if (this.opens == 'center') {
+                this.container.css({
+                    top: containerTop,
+                    left: this.element.offset().left - parentOffset.left + this.element.outerWidth() / 2
+                            - this.container.outerWidth() / 2,
+                    right: 'auto'
+                });
+                if (this.container.offset().left < 0) {
+                    this.container.css({
+                        right: 'auto',
+                        left: 9
+                    });
+                }
+            } else {
+                this.container.css({
+                    top: containerTop,
+                    left: this.element.offset().left - parentOffset.left,
+                    right: 'auto'
+                });
+                if (this.container.offset().left + this.container.outerWidth() > $(window).width()) {
+                    this.container.css({
+                        left: 'auto',
+                        right: 0
+                    });
+                }
+            }
+        },
+
+        show: function(e) {
+            if (this.isShowing) return;
+
+            // Create a click proxy that is private to this instance of datepicker, for unbinding
+            this._outsideClickProxy = $.proxy(function(e) { this.outsideClick(e); }, this);
+
+            // Bind global datepicker mousedown for hiding and
+            $(document)
+              .on('mousedown.daterangepicker', this._outsideClickProxy)
+              // also support mobile devices
+              .on('touchend.daterangepicker', this._outsideClickProxy)
+              // also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them
+              .on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy)
+              // and also close when focus changes to outside the picker (eg. tabbing between controls)
+              .on('focusin.daterangepicker', this._outsideClickProxy);
+
+            // Reposition the picker if the window is resized while it's open
+            $(window).on('resize.daterangepicker', $.proxy(function(e) { this.move(e); }, this));
+
+            this.oldStartDate = this.startDate.clone();
+            this.oldEndDate = this.endDate.clone();
+            this.previousRightTime = this.endDate.clone();
+
+            this.updateView();
+            this.container.show();
+            this.move();
+            this.element.trigger('show.daterangepicker', this);
+            this.isShowing = true;
+        },
+
+        hide: function(e) {
+            if (!this.isShowing) return;
+
+            //incomplete date selection, revert to last values
+            if (!this.endDate) {
+                this.startDate = this.oldStartDate.clone();
+                this.endDate = this.oldEndDate.clone();
+            }
+
+            //if a new date range was selected, invoke the user callback function
+            if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate))
+                this.callback(this.startDate, this.endDate, this.chosenLabel);
+
+            //if picker is attached to a text input, update it
+            this.updateElement();
+
+            $(document).off('.daterangepicker');
+            $(window).off('.daterangepicker');
+            this.container.hide();
+            this.element.trigger('hide.daterangepicker', this);
+            this.isShowing = false;
+        },
+
+        toggle: function(e) {
+            if (this.isShowing) {
+                this.hide();
+            } else {
+                this.show();
+            }
+        },
+
+        outsideClick: function(e) {
+            var target = $(e.target);
+            // if the page is clicked anywhere except within the daterangerpicker/button
+            // itself then call this.hide()
+            if (
+                // ie modal dialog fix
+                e.type == "focusin" ||
+                target.closest(this.element).length ||
+                target.closest(this.container).length ||
+                target.closest('.calendar-table').length
+                ) return;
+            this.hide();
+            this.element.trigger('outsideClick.daterangepicker', this);
+        },
+
+        showCalendars: function() {
+            this.container.addClass('show-calendar');
+            this.move();
+            this.element.trigger('showCalendar.daterangepicker', this);
+        },
+
+        hideCalendars: function() {
+            this.container.removeClass('show-calendar');
+            this.element.trigger('hideCalendar.daterangepicker', this);
+        },
+
+        hoverRange: function(e) {
+            //ignore mouse movements while an above-calendar text input has focus
+            if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus"))
+                return;
+
+            var label = e.target.getAttribute('data-range-key');
+
+            if (label == this.locale.customRangeLabel) {
+                this.updateView();
+            } else {
+                var Utils = require('utils/Utils');
+                var dates = Utils.dateUtil.getRelativeDateFromString(label);
+                this.container.find('input[name=daterangepicker_start]').val(dates[0].format(this.locale.format));
+                this.container.find('input[name=daterangepicker_end]').val(dates[1].format(this.locale.format));
+            }
+
+        },
+
+        clickRange: function(e) {
+            var label = e.target.getAttribute('data-range-key');
+            this.chosenLabel = label;
+            if (label == this.locale.customRangeLabel) {
+                this.showCalendars();
+            } else {
+                var Utils = require('utils/Utils');
+                var dates = Utils.dateUtil.getRelativeDateFromString(label);
+                this.startDate = dates[0];
+                this.endDate = dates[1];
+
+                if (!this.timePicker) {
+                    this.startDate.startOf('day');
+                    this.endDate.endOf('day');
+                }
+
+                if (!this.alwaysShowCalendars)
+                    this.hideCalendars();
+                this.clickApply();
+            }
+        },
+
+        clickPrev: function(e) {
+            var cal = $(e.target).parents('.calendar');
+            if (cal.hasClass('left')) {
+                this.leftCalendar.month.subtract(1, 'month');
+                if (this.linkedCalendars)
+                    this.rightCalendar.month.subtract(1, 'month');
+            } else {
+                this.rightCalendar.month.subtract(1, 'month');
+            }
+            this.updateCalendars();
+        },
+
+        clickNext: function(e) {
+            var cal = $(e.target).parents('.calendar');
+            if (cal.hasClass('left')) {
+                this.leftCalendar.month.add(1, 'month');
+            } else {
+                this.rightCalendar.month.add(1, 'month');
+                if (this.linkedCalendars)
+                    this.leftCalendar.month.add(1, 'month');
+            }
+            this.updateCalendars();
+        },
+
+        hoverDate: function(e) {
+
+            //ignore mouse movements while an above-calendar text input has focus
+            //if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus"))
+            //    return;
+
+            //ignore dates that can't be selected
+            if (!$(e.target).hasClass('available')) return;
+
+            //have the text inputs above calendars reflect the date being hovered over
+            var title = $(e.target).attr('data-title');
+            var row = title.substr(1, 1);
+            var col = title.substr(3, 1);
+            var cal = $(e.target).parents('.calendar');
+            var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col];
+
+            if (this.endDate && !this.container.find('input[name=daterangepicker_start]').is(":focus")) {
+                this.container.find('input[name=daterangepicker_start]').val(date.format(this.locale.format));
+            } else if (!this.endDate && !this.container.find('input[name=daterangepicker_end]').is(":focus")) {
+                this.container.find('input[name=daterangepicker_end]').val(date.format(this.locale.format));
+            }
+
+            //highlight the dates between the start date and the date being hovered as a potential end date
+            var leftCalendar = this.leftCalendar;
+            var rightCalendar = this.rightCalendar;
+            var startDate = this.startDate;
+            if (!this.endDate) {
+                this.container.find('.calendar td').each(function(index, el) {
+
+                    //skip week numbers, only look at dates
+                    if ($(el).hasClass('week')) return;
+
+                    var title = $(el).attr('data-title');
+                    var row = title.substr(1, 1);
+                    var col = title.substr(3, 1);
+                    var cal = $(el).parents('.calendar');
+                    var dt = cal.hasClass('left') ? leftCalendar.calendar[row][col] : rightCalendar.calendar[row][col];
+
+                    if ((dt.isAfter(startDate) && dt.isBefore(date)) || dt.isSame(date, 'day')) {
+                        $(el).addClass('in-range');
+                    } else {
+                        $(el).removeClass('in-range');
+                    }
+
+                });
+            }
+
+        },
+
+        clickDate: function(e) {
+
+            if (!$(e.target).hasClass('available')) return;
+
+            var title = $(e.target).attr('data-title');
+            var row = title.substr(1, 1);
+            var col = title.substr(3, 1);
+            var cal = $(e.target).parents('.calendar');
+            var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col];
+
+            //
+            // this function needs to do a few things:
+            // * alternate between selecting a start and end date for the range,
+            // * if the time picker is enabled, apply the hour/minute/second from the select boxes to the clicked date
+            // * if autoapply is enabled, and an end date was chosen, apply the selection
+            // * if single date picker mode, and time picker isn't enabled, apply the selection immediately
+            // * if one of the inputs above the calendars was focused, cancel that manual input
+            //
+
+            if (this.endDate || date.isBefore(this.startDate, 'day')) { //picking start
+                if (this.timePicker) {
+                    var hour = parseInt(this.container.find('.left .hourselect').val(), 10);
+                    if (!this.timePicker24Hour) {
+                        var ampm = this.container.find('.left .ampmselect').val();
+                        if (ampm === 'PM' && hour < 12)
+                            hour += 12;
+                        if (ampm === 'AM' && hour === 12)
+                            hour = 0;
+                    }
+                    var minute = parseInt(this.container.find('.left .minuteselect').val(), 10);
+                    var second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0;
+                    date = date.clone().hour(hour).minute(minute).second(second);
+                }
+                this.endDate = null;
+                this.setStartDate(date.clone());
+            } else if (!this.endDate && date.isBefore(this.startDate)) {
+                //special case: clicking the same date for start/end,
+                //but the time of the end date is before the start date
+                this.setEndDate(this.startDate.clone());
+            } else { // picking end
+                if (this.timePicker) {
+                    var hour = parseInt(this.container.find('.right .hourselect').val(), 10);
+                    if (!this.timePicker24Hour) {
+                        var ampm = this.container.find('.right .ampmselect').val();
+                        if (ampm === 'PM' && hour < 12)
+                            hour += 12;
+                        if (ampm === 'AM' && hour === 12)
+                            hour = 0;
+                    }
+                    var minute = parseInt(this.container.find('.right .minuteselect').val(), 10);
+                    var second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0;
+                    date = date.clone().hour(hour).minute(minute).second(second);
+                }
+                this.setEndDate(date.clone());
+                if (this.autoApply) {
+                  this.showCalendars();
+                  this.clickApply();
+                }
+            }
+
+            if (this.singleDatePicker) {
+                this.setEndDate(this.startDate);
+                if (!this.timePicker)
+                    this.clickApply();
+            }
+
+            this.updateView();
+
+            //This is to cancel the blur event handler if the mouse was in one of the inputs
+            e.stopPropagation();
+
+        },
+
+        clickApply: function(e) {
+            this.hide();
+            this.element.trigger('apply.daterangepicker', this);
+        },
+
+        clickCancel: function(e) {
+            this.startDate = this.oldStartDate;
+            this.endDate = this.oldEndDate;
+            this.hide();
+            this.element.trigger('cancel.daterangepicker', this);
+        },
+
+        monthOrYearChanged: function(e) {
+            var isLeft = $(e.target).closest('.calendar').hasClass('left'),
+                leftOrRight = isLeft ? 'left' : 'right',
+                cal = this.container.find('.calendar.'+leftOrRight);
+
+            // Month must be Number for new moment versions
+            var month = parseInt(cal.find('.monthselect').val(), 10);
+            var year = cal.find('.yearselect').val();
+
+            if (!isLeft) {
+                if (year < this.startDate.year() || (year == this.startDate.year() && month < this.startDate.month())) {
+                    month = this.startDate.month();
+                    year = this.startDate.year();
+                }
+            }
+
+            if (this.minDate) {
+                if (year < this.minDate.year() || (year == this.minDate.year() && month < this.minDate.month())) {
+                    month = this.minDate.month();
+                    year = this.minDate.year();
+                }
+            }
+
+            if (this.maxDate) {
+                if (year > this.maxDate.year() || (year == this.maxDate.year() && month > this.maxDate.month())) {
+                    month = this.maxDate.month();
+                    year = this.maxDate.year();
+                }
+            }
+
+            if (isLeft) {
+                this.leftCalendar.month.month(month).year(year);
+                if (this.linkedCalendars)
+                    this.rightCalendar.month = this.leftCalendar.month.clone().add(1, 'month');
+            } else {
+                this.rightCalendar.month.month(month).year(year);
+                if (this.linkedCalendars)
+                    this.leftCalendar.month = this.rightCalendar.month.clone().subtract(1, 'month');
+            }
+            this.updateCalendars();
+        },
+
+        timeChanged: function(e) {
+
+            var cal = $(e.target).closest('.calendar'),
+                isLeft = cal.hasClass('left');
+
+            var hour = parseInt(cal.find('.hourselect').val(), 10);
+            var minute = parseInt(cal.find('.minuteselect').val(), 10);
+            var second = this.timePickerSeconds ? parseInt(cal.find('.secondselect').val(), 10) : 0;
+
+            if (!this.timePicker24Hour) {
+                var ampm = cal.find('.ampmselect').val();
+                if (ampm === 'PM' && hour < 12)
+                    hour += 12;
+                if (ampm === 'AM' && hour === 12)
+                    hour = 0;
+            }
+
+            if (isLeft) {
+                var start = this.startDate.clone();
+                start.hour(hour);
+                start.minute(minute);
+                start.second(second);
+                this.setStartDate(start);
+                if (this.singleDatePicker) {
+                    this.endDate = this.startDate.clone();
+                } else if (this.endDate && this.endDate.format('YYYY-MM-DD') == start.format('YYYY-MM-DD') && this.endDate.isBefore(start)) {
+                    this.setEndDate(start.clone());
+                }
+            } else if (this.endDate) {
+                var end = this.endDate.clone();
+                end.hour(hour);
+                end.minute(minute);
+                end.second(second);
+                this.setEndDate(end);
+            }
+
+            //update the calendars so all clickable dates reflect the new time component
+            this.updateCalendars();
+
+            //update the form inputs above the calendars with the new time
+            this.updateFormInputs();
+
+            //re-render the time pickers because changing one selection can affect what's enabled in another
+            this.renderTimePicker('left');
+            this.renderTimePicker('right');
+
+        },
+
+        formInputsChanged: function(e) {
+            var isRight = $(e.target).closest('.calendar').hasClass('right');
+            var start = moment(this.container.find('input[name="daterangepicker_start"]').val(), this.locale.format);
+            var end = moment(this.container.find('input[name="daterangepicker_end"]').val(), this.locale.format);
+
+            if (start.isValid() && end.isValid()) {
+
+                if (isRight && end.isBefore(start))
+                    start = end.clone();
+
+                this.setStartDate(start);
+                this.setEndDate(end);
+
+                if (isRight) {
+                    this.container.find('input[name="daterangepicker_start"]').val(this.startDate.format(this.locale.format));
+                } else {
+                    this.container.find('input[name="daterangepicker_end"]').val(this.endDate.format(this.locale.format));
+                }
+
+            }
+
+            this.updateView();
+        },
+
+        formInputsFocused: function(e) {
+
+            // Highlight the focused input
+            this.container.find('input[name="daterangepicker_start"], input[name="daterangepicker_end"]').removeClass('active');
+            $(e.target).addClass('active');
+
+            // Set the state such that if the user goes back to using a mouse, 
+            // the calendars are aware we're selecting the end of the range, not
+            // the start. This allows someone to edit the end of a date range without
+            // re-selecting the beginning, by clicking on the end date input then
+            // using the calendar.
+            var isRight = $(e.target).closest('.calendar').hasClass('right');
+            if (isRight) {
+                this.endDate = null;
+                this.setStartDate(this.startDate.clone());
+                this.updateView();
+            }
+
+        },
+
+        formInputsBlurred: function(e) {
+
+            // this function has one purpose right now: if you tab from the first
+            // text input to the second in the UI, the endDate is nulled so that
+            // you can click another, but if you tab out without clicking anything
+            // or changing the input value, the old endDate should be retained
+
+            if (!this.endDate) {
+                var val = this.container.find('input[name="daterangepicker_end"]').val();
+                var end = moment(val, this.locale.format);
+                if (end.isValid()) {
+                    this.setEndDate(end);
+                    this.updateView();
+                }
+            }
+
+        },
+
+        elementChanged: function() {
+            if (!this.element.is('input')) return;
+            if (!this.element.val().length) return;
+            if (this.element.val().length < this.locale.format.length) return;
+
+            var dateString = this.element.val().split(this.locale.separator),
+                start = null,
+                end = null;
+
+            if (dateString.length === 2) {
+                start = moment(dateString[0], this.locale.format);
+                end = moment(dateString[1], this.locale.format);
+            }
+
+            if (this.singleDatePicker || start === null || end === null) {
+                start = moment(this.element.val(), this.locale.format);
+                end = start;
+            }
+
+            if (!start.isValid() || !end.isValid()) return;
+
+            this.setStartDate(start);
+            this.setEndDate(end);
+            this.updateView();
+        },
+
+        keydown: function(e) {
+            //hide on tab or enter
+            if ((e.keyCode === 9) || (e.keyCode === 13)) {
+                this.hide();
+            }
+        },
+
+        updateElement: function() {
+            if (this.element.is('input') && !this.singleDatePicker && this.autoUpdateInput) {
+                this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format));
+                this.element.trigger('change');
+            } else if (this.element.is('input') && this.autoUpdateInput) {
+                this.element.val(this.startDate.format(this.locale.format));
+                this.element.trigger('change');
+            }
+        },
+
+        remove: function() {
+            this.container.remove();
+            this.element.off('.daterangepicker');
+            this.element.removeData();
+        }
+
+    };
+
+    $.fn.daterangepicker = function(options, callback) {
+        this.each(function() {
+            var el = $(this);
+            if (el.data('daterangepicker'))
+                el.data('daterangepicker').remove();
+            el.data('daterangepicker', new DateRangePicker(el, options, callback));
+        });
+        return this;
+    };
+
+    return DateRangePicker;
+
+}));


[50/51] [abbrv] ambari git commit: AMBARI-19907. On certain actions, there's no feedback from the UI when API takes a long time to respond - not reassuring and the user is encouraged to keep triggering the same heavy action to make the problem worse. (vs

Posted by rz...@apache.org.
AMBARI-19907. On certain actions, there's no feedback from the UI when API takes a long time to respond - not reassuring and the user is encouraged to keep triggering the same heavy action to make the problem worse. (vsubramanian)

Change-Id: Ia87a2c9b5e16f487be32dcf7232728c1458eaf27


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: c77ca2e55c64f8ec657230c54917112606900b45
Parents: 6e2a285
Author: Vivek Ratnavel Subramanian <vi...@gmail.com>
Authored: Tue Feb 7 18:13:21 2017 -0800
Committer: Vivek Ratnavel Subramanian <vi...@gmail.com>
Committed: Tue Feb 7 18:13:21 2017 -0800

----------------------------------------------------------------------
 .../main/host/bulk_operations_controller.js     | 33 ++++++++------------
 ambari-web/app/controllers/main/host/details.js | 24 +++++++++-----
 ambari-web/app/controllers/main/service.js      | 12 ++++---
 ambari-web/app/controllers/main/service/item.js | 30 ++++++++++++------
 ambari-web/app/utils/ajax/ajax.js               | 17 +++++++++-
 .../app/utils/batch_scheduled_requests.js       |  6 ++--
 .../test/controllers/main/service_test.js       |  6 ++--
 7 files changed, 81 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c77ca2e5/ambari-web/app/controllers/main/host/bulk_operations_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/bulk_operations_controller.js b/ambari-web/app/controllers/main/host/bulk_operations_controller.js
index 0e73c0c..a43f9f1 100644
--- a/ambari-web/app/controllers/main/host/bulk_operations_controller.js
+++ b/ambari-web/app/controllers/main/host/bulk_operations_controller.js
@@ -252,7 +252,8 @@ App.BulkOperationsController = Em.Controller.extend({
           context: operationData.message,
           noOpsMessage: Em.I18n.t('hosts.host.maintainance.reinstallFailedComponents.context')
         },
-        success: 'bulkOperationForHostComponentsSuccessCallback'
+        success: 'bulkOperationForHostComponentsSuccessCallback',
+        showLoadingPopup: true
       });
     });
   },
@@ -274,7 +275,8 @@ App.BulkOperationsController = Em.Controller.extend({
           hosts: hosts.mapProperty('hostName')
         },
         success: 'bulkOperationForHostsDeleteDryRunCallback',
-        error: 'bulkOperationForHostsDeleteDryRunCallback'
+        error: 'bulkOperationForHostsDeleteDryRunCallback',
+        showLoadingPopup: true
       });
     });
   },
@@ -371,7 +373,8 @@ App.BulkOperationsController = Em.Controller.extend({
               hosts: hosts.mapProperty('deleted.key')
             },
             success: 'bulkOperationForHostsDeleteCallback',
-            error: 'bulkOperationForHostsDeleteCallback'
+            error: 'bulkOperationForHostsDeleteCallback',
+            showLoadingPopup: true
           });
         },
         bodyClass: Em.View.extend({
@@ -623,7 +626,8 @@ App.BulkOperationsController = Em.Controller.extend({
           }),
           context: operationData.message + ' ' + operationData.componentNameFormatted,
         },
-        success: 'bulkOperationForHostComponentsAddSuccessCallback'
+        success: 'bulkOperationForHostComponentsAddSuccessCallback',
+        showLoadingPopup: true
       });
     });
   },
@@ -932,28 +936,19 @@ App.BulkOperationsController = Em.Controller.extend({
       return;
     }
 
-    var loadingPopup = App.ModalPopup.show({
-      header: Em.I18n.t('jobs.loadingTasks'),
-      primary: false,
-      secondary: false,
-      bodyClass: Em.View.extend({
-        template: Em.Handlebars.compile('{{view App.SpinnerView}}')
-      })
-    });
-
-    this.getHostsForBulkOperations(queryParams, operationData, loadingPopup);
+    this.getHostsForBulkOperations(queryParams, operationData);
   },
 
-  getHostsForBulkOperations: function (queryParams, operationData, loadingPopup) {
+  getHostsForBulkOperations: function (queryParams, operationData) {
     return App.ajax.send({
       name: 'hosts.bulk.operations',
       sender: this,
       data: {
         parameters: App.router.get('updateController').computeParameters(queryParams),
-        operationData: operationData,
-        loadingPopup: loadingPopup
+        operationData: operationData
       },
-      success: 'getHostsForBulkOperationSuccessCallback'
+      success: 'getHostsForBulkOperationSuccessCallback',
+      showLoadingPopup: true
     });
   },
 
@@ -979,8 +974,6 @@ App.BulkOperationsController = Em.Controller.extend({
       return;
     }
 
-    Em.tryInvoke(param.loadingPopup, 'hide');
-
     if ('SET_RACK_INFO' === operationData.action) {
       return self.bulkOperation(operationData, hosts);
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/c77ca2e5/ambari-web/app/controllers/main/host/details.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/host/details.js b/ambari-web/app/controllers/main/host/details.js
index f040db5..d9bf401 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -192,7 +192,8 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
       sender: this,
       data: data,
       success: 'sendComponentCommandSuccessCallback',
-      error: 'ajaxErrorCallback'
+      error: 'ajaxErrorCallback',
+      showLoadingPopup: true
     });
   },
 
@@ -435,7 +436,8 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
         hostName: this.get('content.hostName')
       },
       success: '_doDeleteHostComponentSuccessCallback',
-      error: '_doDeleteHostComponentErrorCallback'
+      error: '_doDeleteHostComponentErrorCallback',
+      showLoadingPopup: true
     }).then(callback, callback);
   },
 
@@ -1294,7 +1296,8 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
         resource_filters: resource_filters,
         context: context
       },
-      success: 'refreshComponentConfigsSuccessCallback'
+      success: 'refreshComponentConfigsSuccessCallback',
+      showLoadingPopup: true
     });
   },
 
@@ -1484,7 +1487,8 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
                 }
               },
               success: 'installComponentSuccessCallback',
-              error: 'ajaxErrorCallback'
+              error: 'ajaxErrorCallback',
+              showLoadingPopup: true
             });
           })
         });
@@ -1590,7 +1594,8 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
         slaveType: slaveType
       },
       success: 'decommissionSuccessCallback',
-      error: 'decommissionErrorCallback'
+      error: 'decommissionErrorCallback',
+      showLoadingPopup: true
     });
   },
 
@@ -1773,7 +1778,8 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
         batches: batches
       },
       success: 'decommissionSuccessCallback',
-      error: 'decommissionErrorCallback'
+      error: 'decommissionErrorCallback',
+      showLoadingPopup: true
     });
   },
 
@@ -1880,7 +1886,8 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
         batches: batches
       },
       success: 'decommissionSuccessCallback',
-      error: 'decommissionErrorCallback'
+      error: 'decommissionErrorCallback',
+      showLoadingPopup: true
     });
   },
 
@@ -2279,7 +2286,8 @@ App.MainHostDetailsController = Em.Controller.extend(App.SupportClientConfigsDow
           },
           callback: completeCallback,
           success: 'deleteHostSuccessCallback',
-          error: 'deleteHostErrorCallback'
+          error: 'deleteHostErrorCallback',
+          showLoadingPopup: true
         });
       }
       else {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c77ca2e5/ambari-web/app/controllers/main/service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service.js b/ambari-web/app/controllers/main/service.js
index e434d41..5dfc176 100644
--- a/ambari-web/app/controllers/main/service.js
+++ b/ambari-web/app/controllers/main/service.js
@@ -171,7 +171,8 @@ App.MainServiceController = Em.ArrayController.extend(App.SupportClientConfigsDo
         query: query
       },
       success: 'allServicesCallSuccessCallback',
-      error: 'allServicesCallErrorCallback'
+      error: 'allServicesCallErrorCallback',
+      showLoadingPopup: true
     });
   },
 
@@ -196,7 +197,8 @@ App.MainServiceController = Em.ArrayController.extend(App.SupportClientConfigsDo
           state: 'INSTALLED'
         }
       },
-      success: 'silentStopSuccess'
+      success: 'silentStopSuccess',
+      showLoadingPopup: true
     });
   },
 
@@ -246,7 +248,8 @@ App.MainServiceController = Em.ArrayController.extend(App.SupportClientConfigsDo
             state: 'STARTED'
           }
         },
-        success: 'silentCallSuccessCallback'
+        success: 'silentCallSuccessCallback',
+        showLoadingPopup: true
       });
     }
   }.observes('shouldStart', 'controllers.backgroundOperationsController.allOperationsCount'),
@@ -333,7 +336,8 @@ App.MainServiceController = Em.ArrayController.extend(App.SupportClientConfigsDo
     App.ajax.send({
       name: 'restart.staleConfigs',
       sender: this,
-      success: 'restartAllRequiredSuccessCallback'
+      success: 'restartAllRequiredSuccessCallback',
+      showLoadingPopup: true
     });
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c77ca2e5/ambari-web/app/controllers/main/service/item.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/item.js b/ambari-web/app/controllers/main/service/item.js
index 6f1efd8..e8942a4 100644
--- a/ambari-web/app/controllers/main/service/item.js
+++ b/ambari-web/app/controllers/main/service/item.js
@@ -482,7 +482,8 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
       'sender': this,
       'success': 'startStopPopupSuccessCallback',
       'error': 'startStopPopupErrorCallback',
-      'data': data
+      'data': data,
+      'showLoadingPopup': true
     });
   },
 
@@ -538,7 +539,8 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
         forceRefreshConfigTags : "capacity-scheduler"
       },
       success : 'refreshYarnQueuesSuccessCallback',
-      error : 'refreshYarnQueuesErrorCallback'
+      error : 'refreshYarnQueuesErrorCallback',
+      showLoadingPopup: true
     });
     });
   },
@@ -583,7 +585,8 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
           componentName: "KNOX_GATEWAY"
         },
         success: 'startStopLdapKnoxSuccessCallback',
-        error: 'startStopLdapKnoxErrorCallback'
+        error: 'startStopLdapKnoxErrorCallback',
+        showLoadingPopup: true
       });
     });
   },
@@ -630,7 +633,8 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
         componentName: "HIVE_SERVER_INTERACTIVE"
       },
       success: 'requestSuccessCallback',
-      error: 'requestErrorCallback'
+      error: 'requestErrorCallback',
+      showLoadingPopup: true
     });
   },
 
@@ -675,7 +679,8 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
         batches: batches
       },
       success: 'requestSuccessCallback',
-      error: 'requestErrorCallback'
+      error: 'requestErrorCallback',
+      showLoadingPopup: true
     });
   },
 
@@ -727,7 +732,8 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
             threshold: this.get('inputValue')
           },
           success : 'rebalanceHdfsNodesSuccessCallback',
-          error : 'rebalanceHdfsNodesErrorCallback'
+          error : 'rebalanceHdfsNodesErrorCallback',
+          showLoadingPopup: true
         });
         this.hide();
       },
@@ -852,7 +858,8 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
       'sender': this,
       'success':'runSmokeTestSuccessCallBack',
       'error':'runSmokeTestErrorCallBack',
-      'data': requestData
+      'data': requestData,
+      showLoadingPopup: true
     });
   },
 
@@ -1129,7 +1136,8 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
           componentName : context.component
         },
         success : 'executeCustomCommandSuccessCallback',
-        error : 'executeCustomCommandErrorCallback'
+        error : 'executeCustomCommandErrorCallback',
+        showLoadingPopup: true
       });
     });
   },
@@ -1153,7 +1161,8 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
           forceRefreshConfigTags : "capacity-scheduler"
         },
         success : 'executeCustomCommandSuccessCallback',
-        error : 'executeCustomCommandErrorCallback'
+        error : 'executeCustomCommandErrorCallback',
+        showLoadingPopup: true
       });
     });
   },
@@ -1577,7 +1586,8 @@ App.MainServiceItemController = Em.Controller.extend(App.SupportClientConfigsDow
         servicesToDeleteNext: servicesToDeleteNext
       },
       success : 'deleteServiceCallSuccessCallback',
-      error: 'deleteServiceCallErrorCallback'
+      error: 'deleteServiceCallErrorCallback',
+      showLoadingPopup: true
     });
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c77ca2e5/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 2ea6113..82fa34f 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -3103,13 +3103,25 @@ var ajax = Em.Object.extend({
       return null;
     }
 
+    var loadingPopup = null;
+    if(config.hasOwnProperty("showLoadingPopup") && config.showLoadingPopup === true) {
+      loadingPopup = App.ModalPopup.show({
+        header: Em.I18n.t('jobs.loadingTasks'),
+        primary: false,
+        secondary: false,
+        bodyClass: Em.View.extend({
+          template: Em.Handlebars.compile('{{view App.SpinnerView}}')
+        })
+      });
+    }
+
     // default parameters
     var params = {
       clusterName: (App.get('clusterName') || App.clusterStatus.get('clusterName'))
     };
 
     // extend default parameters with provided
-    if (config.data) {
+    if (config.hasOwnProperty("data") && config.data) {
       jQuery.extend(params, config.data);
     }
 
@@ -3152,6 +3164,9 @@ var ajax = Em.Object.extend({
       }
     };
     opt.complete = function () {
+      if(loadingPopup) {
+        Em.tryInvoke(loadingPopup, 'hide');
+      }
       App.logger.logTimerIfMoreThan(consoleMsg, 1000);
       if (config.callback) {
         config.callback();

http://git-wip-us.apache.org/repos/asf/ambari/blob/c77ca2e5/ambari-web/app/utils/batch_scheduled_requests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/batch_scheduled_requests.js b/ambari-web/app/utils/batch_scheduled_requests.js
index b8ae955..6d1e721 100644
--- a/ambari-web/app/utils/batch_scheduled_requests.js
+++ b/ambari-web/app/utils/batch_scheduled_requests.js
@@ -244,7 +244,8 @@ module.exports = {
           operation_level: operation_level
         },
         success: 'successCallback',
-        error: 'errorCallback'
+        error: 'errorCallback',
+        showLoadingPopup: true
       });
     }
   },
@@ -318,7 +319,8 @@ module.exports = {
         batches: this.getBatchesForRollingRestartRequest(restartHostComponents, batchSize)
       },
       success: 'successCallback',
-      error: 'errorCallback'
+      error: 'errorCallback',
+      showLoadingPopup: true
     });
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c77ca2e5/ambari-web/test/controllers/main/service_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service_test.js b/ambari-web/test/controllers/main/service_test.js
index d8c3365..7ed7641 100644
--- a/ambari-web/test/controllers/main/service_test.js
+++ b/ambari-web/test/controllers/main/service_test.js
@@ -462,7 +462,8 @@ describe('App.MainServiceController', function () {
             state: 'INSTALLED'
           }
         },
-        success: 'silentStopSuccess'
+        success: 'silentStopSuccess',
+        showLoadingPopup: true
       });
     });
   });
@@ -598,7 +599,8 @@ describe('App.MainServiceController', function () {
             state: 'STARTED'
           }
         },
-        success: 'silentCallSuccessCallback'
+        success: 'silentCallSuccessCallback',
+        showLoadingPopup: true
       });
       expect(mainServiceController.get('shouldStart')).to.be.false;
     });


[44/51] [abbrv] ambari git commit: AMBARI-19882. Search in recent projects should also search in path and search should be case insensitive (Venkata Sairam via pallavkul)

Posted by rz...@apache.org.
AMBARI-19882. Search in recent projects should also search in path and search should be case insensitive (Venkata Sairam via pallavkul)

(cherry picked from commit f2518aeed0d0bcf01bd1c471d746f2764f628ee9)

Change-Id: Ic8c014e6471bc94142dfc4818025b9f4ee53c538


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 5ab3e4278b722316e331987501d215eb37253595
Parents: 168f264
Author: pallavkul <pa...@gmail.com>
Authored: Tue Feb 7 17:45:42 2017 +0530
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 08:49:15 2017 -0800

----------------------------------------------------------------------
 .../resources/ui/app/components/drafts-wf.js    | 53 +++++++-------------
 .../ui/app/templates/components/drafts-wf.hbs   | 19 +++----
 2 files changed, 23 insertions(+), 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5ab3e427/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
index 33533db..86c8dc9 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
@@ -25,42 +25,23 @@ export default Ember.Component.extend({
   "isWorkflow": true,
   "sortProp": ['updatedAt:desc'],
   "filteredModels": Ember.computed("model", "search", "isBundle", "isCoordinator", "isWorkflow", function(){
-	Ember.run.later(()=>{
-      this.$('.actions').hide();
-    }, 10);
-  	var condition = "", condition1 = "", condition2 = "", searchTxt = this.get("search");
-  	if(searchTxt && searchTxt.length){
-  	  condition1 = "(role.get('name') && role.get('name').indexOf(searchTxt)>-1)";
-  	}
-  	if(this.get("isWorkflow")){
-  		if(condition2.length){
-  	  		condition2 = condition2 + " role.get('type') == 'WORKFLOW'";
-  	  	} else {
-  	  		condition2 = condition2 + " role.get('type') == 'WORKFLOW'";
-  	  	}
-  	}
-  	if(this.get("isCoordinator")){
-  		if(condition2.length){
-  			condition2 = condition2 + " || role.get('type') == 'COORDINATOR'";
-  		} else {
-  			condition2 = condition2 + "role.get('type') == 'COORDINATOR'";
-  		}
-  	}
-  	if(this.get("isBundle")){
-  		if(condition2.length) {
-  			condition2 = condition2 + " || role.get('type') == 'BUNDLE'";
-  		} else {
-  			condition2 = condition2 + " role.get('type') == 'BUNDLE'";
-  		}
-  	}
-  	if(condition1.length && condition2.length) {
-    	condition = condition1 + "&&(" + condition2+ ")";
-  	} else if(condition2.length) {
-    	condition = condition2;
-  	}
-	return this.get("model").filter( (role) => {
-	  return eval(condition);
-	});
+    var score = 0, condition = true, searchTxt = this.get("search").toLowerCase(), isWorkflow = this.get("isWorkflow"), isCoordinator = this.get("isCoordinator"), isBundle = this.get("isBundle");
+    return this.get("model").filter( (role) => {
+      score = 0
+      if(searchTxt && searchTxt.length) {
+        condition = role.get('name') && role.get('name').toLowerCase().indexOf(searchTxt)>-1;
+      }
+      if(isWorkflow && role.get('type') === 'WORKFLOW') {
+        score++;
+      }
+      if(isCoordinator && role.get('type') === 'COORDINATOR') {
+        score++;
+      }
+      if(isBundle && role.get('type') === 'BUNDLE') {
+        score++;
+      }
+      return condition && score > 0;
+    });
   }),
   modelSorted : Ember.computed.sort("filteredModels", "sortProp"),
   "isDeleteDraftConformation": false,

http://git-wip-us.apache.org/repos/asf/ambari/blob/5ab3e427/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/drafts-wf.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/drafts-wf.hbs b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/drafts-wf.hbs
index 802a8bc..632d6bd 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/drafts-wf.hbs
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/templates/components/drafts-wf.hbs
@@ -19,10 +19,10 @@
     {{spin-spinner lines=13 length=20 width=10}}
 </div>
 <div class="searchWorkflows">
-  {{input type="checkbox" name="isWorkflow" checked=isWorkflow}}Workflow&nbsp;&nbsp;
-  {{input type="checkbox" name="isCoordinator" checked=isCoordinator}}Coordinator&nbsp;&nbsp;
-  {{input type="checkbox" name="isBundle" checked=isBundle}}Bundle&nbsp;&nbsp;
-  {{input type="text" class="l-input" value=search placeholder="Workflow Name"}}
+  {{input type="checkbox" class="marginright5" name="isWorkflow" checked=isWorkflow}}Workflow&nbsp;&nbsp;
+  {{input type="checkbox" class="marginright5" name="isCoordinator" checked=isCoordinator}}Coordinator&nbsp;&nbsp;
+  {{input type="checkbox" class="marginright5" name="isBundle" checked=isBundle}}Bundle&nbsp;&nbsp;
+  {{input type="text" class="l-input" value=search placeholder="Type Workflow name or path"}}
 </div>
 {{#if modelSorted}}
     <div id="draftsTable">
@@ -35,7 +35,6 @@
                   <th>Name</th>
                   <th>Path</th>
                   <th>Updated at</th>
-                  <th>Action</th>
               </tr>
             </thead>
             <tbody>
@@ -53,8 +52,8 @@
                               <i class="fa fa-cubes marginright5"></i>
                           {{/if}}
                         </td>
-                        <td title={{job.name}}>
-                            <div class="width100">
+                        <td title={{job.name}} class="pointer action-link">
+                            <div class="width100" {{action "importActionToEditor" job.workflowDefinitionPath job.type}}>
                               {{job.name}}
                             </div>
                         </td>
@@ -68,12 +67,6 @@
                                 {{format-unicode-date job.updatedAt}}
                             </div>
                         </td>
-                        <td class=" no-sort fixed-col">
-                            <button {{action "importActionToEditor" job.workflowDefinitionPath job.type}} type="button"
-                                                                                                         class="btn btn-default">
-                                        Open
-                                    </button>
-                        </td>
                     </tr>
                     {{/if}}
                 {{/each}}


[05/51] [abbrv] ambari git commit: AMBARI-19859. The user must be clearly communicated about YARN pre-emption requirements when Hive LLAP is enabled. (Vivek Subramanian via yusaku)

Posted by rz...@apache.org.
AMBARI-19859. The user must be clearly communicated about YARN pre-emption requirements when Hive LLAP is enabled. (Vivek Subramanian via yusaku)

(cherry picked from commit e8cef81e46c87cdff3e156a4b3f038be4b8e3d58)

Change-Id: Ib69ee93fb3d538acf63c8ba905cb3fbb35d713b0


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: e052e3f815c0b99ab38bab904957da7489856f1b
Parents: 75447c9
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Fri Feb 3 15:17:35 2017 -0800
Committer: Zuul <re...@hortonworks.com>
Committed: Mon Feb 6 19:54:03 2017 -0800

----------------------------------------------------------------------
 .../HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml | 4 ++--
 .../HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e052e3f8/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml
index 89eccc6..e636e0c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/configuration/hive-interactive-env.xml
@@ -23,8 +23,8 @@
   <property>
     <name>enable_hive_interactive</name>
     <value>false</value>
-    <description>Enable or disable interactive query in this cluster.</description>
-    <display-name>Enable Interactive Query (Tech Preview)</display-name>
+    <description>Enable or disable interactive query in this cluster. &lt;br&gt; Note: Hive LLAP may not start up on busy clusters if YARN pre-emption is not enabled. Enable via the YARN configs page.</description>
+    <display-name>Enable Interactive Query (Tech Preview, requires YARN pre-emption)</display-name>
     <value-attributes>
       <type>value-list</type>
       <overridable>false</overridable>

http://git-wip-us.apache.org/repos/asf/ambari/blob/e052e3f8/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml
index 787dcb1..af656f4 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.6/services/HIVE/configuration/hive-interactive-env.xml
@@ -23,8 +23,8 @@
   <property>
     <name>enable_hive_interactive</name>
     <value>false</value>
-    <description>Enable or disable interactive query in this cluster.</description>
-    <display-name>Enable Interactive Query</display-name>
+    <description>Enable or disable interactive query in this cluster. &lt;br&gt; Note: Hive LLAP may not start up on busy clusters if YARN pre-emption is not enabled. Enable via the YARN configs page.</description>
+    <display-name>Enable Interactive Query (requires YARN pre-emption)</display-name>
     <value-attributes>
       <type>value-list</type>
       <overridable>false</overridable>


[02/51] [abbrv] ambari git commit: AMBARI-19795 Ambari upgrade to not add ranger plugin configs under ranger plugin supported services (mugdha)

Posted by rz...@apache.org.
AMBARI-19795 Ambari upgrade to not add ranger plugin configs under ranger plugin supported services (mugdha)

(cherry picked from commit f7bb18db4928995e4a05804bf51b7ff08313cbf8)

Change-Id: Ie9c324a1967df58a7f56643881bae45110b58e49


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 53cefdbf6a18bf66bbe19a746330e2acf2431cb8
Parents: 21a52e9
Author: Mugdha Varadkar <mu...@apache.org>
Authored: Fri Feb 3 15:06:15 2017 +0530
Committer: Zuul <re...@hortonworks.com>
Committed: Mon Feb 6 18:03:56 2017 -0800

----------------------------------------------------------------------
 .../0.9.0/configuration/ranger-kafka-audit.xml  | 32 ++++-----
 .../ranger-kafka-plugin-properties.xml          | 14 ++--
 .../ranger-kafka-policymgr-ssl.xml              | 12 ++--
 .../configuration/ranger-kafka-security.xml     | 12 ++--
 .../ranger-knox-plugin-properties.xml           | 12 ++--
 .../0.10.0/configuration/ranger-storm-audit.xml | 32 ++++-----
 .../ranger-storm-policymgr-ssl.xml              | 12 ++--
 .../configuration/ranger-storm-security.xml     | 12 ++--
 .../ranger-storm-plugin-properties.xml          | 71 --------------------
 .../ranger-hbase-plugin-properties.xml          | 10 +--
 .../ranger-hdfs-plugin-properties.xml           | 12 ++--
 .../ranger-hive-plugin-properties.xml           | 10 +--
 .../ranger-knox-plugin-properties.xml           |  2 +-
 .../HBASE/configuration/ranger-hbase-audit.xml  | 32 ++++-----
 .../ranger-hbase-policymgr-ssl.xml              | 12 ++--
 .../configuration/ranger-hbase-security.xml     | 14 ++--
 .../configuration/ranger-hdfs-policymgr-ssl.xml | 12 ++--
 .../HDFS/configuration/ranger-hdfs-security.xml | 14 ++--
 .../HIVE/configuration/ranger-hive-audit.xml    | 32 ++++-----
 .../configuration/ranger-hive-policymgr-ssl.xml | 12 ++--
 .../HIVE/configuration/ranger-hive-security.xml | 14 ++--
 .../ranger-kafka-policymgr-ssl.xml              |  4 +-
 .../KNOX/configuration/ranger-knox-audit.xml    | 32 ++++-----
 .../configuration/ranger-knox-policymgr-ssl.xml | 12 ++--
 .../KNOX/configuration/ranger-knox-security.xml | 12 ++--
 .../ranger-storm-policymgr-ssl.xml              |  4 +-
 .../configuration/ranger-storm-security.xml     |  2 +-
 .../YARN/configuration/ranger-yarn-audit.xml    | 32 ++++-----
 .../ranger-yarn-plugin-properties.xml           | 12 ++--
 .../configuration/ranger-yarn-policymgr-ssl.xml | 12 ++--
 .../YARN/configuration/ranger-yarn-security.xml | 12 ++--
 .../ATLAS/configuration/ranger-atlas-audit.xml  | 18 ++---
 .../ranger-atlas-plugin-properties.xml          | 58 ++--------------
 .../ranger-atlas-policymgr-ssl.xml              | 12 ++--
 .../configuration/ranger-atlas-security.xml     | 14 ++--
 .../ranger-hbase-plugin-properties.xml          | 71 --------------------
 .../ranger-hdfs-plugin-properties.xml           | 50 +-------------
 .../ranger-hive-plugin-properties.xml           | 71 --------------------
 .../HIVE/configuration/ranger-hive-security.xml |  2 +-
 .../ranger-kafka-plugin-properties.xml          | 71 --------------------
 .../ranger-knox-plugin-properties.xml           | 71 --------------------
 .../ranger-storm-policymgr-ssl.xml              |  4 +-
 .../configuration/ranger-storm-security.xml     |  2 +-
 .../ranger-yarn-plugin-properties.xml           | 71 --------------------
 .../ranger-atlas-plugin-properties.xml          | 71 ++++++++++++++++++++
 .../ranger-hbase-plugin-properties.xml          | 71 ++++++++++++++++++++
 .../ranger-hdfs-plugin-properties.xml           | 70 +++++++++++++++++++
 .../ranger-hive-plugin-properties.xml           | 71 ++++++++++++++++++++
 .../ranger-kafka-plugin-properties.xml          | 71 ++++++++++++++++++++
 .../ranger-knox-plugin-properties.xml           | 71 ++++++++++++++++++++
 .../ranger-storm-plugin-properties.xml          | 71 ++++++++++++++++++++
 .../ranger-yarn-plugin-properties.xml           | 71 ++++++++++++++++++++
 52 files changed, 823 insertions(+), 778 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-audit.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-audit.xml
index 5257549..b4c0790 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-audit.xml
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-audit.xml
@@ -23,7 +23,7 @@
     <name>xasecure.audit.is.enabled</name>
     <value>true</value>
     <description>Is Audit enabled?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db</name>
@@ -39,19 +39,19 @@
         <name>xasecure.audit.destination.db</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.url</name>
     <value>{{audit_jdbc_url}}</value>
     <description>Audit DB JDBC URL</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.user</name>
     <value>{{xa_audit_db_user}}</value>
     <description>Audit DB JDBC User</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.password</name>
@@ -61,25 +61,25 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.driver</name>
     <value>{{jdbc_driver}}</value>
     <description>Audit DB JDBC Driver</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.credential.provider.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>Credential file store</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.batch.filespool.dir</name>
     <value>/var/log/kafka/audit/db/spool</value>
     <description>/var/log/kafka/audit/db/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs</name>
@@ -95,7 +95,7 @@
         <name>xasecure.audit.destination.hdfs</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.dir</name>
@@ -107,13 +107,13 @@
         <name>xasecure.audit.destination.hdfs.dir</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
     <value>/var/log/kafka/audit/hdfs/spool</value>
     <description>/var/log/kafka/audit/hdfs/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr</name>
@@ -129,7 +129,7 @@
         <name>xasecure.audit.destination.solr</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.urls</name>
@@ -144,7 +144,7 @@
         <name>ranger.audit.solr.urls</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
@@ -156,13 +156,13 @@
         <name>ranger.audit.solr.zookeepers</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.batch.filespool.dir</name>
     <value>/var/log/kafka/audit/solr/spool</value>
     <description>/var/log/kafka/audit/solr/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.provider.summary.enabled</name>
@@ -172,6 +172,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-plugin-properties.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-plugin-properties.xml
index 7f594a0..3949402 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-plugin-properties.xml
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-plugin-properties.xml
@@ -24,7 +24,7 @@
     <value>ambari-qa</value>
     <display-name>Policy user for KAFKA</display-name>
     <description>This user must be system user and also present at Ranger admin portal</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>hadoop.rpc.protection</name>
@@ -33,7 +33,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>common.name.for.certificate</name>
@@ -42,13 +42,13 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>zookeeper.connect</name>
     <value>localhost:2181</value>
     <description>Used for repository creation on ranger admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger-kafka-plugin-enabled</name>
@@ -65,14 +65,14 @@
       <type>boolean</type>
       <overridable>false</overridable>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_USERNAME</name>
     <value>kafka</value>
     <display-name>Ranger repository config user</display-name>
     <description>Used for repository creation on ranger admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_PASSWORD</name>
@@ -83,6 +83,6 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-policymgr-ssl.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-policymgr-ssl.xml
index f0fc160..cf4a82e 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-policymgr-ssl.xml
@@ -23,7 +23,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>kafkadev-clientcert.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.password</name>
@@ -33,13 +33,13 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>cacerts-xasecure.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.password</name>
@@ -49,18 +49,18 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file/{{credential_file}}</value>
     <description>java keystore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file/{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-security.xml b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-security.xml
index a9f84a4..47ea2a8 100644
--- a/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-security.xml
+++ b/ambari-server/src/main/resources/common-services/KAFKA/0.9.0/configuration/ranger-kafka-security.xml
@@ -23,19 +23,19 @@
     <name>ranger.plugin.kafka.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing policies for this Kafka instance</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.kafka.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.kafka.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -47,18 +47,18 @@
     <name>ranger.plugin.kafka.policy.rest.ssl.config.file</name>
     <value>/etc/kafka/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.kafka.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.kafka.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ranger-knox-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ranger-knox-plugin-properties.xml b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ranger-knox-plugin-properties.xml
index 7f85667..ae9314b 100644
--- a/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ranger-knox-plugin-properties.xml
+++ b/ambari-server/src/main/resources/common-services/KNOX/0.5.0.2.2/configuration/ranger-knox-plugin-properties.xml
@@ -24,7 +24,7 @@
     <value>ambari-qa</value>
     <display-name>Policy user for KNOX</display-name>
     <description>This user must be system user and also present at Ranger admin portal</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>common.name.for.certificate</name>
@@ -33,7 +33,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger-knox-plugin-enabled</name>
@@ -50,14 +50,14 @@
       <type>boolean</type>
       <overridable>false</overridable>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_USERNAME</name>
     <value>admin</value>
     <display-name>Ranger repository config user</display-name>
     <description>Used for repository creation on ranger admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_PASSWORD</name>
@@ -68,14 +68,14 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>KNOX_HOME</name>
     <value>/usr/local/knox-server</value>
     <display-name>Knox Home</display-name>
     <description>Knox home folder</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>XAAUDIT.DB.IS_ENABLED</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-audit.xml b/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-audit.xml
index b7cf4c5..4dc51eb 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-audit.xml
+++ b/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-audit.xml
@@ -23,7 +23,7 @@
     <name>xasecure.audit.is.enabled</name>
     <value>true</value>
     <description>Is Audit enabled?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db</name>
@@ -39,19 +39,19 @@
         <name>xasecure.audit.destination.db</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.url</name>
     <value>{{audit_jdbc_url}}</value>
     <description>Audit DB JDBC URL</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.user</name>
     <value>{{xa_audit_db_user}}</value>
     <description>Audit DB JDBC User</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.password</name>
@@ -61,25 +61,25 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.driver</name>
     <value>{{jdbc_driver}}</value>
     <description>Audit DB JDBC Driver</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.credential.provider.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>Credential file store</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.batch.filespool.dir</name>
     <value>/var/log/storm/audit/db/spool</value>
     <description>/var/log/storm/audit/db/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs</name>
@@ -95,7 +95,7 @@
         <name>xasecure.audit.destination.hdfs</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.dir</name>
@@ -107,13 +107,13 @@
         <name>xasecure.audit.destination.hdfs.dir</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
     <value>/var/log/storm/audit/hdfs/spool</value>
     <description>/var/log/storm/audit/hdfs/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr</name>
@@ -129,7 +129,7 @@
         <name>xasecure.audit.destination.solr</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.urls</name>
@@ -144,7 +144,7 @@
         <name>ranger.audit.solr.urls</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
@@ -156,13 +156,13 @@
         <name>ranger.audit.solr.zookeepers</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.batch.filespool.dir</name>
     <value>/var/log/storm/audit/solr/spool</value>
     <description>/var/log/storm/audit/solr/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.provider.summary.enabled</name>
@@ -172,6 +172,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-policymgr-ssl.xml b/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-policymgr-ssl.xml
index 9592914..b1f6e1e 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-policymgr-ssl.xml
@@ -23,7 +23,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>hadoopdev-clientcert.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.password</name>
@@ -33,13 +33,13 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>cacerts-xasecure.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.password</name>
@@ -49,18 +49,18 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java keystore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-security.xml b/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-security.xml
index 84e394b4..b72b302 100644
--- a/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-security.xml
+++ b/ambari-server/src/main/resources/common-services/STORM/0.10.0/configuration/ranger-storm-security.xml
@@ -23,19 +23,19 @@
     <name>ranger.plugin.storm.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing policies for this Storm instance</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.storm.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.storm.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -47,18 +47,18 @@
     <name>ranger.plugin.storm.policy.rest.ssl.config.file</name>
     <value>/etc/storm/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.storm.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.storm.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/common-services/STORM/1.0.1/configuration/ranger-storm-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/STORM/1.0.1/configuration/ranger-storm-plugin-properties.xml b/ambari-server/src/main/resources/common-services/STORM/1.0.1/configuration/ranger-storm-plugin-properties.xml
deleted file mode 100644
index 3450970..0000000
--- a/ambari-server/src/main/resources/common-services/STORM/1.0.1/configuration/ranger-storm-plugin-properties.xml
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/**
- * 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.
- */
--->
-<configuration>
-
-  <property>
-    <name>external_admin_username</name>
-    <value></value>
-    <display-name>External Ranger admin username</display-name>
-    <description>Add ranger default admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_admin_password</name>
-    <value></value>
-    <display-name>External Ranger admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_username</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin username</display-name>
-    <description>Add ranger default ambari admin username if want to communicate to external ranger</description>
-    <value-attributes>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-  <property>
-    <name>external_ranger_admin_password</name>
-    <value></value>
-    <display-name>External Ranger Ambari admin password</display-name>
-    <property-type>PASSWORD</property-type>
-    <description>Add ranger default ambari admin password if want to communicate to external ranger</description>
-    <value-attributes>
-      <type>password</type>
-      <empty-value-valid>true</empty-value-valid>
-    </value-attributes>
-    <on-ambari-upgrade add="true"/>
-  </property>
-
-</configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/configuration/ranger-hbase-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
index 0de538d..960c751 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HBASE/configuration/ranger-hbase-plugin-properties.xml
@@ -26,7 +26,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>policy_user</name>
@@ -39,7 +39,7 @@
       </property>
     </depends-on>
     <description>This user must be system user and also present at Ranger admin portal</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger-hbase-plugin-enabled</name>
@@ -56,14 +56,14 @@
         <name>ranger-hbase-plugin-enabled</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_USERNAME</name>
     <value>hbase</value>
     <display-name>Ranger repository config user</display-name>
     <description>Used for repository creation on ranger admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_PASSWORD</name>
@@ -74,7 +74,7 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>XAAUDIT.DB.IS_ENABLED</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
index 7460d26..c57c5f0 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HDFS/configuration/ranger-hdfs-plugin-properties.xml
@@ -17,7 +17,7 @@
     <display-name>Policy user for HDFS</display-name>
     <description>This user must be system user and also present at Ranger
 			admin portal</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>hadoop.rpc.protection</name>
@@ -27,7 +27,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>common.name.for.certificate</name>
@@ -36,7 +36,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger-hdfs-plugin-enabled</name>
@@ -53,7 +53,7 @@
       <type>boolean</type>
       <overridable>false</overridable>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_USERNAME</name>
@@ -61,7 +61,7 @@
     <display-name>Ranger repository config user</display-name>
     <description>Used for repository creation on ranger admin
 		</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_PASSWORD</name>
@@ -73,7 +73,7 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>XAAUDIT.DB.IS_ENABLED</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/ranger-hive-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/ranger-hive-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/ranger-hive-plugin-properties.xml
index 0db5565..830c539 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/ranger-hive-plugin-properties.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/HIVE/configuration/ranger-hive-plugin-properties.xml
@@ -24,13 +24,13 @@
     <value>ambari-qa</value>
     <display-name>Policy user for HIVE</display-name>
     <description>This user must be system user and also present at Ranger admin portal</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>jdbc.driverClassName</name>
     <value>org.apache.hive.jdbc.HiveDriver</value>
     <description>Used for repository creation on ranger admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>common.name.for.certificate</name>
@@ -39,14 +39,14 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_USERNAME</name>
     <value>hive</value>
     <display-name>Ranger repository config user</display-name>
     <description>Used for repository creation on ranger admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_PASSWORD</name>
@@ -57,7 +57,7 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>XAAUDIT.DB.IS_ENABLED</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/ranger-knox-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/ranger-knox-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/ranger-knox-plugin-properties.xml
index ad2b1e4..d5880dd 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/ranger-knox-plugin-properties.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/KNOX/configuration/ranger-knox-plugin-properties.xml
@@ -24,6 +24,6 @@
     <value>/usr/hdp/current/knox-server</value>
     <display-name>Knox Home</display-name>
     <description>Knox home folder</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-audit.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-audit.xml
index f670d7e..85c16c8 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-audit.xml
@@ -23,7 +23,7 @@
     <name>xasecure.audit.is.enabled</name>
     <value>true</value>
     <description>Is Audit enabled?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db</name>
@@ -39,19 +39,19 @@
         <name>xasecure.audit.destination.db</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.url</name>
     <value>{{audit_jdbc_url}}</value>
     <description>Audit DB JDBC URL</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.user</name>
     <value>{{xa_audit_db_user}}</value>
     <description>Audit DB JDBC User</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.password</name>
@@ -61,25 +61,25 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.driver</name>
     <value>{{jdbc_driver}}</value>
     <description>Audit DB JDBC Driver</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.credential.provider.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>Credential file store</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.batch.filespool.dir</name>
     <value>/var/log/hbase/audit/db/spool</value>
     <description>/var/log/hbase/audit/db/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs</name>
@@ -95,7 +95,7 @@
         <name>xasecure.audit.destination.hdfs</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.dir</name>
@@ -107,13 +107,13 @@
         <name>xasecure.audit.destination.hdfs.dir</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
     <value>/var/log/hbase/audit/hdfs/spool</value>
     <description>/var/log/hbase/audit/hdfs/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr</name>
@@ -129,7 +129,7 @@
         <name>xasecure.audit.destination.solr</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.urls</name>
@@ -144,7 +144,7 @@
         <name>ranger.audit.solr.urls</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
@@ -156,13 +156,13 @@
         <name>ranger.audit.solr.zookeepers</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.batch.filespool.dir</name>
     <value>/var/log/hbase/audit/solr/spool</value>
     <description>/var/log/hbase/audit/solr/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.provider.summary.enabled</name>
@@ -172,6 +172,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-policymgr-ssl.xml
index 79370bc..c761b26 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-policymgr-ssl.xml
@@ -23,7 +23,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/hbase-client/conf/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.password</name>
@@ -33,13 +33,13 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/hbase-client/conf/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.password</name>
@@ -49,18 +49,18 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java keystore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-security.xml
index 0ad5e60..4a0909a 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HBASE/configuration/ranger-hbase-security.xml
@@ -23,19 +23,19 @@
     <name>ranger.plugin.hbase.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing HBase policies</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hbase.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hbase.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -47,19 +47,19 @@
     <name>ranger.plugin.hbase.policy.rest.ssl.config.file</name>
     <value>/etc/hbase/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hbase.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hbase.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.hbase.update.xapolicies.on.grant.revoke</name>
@@ -69,6 +69,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-policymgr-ssl.xml
index e14a9e8..71ba3a6 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-policymgr-ssl.xml
@@ -23,7 +23,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/hadoop-client/conf/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.password</name>
@@ -33,13 +33,13 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/hadoop-client/conf/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.password</name>
@@ -49,18 +49,18 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java keystore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-security.xml
index b2b8edb..f23706e 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HDFS/configuration/ranger-hdfs-security.xml
@@ -23,19 +23,19 @@
     <name>ranger.plugin.hdfs.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing Hdfs policies</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hdfs.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hdfs.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -47,24 +47,24 @@
     <name>ranger.plugin.hdfs.policy.rest.ssl.config.file</name>
     <value>/etc/hadoop/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hdfs.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hdfs.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.add-hadoop-authorization</name>
     <value>true</value>
     <description>Enable/Disable the default hadoop authorization (based on rwxrwxrwx permission on the resource) if Ranger Authorization fails.</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-audit.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-audit.xml
index 874d0d5..b210fca 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-audit.xml
@@ -23,7 +23,7 @@
     <name>xasecure.audit.is.enabled</name>
     <value>true</value>
     <description>Is Audit enabled?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db</name>
@@ -39,19 +39,19 @@
         <name>xasecure.audit.destination.db</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.url</name>
     <value>{{audit_jdbc_url}}</value>
     <description>Audit DB JDBC URL</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.user</name>
     <value>{{xa_audit_db_user}}</value>
     <description>Audit DB JDBC User</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.password</name>
@@ -61,25 +61,25 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.driver</name>
     <value>{{jdbc_driver}}</value>
     <description>Audit DB JDBC Driver</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.credential.provider.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>Credential file store</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.batch.filespool.dir</name>
     <value>/var/log/hive/audit/db/spool</value>
     <description>/var/log/hive/audit/db/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs</name>
@@ -95,7 +95,7 @@
         <name>xasecure.audit.destination.hdfs</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.dir</name>
@@ -107,13 +107,13 @@
         <name>xasecure.audit.destination.hdfs.dir</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
     <value>/var/log/hive/audit/hdfs/spool</value>
     <description>/var/log/hive/audit/hdfs/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr</name>
@@ -129,7 +129,7 @@
         <name>xasecure.audit.destination.solr</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.urls</name>
@@ -144,7 +144,7 @@
         <name>ranger.audit.solr.urls</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
@@ -156,13 +156,13 @@
         <name>ranger.audit.solr.zookeepers</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.batch.filespool.dir</name>
     <value>/var/log/hive/audit/solr/spool</value>
     <description>/var/log/hive/audit/solr/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.provider.summary.enabled</name>
@@ -172,6 +172,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-policymgr-ssl.xml
index 14e7b16..a538843 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-policymgr-ssl.xml
@@ -23,7 +23,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/hive-server2/conf/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.password</name>
@@ -33,13 +33,13 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/hive-server2/conf/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.password</name>
@@ -49,18 +49,18 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java keystore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-security.xml
index a07972a..7ea3391 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/HIVE/configuration/ranger-hive-security.xml
@@ -23,19 +23,19 @@
     <name>ranger.plugin.hive.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing policies for this HIVE instance</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hive.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminRESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hive.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -47,19 +47,19 @@
     <name>ranger.plugin.hive.policy.rest.ssl.config.file</name>
     <value>/usr/hdp/current/hive-server2/conf/conf.server/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hive.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.hive.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.hive.update.xapolicies.on.grant.revoke</name>
@@ -69,6 +69,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/ranger-kafka-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/ranger-kafka-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/ranger-kafka-policymgr-ssl.xml
index 2f4c121..24fd407 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/ranger-kafka-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KAFKA/configuration/ranger-kafka-policymgr-ssl.xml
@@ -23,12 +23,12 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/kafka-broker/config/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/kafka-broker/config/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-audit.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-audit.xml
index abdf2bd..1f3c1d1 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-audit.xml
@@ -23,7 +23,7 @@
     <name>xasecure.audit.is.enabled</name>
     <value>true</value>
     <description>Is Audit enabled?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db</name>
@@ -39,19 +39,19 @@
         <name>xasecure.audit.destination.db</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.url</name>
     <value>{{audit_jdbc_url}}</value>
     <description>Audit DB JDBC URL</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.user</name>
     <value>{{xa_audit_db_user}}</value>
     <description>Audit DB JDBC User</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.password</name>
@@ -61,25 +61,25 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.driver</name>
     <value>{{jdbc_driver}}</value>
     <description>Audit DB JDBC Driver</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.credential.provider.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>Credential file store</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.batch.filespool.dir</name>
     <value>/var/log/knox/audit/db/spool</value>
     <description>/var/log/knox/audit/db/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs</name>
@@ -95,7 +95,7 @@
         <name>xasecure.audit.destination.hdfs</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.dir</name>
@@ -107,13 +107,13 @@
         <name>xasecure.audit.destination.hdfs.dir</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
     <value>/var/log/knox/audit/hdfs/spool</value>
     <description>/var/log/knox/audit/hdfs/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr</name>
@@ -129,7 +129,7 @@
         <name>xasecure.audit.destination.solr</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.urls</name>
@@ -144,7 +144,7 @@
         <name>ranger.audit.solr.urls</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
@@ -156,13 +156,13 @@
         <name>ranger.audit.solr.zookeepers</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.batch.filespool.dir</name>
     <value>/var/log/knox/audit/solr/spool</value>
     <description>/var/log/knox/audit/solr/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.provider.summary.enabled</name>
@@ -172,6 +172,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-policymgr-ssl.xml
index 6cc2351..bb0878f 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-policymgr-ssl.xml
@@ -23,7 +23,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/knox-server/conf/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.password</name>
@@ -33,13 +33,13 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/knox-server/conf/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.password</name>
@@ -49,18 +49,18 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java keystore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-security.xml
index 0f0d3a7..37bda4c 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/KNOX/configuration/ranger-knox-security.xml
@@ -23,19 +23,19 @@
     <name>ranger.plugin.knox.service.name</name>
     <value>{{repo_name}}</value>
     <description>Name of the Ranger service containing policies for this Knox instance</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.knox.policy.source.impl</name>
     <value>org.apache.ranger.admin.client.RangerAdminJersey2RESTClient</value>
     <description>Class to retrieve policies from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.knox.policy.rest.url</name>
     <value>{{policymgr_mgr_url}}</value>
     <description>URL to Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
     <depends-on>
       <property>
         <type>admin-properties</type>
@@ -47,18 +47,18 @@
     <name>ranger.plugin.knox.policy.rest.ssl.config.file</name>
     <value>/usr/hdp/current/knox-server/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.knox.policy.pollIntervalMs</name>
     <value>30000</value>
     <description>How often to poll for changes in policies?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger.plugin.knox.policy.cache.dir</name>
     <value>/etc/ranger/{{repo_name}}/policycache</value>
     <description>Directory where Ranger policies are cached after successful retrieval from the source</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
index 21658e7..5672f04 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-policymgr-ssl.xml
@@ -23,12 +23,12 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/storm-client/conf/ranger-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/storm-client/conf/ranger-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-security.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-security.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-security.xml
index 8a3dd2e..f3d7530 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-security.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/STORM/configuration/ranger-storm-security.xml
@@ -23,6 +23,6 @@
     <name>ranger.plugin.storm.policy.rest.ssl.config.file</name>
     <value>/usr/hdp/current/storm-client/conf/ranger-policymgr-ssl.xml</value>
     <description>Path to the file containing SSL details to contact Ranger Admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-audit.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-audit.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-audit.xml
index 8237f1c..a6b1baa 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-audit.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-audit.xml
@@ -23,7 +23,7 @@
     <name>xasecure.audit.is.enabled</name>
     <value>true</value>
     <description>Is Audit enabled?</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db</name>
@@ -39,19 +39,19 @@
         <name>xasecure.audit.destination.db</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.url</name>
     <value>{{audit_jdbc_url}}</value>
     <description>Audit DB JDBC URL</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.user</name>
     <value>{{xa_audit_db_user}}</value>
     <description>Audit DB JDBC User</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.password</name>
@@ -61,25 +61,25 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.jdbc.driver</name>
     <value>{{jdbc_driver}}</value>
     <description>Audit DB JDBC Driver</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.credential.provider.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>Credential file store</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.db.batch.filespool.dir</name>
     <value>/var/log/hadoop/yarn/audit/db/spool</value>
     <description>/var/log/hadoop/yarn/audit/db/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs</name>
@@ -95,7 +95,7 @@
         <name>xasecure.audit.destination.hdfs</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.dir</name>
@@ -107,13 +107,13 @@
         <name>xasecure.audit.destination.hdfs.dir</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.hdfs.batch.filespool.dir</name>
     <value>/var/log/hadoop/yarn/audit/hdfs/spool</value>
     <description>/var/log/hadoop/yarn/audit/hdfs/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr</name>
@@ -129,7 +129,7 @@
         <name>xasecure.audit.destination.solr</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.urls</name>
@@ -144,7 +144,7 @@
         <name>ranger.audit.solr.urls</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.zookeepers</name>
@@ -156,13 +156,13 @@
         <name>ranger.audit.solr.zookeepers</name>
       </property>
     </depends-on>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.destination.solr.batch.filespool.dir</name>
     <value>/var/log/hadoop/yarn/audit/solr/spool</value>
     <description>/var/log/hadoop/yarn/audit/solr/spool</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.audit.provider.summary.enabled</name>
@@ -172,6 +172,6 @@
     <value-attributes>
       <type>boolean</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-plugin-properties.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-plugin-properties.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-plugin-properties.xml
index 1899d44..97867cc 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-plugin-properties.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-plugin-properties.xml
@@ -24,7 +24,7 @@
     <value>ambari-qa</value>
     <display-name>Policy user for YARN</display-name>
     <description>This user must be system user and also present at Ranger admin portal</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>hadoop.rpc.protection</name>
@@ -33,7 +33,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>common.name.for.certificate</name>
@@ -42,7 +42,7 @@
     <value-attributes>
       <empty-value-valid>true</empty-value-valid>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>ranger-yarn-plugin-enabled</name>
@@ -59,14 +59,14 @@
       <type>boolean</type>
       <overridable>false</overridable>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_USERNAME</name>
     <value>yarn</value>
     <display-name>Ranger repository config user</display-name>
     <description>Used for repository creation on ranger admin</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>REPOSITORY_CONFIG_PASSWORD</name>
@@ -77,6 +77,6 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>

http://git-wip-us.apache.org/repos/asf/ambari/blob/53cefdbf/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-policymgr-ssl.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-policymgr-ssl.xml b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-policymgr-ssl.xml
index 6ad6e62..5410104 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-policymgr-ssl.xml
+++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/YARN/configuration/ranger-yarn-policymgr-ssl.xml
@@ -23,7 +23,7 @@
     <name>xasecure.policymgr.clientssl.keystore</name>
     <value>/usr/hdp/current/hadoop-client/conf/ranger-yarn-plugin-keystore.jks</value>
     <description>Java Keystore files</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.password</name>
@@ -33,13 +33,13 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore</name>
     <value>/usr/hdp/current/hadoop-client/conf/ranger-yarn-plugin-truststore.jks</value>
     <description>java truststore file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.password</name>
@@ -49,18 +49,18 @@
     <value-attributes>
       <type>password</type>
     </value-attributes>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.keystore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java keystore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
   <property>
     <name>xasecure.policymgr.clientssl.truststore.credential.file</name>
     <value>jceks://file{{credential_file}}</value>
     <description>java truststore credential file</description>
-    <on-ambari-upgrade add="true"/>
+    <on-ambari-upgrade add="false"/>
   </property>
 </configuration>


[42/51] [abbrv] ambari git commit: AMBARI-19863 Fix Log Search User Config bugs (mgergely)

Posted by rz...@apache.org.
AMBARI-19863 Fix Log Search User Config bugs (mgergely)

Change-Id: I9e124e733e5917ee268c65abe409ecfa547036df
(cherry picked from commit 0e1d6b5b3e6b6960360d5b960dd59f7d78e2863a)


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: a34d6dc01cafed7741f6916102e979ceb25c1f6e
Parents: 9dd0bda
Author: Miklos Gergely <mg...@hortonworks.com>
Authored: Tue Feb 7 10:04:02 2017 +0100
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 08:23:56 2017 -0800

----------------------------------------------------------------------
 .../logsearch/common/LogSearchConstants.java    |    1 -
 .../UserConfigRequestQueryConverter.java        |   17 +-
 .../ambari/logsearch/doc/DocConstants.java      |    3 -
 .../logsearch/manager/UserConfigManager.java    |   53 +-
 .../request/UserConfigParamDefinition.java      |    6 -
 .../model/request/impl/UserConfigRequest.java   |   15 +-
 .../model/response/UserConfigData.java          |   11 -
 .../logsearch/rest/UserConfigResource.java      |   17 +-
 .../ambari/logsearch/solr/SolrConstants.java    |    1 -
 .../scripts/views/common/DashboardLayout.js     |   80 --
 .../scripts/views/common/EventHistoryLayout.js  |    1 -
 .../views/dashboard/DashboardLayoutView.js      |  354 -----
 .../scripts/views/dashboard/MainLayoutView.js   | 1259 +++++++++---------
 .../views/dialog/ApplySearchFilterView.js       |   41 +-
 .../views/tabs/EventHistoryLayoutView.js        |    1 -
 .../dashboard/DashboardLayoutView_tmpl.html     |   28 -
 .../UserConfigRequestQueryConverterTest.java    |    9 +-
 17 files changed, 672 insertions(+), 1225 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/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 1e46ae9..a260ed0 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
@@ -101,7 +101,6 @@ public class LogSearchConstants {
   public static final String REQUEST_PARAM_SOURCE_LOG_ID = "sourceLogId";
   public static final String REQUEST_PARAM_KEYWORD_TYPE = "keywordType";
   public static final String REQUEST_PARAM_TOKEN = "token";
-  public static final String REQUEST_PARAM_USER_ID = "userId";
   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";

http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/UserConfigRequestQueryConverter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/UserConfigRequestQueryConverter.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/UserConfigRequestQueryConverter.java
index 082f45c..fc75a17 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/UserConfigRequestQueryConverter.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/converter/UserConfigRequestQueryConverter.java
@@ -30,8 +30,6 @@ import java.util.List;
 
 import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants.FILTER_NAME;
 import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants.ROW_TYPE;
-import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants.SHARE_NAME_LIST;
-import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants.USER_NAME;
 
 @Named
 public class UserConfigRequestQueryConverter extends AbstractConverterAware<UserConfigRequest, SolrQuery> {
@@ -43,21 +41,16 @@ public class UserConfigRequestQueryConverter extends AbstractConverterAware<User
 
     int startIndex = StringUtils.isNotEmpty(userConfigRequest.getStartIndex()) && StringUtils.isNumeric(userConfigRequest.getStartIndex())
       ? Integer.parseInt(userConfigRequest.getStartIndex()) : 0;
-    int maxRows = StringUtils.isNotEmpty(userConfigRequest.getPageSize()) && StringUtils.isNumeric(userConfigRequest.getStartIndex())
-      ? Integer.parseInt(userConfigRequest.getStartIndex()) : 10;
+    int maxRows = StringUtils.isNotEmpty(userConfigRequest.getPageSize()) && StringUtils.isNumeric(userConfigRequest.getPageSize())
+      ? Integer.parseInt(userConfigRequest.getPageSize()) : 10;
 
     SolrQuery.ORDER order = userConfigRequest.getSortType() != null && SolrQuery.ORDER.desc.equals(SolrQuery.ORDER.valueOf(userConfigRequest.getSortType()))
       ? SolrQuery.ORDER.desc : SolrQuery.ORDER.asc;
-    String sortBy = StringUtils.isNotEmpty(userConfigRequest.getSortBy()) ? userConfigRequest.getSortBy(): FILTER_NAME;
+    String sortBy = StringUtils.isNotEmpty(userConfigRequest.getSortBy()) ? userConfigRequest.getSortBy() : FILTER_NAME;
     String filterName = StringUtils.isBlank(userConfigRequest.getFilterName()) ? "*" : "*" + userConfigRequest.getFilterName() + "*";
 
-    userConfigQuery.addFilterQuery(String.format("%s:%s",
-      ROW_TYPE, userConfigRequest.getRowType()));
-    userConfigQuery.addFilterQuery(String.format("%s:%s OR %s:%s",
-      USER_NAME, userConfigRequest.getUserId(),
-      SHARE_NAME_LIST, userConfigRequest.getUserId()));
-    userConfigQuery.addFilterQuery(String.format("%s:%s",
-      FILTER_NAME, SolrUtil.makeSearcableString(filterName)));
+    userConfigQuery.addFilterQuery(String.format("%s:%s", ROW_TYPE, userConfigRequest.getRowType()));
+    userConfigQuery.addFilterQuery(String.format("%s:%s", FILTER_NAME, SolrUtil.makeSearcableString(filterName)));
     userConfigQuery.setStart(startIndex);
     userConfigQuery.setRows(maxRows);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/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 caf0636..713c9f6 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
@@ -100,19 +100,16 @@ public class DocConstants {
   }
 
   public class UserConfigDescriptions {
-    public static final String USER_ID_D = "Get config for a particular user id";
     public static final String FILTER_NAME_D = "The saved query as filter in Solr, search is sopprted by this param";
     public static final String ROW_TYPE_D = "Row type is solr to identify as filter query";
   }
 
   public class UserConfigOperationDescriptions {
     public static final String SAVE_USER_CONFIG_OD = "Save user config";
-    public static final String UPDATE_USER_CONFIG_OD = "Update user config";
     public static final String DELETE_USER_CONFIG_OD = "Delete user config";
     public static final String GET_USER_CONFIG_OD = "Get user config";
     public static final String GET_USER_FILTER_OD = "Get user filter";
     public static final String UPDATE_USER_FILTER_OD = "Update user filter";
-    public static final String GET_USER_FILTER_BY_ID_OD = "Get user filter by id";
     public static final String GET_ALL_USER_NAMES_OD = "Get all user names";
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigManager.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigManager.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigManager.java
index 03535b1..a60fc5c 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigManager.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/manager/UserConfigManager.java
@@ -24,6 +24,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
 
+import org.apache.ambari.logsearch.common.LogSearchContext;
 import org.apache.ambari.logsearch.common.MessageEnums;
 import org.apache.ambari.logsearch.dao.UserConfigSolrDao;
 import org.apache.ambari.logsearch.model.common.LogFeederDataMap;
@@ -32,6 +33,7 @@ import org.apache.ambari.logsearch.model.response.UserConfigData;
 import org.apache.ambari.logsearch.model.response.UserConfigDataListResponse;
 import org.apache.ambari.logsearch.util.RESTErrorUtil;
 import org.apache.ambari.logsearch.util.SolrUtil;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.apache.solr.client.solrj.SolrQuery;
@@ -53,7 +55,6 @@ import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants
 import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants.FILTER_NAME;
 import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants.ROW_TYPE;
 import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants.SHARE_NAME_LIST;
-import static org.apache.ambari.logsearch.solr.SolrConstants.UserConfigConstants.COMPOSITE_KEY;
 
 @Named
 public class UserConfigManager extends JsonManagerBase {
@@ -66,45 +67,25 @@ public class UserConfigManager extends JsonManagerBase {
   private ConversionService conversionService;
 
   public String saveUserConfig(UserConfigData userConfig) {
+    String filterName = userConfig.getFiltername();
 
     SolrInputDocument solrInputDoc = new SolrInputDocument();
     if (!isValid(userConfig)) {
       throw RESTErrorUtil.createRESTException("No FilterName Specified", MessageEnums.INVALID_INPUT_DATA);
     }
 
-    if (isNotUnique(userConfig) && !userConfig.isOverwrite()) {
+    if (isNotUnique(filterName)) {
       throw RESTErrorUtil.createRESTException( "Name '" + userConfig.getFiltername() + "' already exists", MessageEnums.INVALID_INPUT_DATA);
     }
-    String loggedInUserName = userConfig.getUserName();
-    String filterName = userConfig.getFiltername();
-
     solrInputDoc.addField(ID, userConfig.getId());
-    solrInputDoc.addField(USER_NAME, loggedInUserName);
+    solrInputDoc.addField(USER_NAME, LogSearchContext.getCurrentUsername());
     solrInputDoc.addField(VALUES, userConfig.getValues());
     solrInputDoc.addField(FILTER_NAME, filterName);
     solrInputDoc.addField(ROW_TYPE, userConfig.getRowType());
     List<String> shareNameList = userConfig.getShareNameList();
-    if (shareNameList != null && !shareNameList.isEmpty()) {
+    if (CollectionUtils.isNotEmpty(shareNameList)) {
       solrInputDoc.addField(SHARE_NAME_LIST, shareNameList);
     }
-    // Check whether the Filter Name exists in solr
-    SolrQuery solrQuery = new SolrQuery();
-    solrQuery.setQuery("*:*");
-    solrQuery.addFilterQuery(String.format("%s:%s", FILTER_NAME, SolrUtil.makeSearcableString(filterName)));
-    solrQuery.addFilterQuery(String.format("%s:%s", USER_NAME, loggedInUserName));
-    try {
-      QueryResponse queryResponse = userConfigSolrDao.process(solrQuery);
-      if (queryResponse != null) {
-        SolrDocumentList documentList = queryResponse.getResults();
-        if (documentList != null && !documentList.isEmpty() && !userConfig.isOverwrite()) {
-          logger.error("Filtername is already present");
-          throw RESTErrorUtil.createRESTException("Filtername is already present", MessageEnums.INVALID_INPUT_DATA);
-        }
-      }
-    } catch (SolrException e) {
-      logger.error("Error in checking same filtername config", e);
-      throw RESTErrorUtil.createRESTException(MessageEnums.SOLR_ERROR.getMessage().getMessage(), MessageEnums.ERROR_SYSTEM);
-    }
 
     try {
       userConfigSolrDao.addDocs(solrInputDoc);
@@ -115,14 +96,14 @@ public class UserConfigManager extends JsonManagerBase {
     }
   }
 
-  private boolean isNotUnique(UserConfigData userConfig) {
-    String filterName = userConfig.getFiltername();
-    String rowType = userConfig.getRowType();
+  private boolean isNotUnique(String filterName) {
 
-    if (filterName != null && rowType != null) {
+    if (filterName != null) {
       SolrQuery solrQuery = new SolrQuery();
       filterName = SolrUtil.makeSearcableString(filterName);
-      solrQuery.setQuery(COMPOSITE_KEY + ":" + filterName + "-" + rowType);
+      solrQuery.setQuery("*:*");
+      solrQuery.addFilterQuery(FILTER_NAME + ":" + filterName);
+      solrQuery.addFilterQuery(USER_NAME + ":" + LogSearchContext.getCurrentUsername());
       SolrUtil.setRowCount(solrQuery, 0);
       try {
         Long numFound = userConfigSolrDao.process(solrQuery).getResults().getNumFound();
@@ -139,7 +120,6 @@ public class UserConfigManager extends JsonManagerBase {
   private boolean isValid(UserConfigData vHistory) {
     return StringUtils.isNotBlank(vHistory.getFiltername())
         && StringUtils.isNotBlank(vHistory.getRowType())
-        && StringUtils.isNotBlank(vHistory.getUserName())
         && StringUtils.isNotBlank(vHistory.getValues());
   }
 
@@ -159,12 +139,9 @@ public class UserConfigManager extends JsonManagerBase {
       throw RESTErrorUtil.createRESTException("row type was not specified", MessageEnums.INVALID_INPUT_DATA);
     }
 
-    String userName = request.getUserId();
-    if (StringUtils.isBlank(userName)) {
-      throw RESTErrorUtil.createRESTException("user name was not specified", MessageEnums.INVALID_INPUT_DATA);
-    }
-
     SolrQuery userConfigQuery = conversionService.convert(request, SolrQuery.class);
+    userConfigQuery.addFilterQuery(String.format("%s:%s OR %s:%s", USER_NAME, LogSearchContext.getCurrentUsername(),
+        SHARE_NAME_LIST, LogSearchContext.getCurrentUsername()));
     SolrDocumentList solrList = userConfigSolrDao.process(userConfigQuery).getResults();
 
     Collection<UserConfigData> configList = new ArrayList<>();
@@ -199,10 +176,6 @@ public class UserConfigManager extends JsonManagerBase {
 
   }
 
-  public String updateUserConfig(UserConfigData userConfig) {
-    return saveUserConfig(userConfig);
-  }
-
   // ////////////////////////////LEVEL FILTER/////////////////////////////////////
 
   public LogFeederDataMap getUserFilter() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/UserConfigParamDefinition.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/UserConfigParamDefinition.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/UserConfigParamDefinition.java
index 23b350a..dd74b6f 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/UserConfigParamDefinition.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/UserConfigParamDefinition.java
@@ -21,17 +21,11 @@ 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.UserConfigDescriptions.USER_ID_D;
 import static org.apache.ambari.logsearch.doc.DocConstants.UserConfigDescriptions.FILTER_NAME_D;
 import static org.apache.ambari.logsearch.doc.DocConstants.UserConfigDescriptions.ROW_TYPE_D;
 
 public interface UserConfigParamDefinition {
 
-  String getUserId();
-
-  @ApiParam(value = USER_ID_D, name = LogSearchConstants.REQUEST_PARAM_USER_ID)
-  void setUserId(String userId);
-
   String getFilterName();
 
   @ApiParam(value = FILTER_NAME_D, name = LogSearchConstants.REQUEST_PARAM_FILTER_NAME)

http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/UserConfigRequest.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/UserConfigRequest.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/UserConfigRequest.java
index c99ea75..cbbc6e6 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/UserConfigRequest.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/request/impl/UserConfigRequest.java
@@ -25,26 +25,13 @@ import javax.ws.rs.QueryParam;
 
 public class UserConfigRequest extends CommonSearchRequest implements UserConfigParamDefinition {
 
-  @QueryParam(LogSearchConstants.REQUEST_PARAM_USER_ID)
-  private String userId;
-
-  @QueryParam(LogSearchConstants.REQUEST_PARAM_FILE_NAME)
+  @QueryParam(LogSearchConstants.REQUEST_PARAM_FILTER_NAME)
   private String filterName;
 
   @QueryParam(LogSearchConstants.REQUEST_PARAM_ROW_TYPE)
   private String rowType;
 
   @Override
-  public String getUserId() {
-    return userId;
-  }
-
-  @Override
-  public void setUserId(String userId) {
-    this.userId = userId;
-  }
-
-  @Override
   public String getFilterName() {
     return filterName;
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/UserConfigData.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/UserConfigData.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/UserConfigData.java
index 1fca3ba..ef4e0be 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/UserConfigData.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/model/response/UserConfigData.java
@@ -43,9 +43,6 @@ public class UserConfigData {
   @ApiModelProperty
   private String rowType;
 
-  @ApiModelProperty
-  private boolean isOverwrite = false;
-
   public UserConfigData() {
     id = String.valueOf(new Date().getTime());
   }
@@ -97,12 +94,4 @@ public class UserConfigData {
   public void setRowType(String rowType) {
     this.rowType = rowType;
   }
-
-  public boolean isOverwrite() {
-    return isOverwrite;
-  }
-
-  public void setOverwrite(boolean overwrite) {
-    isOverwrite = overwrite;
-  }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/UserConfigResource.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/UserConfigResource.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/UserConfigResource.java
index 31f584d..19cfbed 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/UserConfigResource.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/rest/UserConfigResource.java
@@ -59,13 +59,6 @@ public class UserConfigResource {
     return userConfigManager.saveUserConfig(userConfig);
   }
 
-  @PUT
-  @Produces({"application/json"})
-  @ApiOperation(UPDATE_USER_CONFIG_OD)
-  public String updateUserConfig(UserConfigData userConfig) {
-    return userConfigManager.updateUserConfig(userConfig);
-  }
-
   @DELETE
   @Path("/{id}")
   @ApiOperation(DELETE_USER_CONFIG_OD)
@@ -88,18 +81,10 @@ public class UserConfigResource {
     return userConfigManager.getUserFilter();
   }
 
-  @POST
-  @Path("/filters")
-  @Produces({"application/json"})
-  @ApiOperation(UPDATE_USER_FILTER_OD)
-  public LogFeederDataMap createUserFilter(LogFeederDataMap request) {
-    return userConfigManager.saveUserFiter(request);
-  }
-
   @PUT
   @Path("/filters/{id}")
   @Produces({"application/json"})
-  @ApiOperation(GET_USER_FILTER_BY_ID_OD)
+  @ApiOperation(UPDATE_USER_FILTER_OD)
   public LogFeederDataMap updateUserFilter(LogFeederDataMap request) {
     return userConfigManager.saveUserFiter(request);
   }

http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/SolrConstants.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/SolrConstants.java b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/SolrConstants.java
index 85554bc..39e134a 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/SolrConstants.java
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/java/org/apache/ambari/logsearch/solr/SolrConstants.java
@@ -107,7 +107,6 @@ public class SolrConstants {
     public static final String VALUES = "jsons";
     public static final String FILTER_NAME = "filtername";
     public static final String ROW_TYPE = "rowtype";
-    public static final String COMPOSITE_KEY = "composite_filtername-username";
     public static final String SHARE_NAME_LIST = "share_username_list";
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/DashboardLayout.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/DashboardLayout.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/DashboardLayout.js
deleted file mode 100644
index 7adfeb8..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/DashboardLayout.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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.
- */
-
- 
-define(['require',
-	'backbone',
-	'communicator',
-	'modules/XALinks',
-	'hbs!tmpl/dashboard/DashboardLayout_tmpl'
-],function(require,Backbone,Communicator,XALinks,DashboardlayoutTmpl){
-    'use strict';
-
-	var DashboardLayout = Backbone.Marionette.Layout.extend(
-	/** @lends DashboardLayout */
-	{
-		_viewName : name,
-		
-    	template: DashboardlayoutTmpl,
-    	breadCrumbs : [XALinks.get('Dashboard')],
-        
-		/** Layout sub regions */
-    	regions: {},
-
-    	/** ui selector cache */
-    	ui: {},
-
-		/** ui events hash */
-		events: {},
-
-    	/**
-		* intialize a new DashboardLayout Layout 
-		* @constructs
-		*/
-		initialize: function(options) {
-			console.log("initialized a DashboardLayout Layout");
-
-			_.extend(this, _.pick(options, ''));
-			
-			this.bindEvents();
-		},
-
-		/** all events binding here */
-		bindEvents : function(){
-			/*this.listenTo(this.model, "change:foo", this.modelChanged, this);*/
-			/*this.listenTo(communicator.vent,'someView:someEvent', this.someEventHandler, this)'*/
-		},
-
-		/** on render callback */
-		onRender: function() {
-			this.initializePlugins();
-		},
-
-		/** all post render plugin initialization */
-		initializePlugins: function(){
-		},
-
-		/** on close */
-		onClose: function(){
-		}
-
-	});
-	
-	return DashboardLayout;
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/EventHistoryLayout.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/EventHistoryLayout.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/EventHistoryLayout.js
index 89914ea..01e18b1 100644
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/EventHistoryLayout.js
+++ b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/common/EventHistoryLayout.js
@@ -228,7 +228,6 @@ define(['require',
             }
             params["time"] = timeType;
             var postObject = {
-                userName: "admin",
                 filtername: content.ui.filterName.val().trim(),
                 rowType: "history",
                 values: JSON.stringify(params)

http://git-wip-us.apache.org/repos/asf/ambari/blob/a34d6dc0/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/DashboardLayoutView.js
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/DashboardLayoutView.js b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/DashboardLayoutView.js
deleted file mode 100644
index 6358eb2..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/scripts/views/dashboard/DashboardLayoutView.js
+++ /dev/null
@@ -1,354 +0,0 @@
-/**
- * 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.
- */
-
-define(['require',
-    'backbone',
-    'utils/Utils',
-    'dashboard',
-    'utils/Globals',
-    'collections/VEventHistoryList',
-    'hbs!tmpl/dashboard/DashboardLayoutView_tmpl'
-], function(require, Backbone, Utils, dashboard, Globals, VEventHistory, DashboardLayoutView_Tmpl) {
-    'use strict';
-
-    return Backbone.Marionette.Layout.extend(
-        /** @lends DashboardLayoutView */
-        {
-            _viewName: 'DashboardLayoutView',
-
-            template: DashboardLayoutView_Tmpl,
-
-
-            /** ui selector cache */
-            ui: {
-                gridClose: "[data-id='gridClose']",
-                saveData: "[data-id='save']",
-                loadData: "[data-id='load']",
-                enableHelp: "[data-id='enableHelp']"
-            },
-
-            /** ui events hash */
-            events: function() {
-                var events = {};
-                events['click ' + this.ui.gridClose] = 'onGridCloseClick';
-                events['click ' + this.ui.saveData] = 'onSaveDataClick';
-                events['click ' + this.ui.loadData] = 'onLoadDataClick';
-                events['change ' + this.ui.enableHelp] = 'onEnableHelpClick';
-                return events;
-            },
-            regions: {},
-
-            /**
-             * intialize a new DashboardLayoutView Layout
-             * @constructs
-             */
-            initialize: function(options) {
-                _.extend(this, _.pick(options, 'globalVent', 'params', 'componetList'));
-                this.bindEvents();
-                this.tabOpend = false;
-                this.graphIdCounter = 0;
-                this.dateUtil = Utils.dateUtil;
-                this.vent = new Backbone.Wreqr.EventAggregator();
-                this.storedValueCollection = new Backbone.Collection();
-                this.saveDahboardCollection = new VEventHistory();
-                this.gridHelp = true;
-            },
-            bindEvents: function() {
-                this.listenTo(this.globalVent, "tab:click", function($this) {
-                    if (!this.tabOpend) {
-                        this.tabOpend = true
-                        this.initializePlugin();
-                        //this.dashboard.bindEvent();
-                    }
-                }, this);
-            },
-            onRender: function() {
-                this.setSettingCheckbox();
-            },
-            addElement: function(el, data) {
-                var that = this;
-                //this.dashboard.addWidget($('<li class="new" data-type="' + type + '"></li>'), 3, 2);
-                var regionid = that.createRegion();
-                if (data) {
-                    el.attr('data-type', data.myData.type)
-                }
-
-                el.append('<div class="regionBox" data-regionid= "' + regionid + '"  id = "' + regionid + '"> </div>')
-                el.attr('data-dataId', regionid)
-                var dataType = el.data();
-                if (dataType && dataType.type) {
-                    that.addRegion(regionid, dataType.type, data);
-                }
-
-            },
-            initializePlugin: function() {
-                var that = this;
-                this.dashboard = $(".gridster").dashboard({
-                    widget_margins: [10, 10],
-                    widget_base_dimensions: [140, 140],
-                    resize: {
-                        enabled: true,
-                        stop: function(e, ui, $widget) {
-                            $widget.resize();
-                        },
-                        axes: ['both']
-                    },
-                    max_cols: 7,
-                    avoid_overlapped_widgets: true,
-                    dock: {
-                        dockIcon: [{
-                                iClass: "fa fa-bar-chart",
-                                parentAttr: {
-                                    "data-type": Globals.graphType.HISTOGRAM.value,
-                                    "class": "icon"
-                                }
-                            }, {
-                                iClass: "fa fa-line-chart",
-                                parentAttr: {
-                                    "data-type": Globals.graphType.MULTILINE.value,
-                                    "class": "iconG"
-                                }
-                            }, {
-                                iClass: "fa fa-pie-chart",
-                                parentAttr: {
-                                    "data-type": Globals.graphType.PIE.value,
-                                    "class": "iconG"
-                                }
-                            },
-                            /* {
-                                    iClass: "fa fa-table",
-                                    parentAttr: {
-                                        "data-type": Globals.graphType.TABLE.value,
-                                        "class": "iconG"
-                                    }
-                            }*/
-                        ],
-                        position: 'right',
-                        dockClick: true,
-                        droppable: {
-                            /*  el: that.$(".dashboard .grid-container"),*/
-                            hoverClass: "over",
-                            accept: ".slideMenu li.iconG"
-                        },
-                        draggable: {
-                            /*el: that.$('.dashboard .slideMenu li.iconG'),*/
-                            cursor: "move",
-                            start: function(event, ui) {},
-                            appendTo: '.grid-container',
-                            scroll: false,
-                            helper: "clone"
-
-                        }
-                    },
-                    serialize_params: function($w, wgd) {
-                        return {
-                            myData: {
-                                type: $w.data('type'),
-                                dataId: $w.data('dataid')
-                            },
-                            col: wgd.col,
-                            row: wgd.row,
-                            size_x: wgd.size_x,
-                            size_y: wgd.size_y
-                        };
-                    },
-                    onLoaded: function() {
-                        //console.log('loaded')
-                        that.onLoadDataClick();
-                    },
-                    onAdded: function(el, data) {
-                        that.addElement(el, data);
-                    },
-                    onDeleted: function() {
-                        console.log("delete");
-                    },
-                    onAllDeleted: function() {
-                        console.log("onAllDeleted");
-                    }
-                }).data('dashboard');
-
-                /*   this.gridster = this.$(".gridster ul").gridster({
-                       widget_margins: [10, 10],
-                       widget_base_dimensions: [140, 140],
-                       resize: {
-                           enabled: true
-                       },
-                       draggable: {
-                           handle: '.Header'
-                       },
-                       resize: {
-                           enabled: true,
-                           stop: function(e, ui, $widget) {
-                               $widget.resize();
-                           }
-                       },
-                       avoid_overlapped_widgets: true,
-                       serialize_params: function($w, wgd) {
-                           return {
-                               myData: $w.data('type'),
-                               col: wgd.col,
-                               row: wgd.row,
-                               size_x: wgd.size_x,
-                               size_y: wgd.size_y
-                           };
-                       },
-
-                   }).data('gridster');*/
-
-                this.$('.dashboard').on('mouseenter', 'li.iconG', function() {
-                    that.$('.dashboard').find('.grid-container').addClass('droupAreaHoverEffect');
-                });
-                this.$('.dashboard').on('mouseleave', 'li.iconG', function() {
-                    that.$('.dashboard').find('.grid-container').removeClass('droupAreaHoverEffect');
-                });
-            },
-            addRegion: function(region_id, type, data) {
-                var that = this;
-                require(['views/graphs/GridGraphLayoutView', 'views/dashboard/GridTableLayoutView'], function(GridGraphLayoutView, GridTableLayoutView) {
-                    var region = that.getRegion(region_id);
-                    var ViewtypeObj = type;
-                    var modalObj = that.storedValueCollection.add(new Backbone.Model({
-                        id: region_id
-                    }))
-                    if (data) {
-                        modalObj.set(data);
-                    }
-                    var options = {
-                        globalVent: that.globalVent,
-                        vent: that.vent,
-                        viewType: ViewtypeObj,
-                        model: modalObj,
-                        dashboard: that.dashboard,
-                        gridHelp: that.gridHelp
-
-                    }
-                    if (type == Globals.graphType.TABLE.value) {
-                        that.showRegion(region, new GridTableLayoutView(options));
-                    } else {
-                        that.showRegion(region, new GridGraphLayoutView(options));
-                    }
-
-                })
-
-            },
-            createRegion: function(rId) {
-                var id = (rId) ? (rId) : ("grid_histo" + (this.graphIdCounter++));
-                var region = {};
-                region[id] = '#' + id;
-                this.addRegions(region);
-                return id;
-
-            },
-            showRegion: function(region, layout) {
-                region.show(layout);
-            },
-            onSaveDataClick: function() {
-                var that = this;
-                var exportData = this.dashboard.exportData();
-
-                _.each(exportData, function(ref, i) {
-                    var obj = JSON.parse(JSON.stringify(ref));
-                    if (that.storedValueCollection.get(ref.myData.dataId)) {
-                        var id = ref.myData.dataId;
-                        exportData[i] = _.extend(that.storedValueCollection.get(id).attributes, obj)
-                    }
-                });
-
-                var postObject = {
-                    userId: 0,
-                    name: "Temp",
-                    rowType: "dashboard",
-                    isOverwrite: true,
-                    values: JSON.stringify(exportData)
-                }
-
-                this.saveDahboardCollection.saveDashboard(postObject, {
-                    success: function(data, textStatus, jqXHR) {
-                        Utils.notifySuccess({
-                            content: "Dashboard saved successfully."
-                        });
-                    },
-                    error: function(jqXHR, textStatus, errorThrown) {
-                        Utils.notifyError({
-                            content: JSON.parse(jqXHR.responseText).msgDesc || "There is some problem in Dashboard, Please try again later."
-                        });
-                    },
-                    complete: function() {
-                        that.$("#loaderEvent").hide();
-                        that.$(".loader").hide();
-                    }
-                });
-
-            },
-            onLoadDataClick: function() {
-                var that = this;
-                $.extend(this.saveDahboardCollection.queryParams, {
-                    userId: 0,
-                    rowType: "dashboard"
-                });
-                that.$(".loader").show();
-                this.saveDahboardCollection.fetch({
-                    error: function(jqXHR, textStatus, errorThrown) {
-                        Utils.notifyError({
-                            content: "There is some problem in Event History, Please try again later."
-                        });
-
-                    },
-                    success: function(data, textStatus, jqXHR) {
-                    	if(that.saveDahboardCollection.length){
-                    		var dataObject = JSON.parse(that.saveDahboardCollection.models[0].get('values'));
-                            //that.saveDahboardCollection.reset(dataObject);
-                            //that.storedValueCollection.reset(dataObject);
-                            //var importData = that.storedValueCollection.toJSON();
-                            that.dashboard.importData(dataObject);
-                    	}
-                    },
-                    complete: function() {
-                        //that.$("#loaderEvent").hide();
-                        that.$(".loader").hide();
-                    }
-                });
-            },
-            onGridCloseClick: function(e) {
-                this.dashboard.deleteWidget($(e.currentTarget).parents('li'))
-            },
-            setSettingCheckbox: function() {
-                var gridHelp = Utils.localStorage.checkLocalStorage('gridHelp');
-                if (gridHelp && gridHelp.found && gridHelp.value) {
-                    if (gridHelp.value == "false") {
-                        this.gridHelp = false;
-                        this.ui.enableHelp.prop("checked", false);
-                    } else {
-                        this.gridHelp = true;
-                        this.ui.enableHelp.prop("checked", true);
-                    }
-                }
-            },
-            onEnableHelpClick: function(e) {
-                if (e.currentTarget.checked) {
-                    this.gridHelp = true;
-                    Utils.localStorage.setLocalStorage('gridHelp', true);
-                } else {
-                    this.gridHelp = false;
-                    Utils.localStorage.setLocalStorage('gridHelp', false);
-                }
-            },
-        });
-
-
-});


[04/51] [abbrv] ambari git commit: AMBARI-19849. Recent workflows in Workflow designer should be in descending order of time of updation (Venkata Sairam via pallavkul)

Posted by rz...@apache.org.
AMBARI-19849. Recent workflows in Workflow designer should be in descending order of time of updation (Venkata Sairam via pallavkul)

(cherry picked from commit ae4f0a94481b921a49f86f967352a130a5d378da)

Change-Id: I51fe5cc6b65f2144c98553499a7c6666875309bc


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 75447c992d1052d270bfec545987c2906594bbe0
Parents: ad7d916
Author: pallavkul <pa...@gmail.com>
Authored: Thu Feb 2 23:10:35 2017 +0530
Committer: Zuul <re...@hortonworks.com>
Committed: Mon Feb 6 18:15:32 2017 -0800

----------------------------------------------------------------------
 .../src/main/resources/ui/app/components/designer-workspace.js  | 5 +++--
 .../wfmanager/src/main/resources/ui/app/components/drafts-wf.js | 3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/75447c99/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js
index 16fca55..0b689b0 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/designer-workspace.js
@@ -169,8 +169,9 @@ export default Ember.Component.extend({
   generateTabId(){
     return 'tab-'+ Math.ceil(Math.random() * 100000);
   },
-  recentFilesSorted: Ember.computed.sort("recentFiles", "['updatedAt:desc']"),
-  projList:Ember.computed("recentFilesSorted", function() {
+  sortProp: ['updatedAt:desc'],
+  recentFilesSorted: Ember.computed.sort("recentFiles", "sortProp"),
+  projList: Ember.computed("recentFilesSorted", function() {
      return this.get("recentFilesSorted").slice(0, 10);
   }),
   actions : {

http://git-wip-us.apache.org/repos/asf/ambari/blob/75447c99/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js b/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
index 02483d4..33533db 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/components/drafts-wf.js
@@ -23,6 +23,7 @@ export default Ember.Component.extend({
   "isBundle": true,
   "isCoordinator": true,
   "isWorkflow": true,
+  "sortProp": ['updatedAt:desc'],
   "filteredModels": Ember.computed("model", "search", "isBundle", "isCoordinator", "isWorkflow", function(){
 	Ember.run.later(()=>{
       this.$('.actions').hide();
@@ -61,7 +62,7 @@ export default Ember.Component.extend({
 	  return eval(condition);
 	});
   }),
-  modelSorted : Ember.computed.sort("filteredModels", "['updatedAt:desc']"),
+  modelSorted : Ember.computed.sort("filteredModels", "sortProp"),
   "isDeleteDraftConformation": false,
   "currentDraft": undefined,
   "deleteInProgress": false,


[38/51] [abbrv] ambari git commit: AMBARI-19851. ambari-server start failed with exit code 1. (aonishuk)

Posted by rz...@apache.org.
AMBARI-19851. ambari-server start failed with exit code 1. (aonishuk)

(cherry picked from commit 679248abef5c2669d586d205d58886e4c219b795)

Change-Id: Ibfbb122e5e1a52604d9acd5904731917e2439959


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 69995279b022713eee0a37890b3f0a29666b15fd
Parents: 52c2da1
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Fri Feb 3 15:03:44 2017 +0200
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 07:05:29 2017 -0800

----------------------------------------------------------------------
 .../src/main/python/ambari_server/serverConfiguration.py    | 9 +++++++--
 ambari-server/src/main/python/ambari_server/serverSetup.py  | 6 +++---
 2 files changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/69995279/ambari-server/src/main/python/ambari_server/serverConfiguration.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/serverConfiguration.py b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
index 78f68ef..d3bfa70 100644
--- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py
+++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
@@ -207,6 +207,11 @@ REQUIRED_PROPERTIES = [OS_FAMILY_PROPERTY, OS_TYPE_PROPERTY, COMMON_SERVICES_PAT
                        BOOTSTRAP_SETUP_AGENT_SCRIPT, STACKADVISOR_SCRIPT, BOOTSTRAP_DIR_PROPERTY, PID_DIR_PROPERTY,
                        MPACKS_STAGING_PATH_PROPERTY]
 
+# if these properties are available 'ambari-server setup -s' is not triggered again.
+SETUP_DONE_PROPERTIES = [OS_FAMILY_PROPERTY, OS_TYPE_PROPERTY, JDK_NAME_PROPERTY, JDBC_DATABASE_PROPERTY,
+                         NR_USER_PROPERTY, PERSISTENCE_TYPE_PROPERTY
+]
+
 def get_conf_dir():
   try:
     conf_dir = os.environ[AMBARI_CONF_VAR]
@@ -1451,9 +1456,9 @@ def get_server_temp_location(properties):
     server_tmp_dir = configDefaults.SERVER_TMP_DIR_DEFAULT
   return server_tmp_dir
 
-def get_missing_properties(properties):
+def get_missing_properties(properties, property_set=REQUIRED_PROPERTIES):
   missing_propertiers = []
-  for property in REQUIRED_PROPERTIES:
+  for property in property_set:
     value = properties[property]
     if not value:
       missing_propertiers.append(property)

http://git-wip-us.apache.org/repos/asf/ambari/blob/69995279/ambari-server/src/main/python/ambari_server/serverSetup.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/serverSetup.py b/ambari-server/src/main/python/ambari_server/serverSetup.py
index 0658d18..42ef51f 100644
--- a/ambari-server/src/main/python/ambari_server/serverSetup.py
+++ b/ambari-server/src/main/python/ambari_server/serverSetup.py
@@ -37,11 +37,11 @@ from ambari_commons.os_utils import copy_files, run_os_command, is_root
 from ambari_commons.str_utils import compress_backslashes
 from ambari_server.dbConfiguration import DBMSConfigFactory, TAR_GZ_ARCHIVE_TYPE, default_connectors_map, check_jdbc_drivers
 from ambari_server.serverConfiguration import configDefaults, JDKRelease, \
-  get_ambari_properties, get_is_secure, get_is_persisted, get_java_exe_path, get_JAVA_HOME, \
+  get_ambari_properties, get_is_secure, get_is_persisted, get_java_exe_path, get_JAVA_HOME, get_missing_properties, \
   get_resources_location, get_value_from_properties, read_ambari_user, update_properties, validate_jdk, write_property, \
   JAVA_HOME, JAVA_HOME_PROPERTY, JCE_NAME_PROPERTY, JDBC_RCA_URL_PROPERTY, JDBC_URL_PROPERTY, \
   JDK_NAME_PROPERTY, JDK_RELEASES, NR_USER_PROPERTY, OS_FAMILY, OS_FAMILY_PROPERTY, OS_TYPE, OS_TYPE_PROPERTY, OS_VERSION, \
-  VIEWS_DIR_PROPERTY, JDBC_DATABASE_PROPERTY, JDK_DOWNLOAD_SUPPORTED_PROPERTY, JCE_DOWNLOAD_SUPPORTED_PROPERTY
+  VIEWS_DIR_PROPERTY, JDBC_DATABASE_PROPERTY, JDK_DOWNLOAD_SUPPORTED_PROPERTY, JCE_DOWNLOAD_SUPPORTED_PROPERTY, SETUP_DONE_PROPERTIES
 from ambari_server.serverUtils import is_server_runing
 from ambari_server.setupSecurity import adjust_directory_permissions
 from ambari_server.userInput import get_YN_input, get_validated_string_input
@@ -1081,7 +1081,7 @@ def check_setup_already_done():
     print_error_msg("Error getting ambari properties")
     return -1
 
-  return properties.get_property(JDK_NAME_PROPERTY) and properties.get_property(JDBC_DATABASE_PROPERTY)
+  return not bool(get_missing_properties(properties, property_set=SETUP_DONE_PROPERTIES))
 
 #
 # Setup the Ambari Server.


[27/51] [abbrv] ambari git commit: AMBARI-19878 Log Search Portal time zone selection bug (mgergely)

Posted by rz...@apache.org.
http://git-wip-us.apache.org/repos/asf/ambari/blob/e3b9ef3c/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/timezone/mapdata.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/timezone/mapdata.json b/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/timezone/mapdata.json
deleted file mode 100644
index 9d88d40..0000000
--- a/ambari-logsearch/ambari-logsearch-portal/src/main/webapp/libs/other/timezone/mapdata.json
+++ /dev/null
@@ -1,3158 +0,0 @@
-[{
-    "timezone": "Africa/Abidjan",
-    "country": "CI",
-    "pin": "244,118",
-    "offset": 0,
-    "points": "241,118,240,119,240,117,238,116,238,115,239,114,239,113,239,113,239,111,241,110,241,111,243,111,244,112,246,111,247,113,245,116,246,118,241,118",
-    "zoneName": "GMT"
-}, {
-    "timezone": "Africa/Accra",
-    "country": "GH",
-    "pin": "250,117",
-    "offset": 0,
-    "points": "251,117,247,118,246,118,246,118,246,116,247,114,246,110,250,110,251,113,251,116,252,116,251,117",
-    "zoneName": "GMT"
-}, {
-    "timezone": "Africa/Addis_Ababa",
-    "country": "ET",
-    "pin": "304,112",
-    "offset": 3,
-    "points": "313,118,311,118,308,120,307,119,305,120,300,119,299,116,296,114,296,113,297,113,298,110,299,110,300,107,300,107,301,105,302,105,303,104,303,105,307,105,309,108,308,110,310,110,309,110,310,112,317,114,313,118",
-    "zoneName": "EAT"
-}, {
-    "timezone": "Africa/Algiers",
-    "country": "DZ",
-    "pin": "254,74",
-    "offset": 1,
-    "points": "263,83,264,86,264,88,263,89,264,91,266,91,267,92,258,98,255,99,254,97,252,97,250,95,238,87,238,85,239,85,243,83,243,82,245,82,245,81,246,81,246,80,248,80,249,80,248,79,248,77,247,76,254,74,262,74,261,74,262,77,260,78,263,81,263,83",
-    "zoneName": "CET"
-}, {
-    "timezone": "Africa/Asmara",
-    "country": "ER",
-    "pin": "304,104",
-    "offset": 3,
-    "points": "306,104,310,107,309,108,306,105,303,105,303,104,302,105,301,105,301,101,304,100,305,104,305,103,306,104",
-    "zoneName": "EAT"
-}, {
-    "timezone": "Africa/Bamako",
-    "country": "ML",
-    "pin": "239,107",
-    "offset": 0,
-    "points": "244,107,244,108,242,109,242,111,241,111,241,110,240,111,239,110,239,111,238,110,238,110,238,109,237,108,235,108,234,108,234,107,233,105,234,103,235,104,237,103,242,103,241,90,243,90,252,96,252,97,254,97,255,99,256,98,256,101,255,104,249,104,246,105,245,107,244,106,244,107",
-    "zoneName": "GMT"
-}, {
-    "timezone": "Africa/Bangui",
-    "country": "CF",
-    "pin": "276,119",
-    "offset": 1,
-    "points": "284,118,283,119,282,118,281,119,277,118,276,119,276,120,273,120,272,122,270,119,270,117,272,115,276,114,276,113,278,112,280,110,281,110,283,111,283,113,284,113,284,113,285,114,288,118,285,118,285,118,284,118",
-    "zoneName": "WAT"
-}, {
-    "timezone": "Africa/Banjul",
-    "country": "GM",
-    "pin": "227,106",
-    "offset": 0,
-    "points": "231,106,227,106,229,106,231,106",
-    "zoneName": "GMT"
-}, {
-    "timezone": "Africa/Bissau",
-    "country": "GW",
-    "pin": "228,109",
-    "offset": 0,
-    "points": "228,109,228,109,228,109",
-    "zoneName": "GMT"
-}, {
-    "timezone": "Africa/Blantyre",
-    "country": "MW",
-    "pin": "299,147",
-    "offset": 2,
-    "points": "298,144,300,146,299,149,298,147,298,145,297,145,295,144,297,142,296,140,297,140,296,138,298,139,299,141,298,142,298,144",
-    "zoneName": "CAT"
-}, {
-    "timezone": "Africa/Brazzaville",
-    "country": "CG",
-    "pin": "271,131",
-    "offset": 1,
-    "points": "266,131,267,130,266,128,267,128,268,128,270,128,270,128,270,126,269,125,270,124,269,123,268,123,268,122,272,123,273,120,276,120,275,126,273,128,272,130,270,132,270,131,269,132,268,131,267,132,266,131",
-    "zoneName": "WAT"
-}, {
-    "timezone": "Africa/Bujumbura",
-    "country": "BI",
-    "pin": "291,130",
-    "offset": 2,
-    "points": "292,131,291,131,290,129,291,129,292,128,292,128,293,130,292,131",
-    "zoneName": "CAT"
-}, {
-    "timezone": "Asia/Oral",
-    "country": "KZ",
-    "pin": "321,54",
-    "offset": 5,
-    "points": "316,55,317,56,318,56,317,55,319,54,320,53,323,53,326,54,326,56,323,58,321,57,319,58,315,58,316,55",
-    "zoneName": "ORAT"
-}, {
-    "timezone": "Africa/Cairo",
-    "country": "EG",
-    "pin": "293,83",
-    "offset": 2,
-    "points": "294,94,285,94,284,83,285,81,290,82,293,81,294,81,295,82,298,82,298,84,298,86,296,85,295,83,295,84,300,92,299,92,299,93,297,95,294,94",
-    "zoneName": "EET"
-}, {
-    "timezone": "Africa/Casablanca",
-    "country": "MA",
-    "pin": "239,78",
-    "offset": 0,
-    "points": "242,84,240,84,238,85,238,87,232,87,236,84,237,83,236,81,237,80,241,78,242,75,243,75,244,76,246,76,248,77,248,80,246,80,246,81,245,81,245,82,243,82,242,84",
-    "zoneName": "WET"
-}, {
-    "timezone": "Africa/Ceuta",
-    "country": "ES",
-    "pin": "243,75",
-    "offset": 1,
-    "points": "243,75,243,75,243,75",
-    "zoneName": "CET"
-}, {
-    "timezone": "Africa/Conakry",
-    "country": "GN",
-    "pin": "231,112",
-    "offset": 0,
-    "points": "238,114,237,115,236,113,235,114,235,113,234,111,233,111,232,112,231,111,230,110,229,109,231,109,231,107,234,108,235,108,237,108,238,109,238,110,238,110,239,111,239,112,239,113,239,113,239,114,238,114",
-    "zoneName": "GMT"
-}, {
-    "timezone": "Africa/Dakar",
-    "country": "SN",
-    "pin": "226,105",
-    "offset": 0,
-    "points": "227,107,229,106,231,106,229,106,227,106,226,105,227,102,230,102,233,105,234,108,229,107,227,108,227,108,227,108,227,107",
-    "zoneName": "GMT"
-}, {
-    "timezone": "Africa/Dar_es_Salaam",
-    "country": "TZ",
-    "pin": "305,134",
-    "offset": 3,
-    "points": "306,139,306,139,306,140,302,141,299,141,297,138,293,137,291,134,291,132,293,130,292,129,293,128,292,126,297,126,302,129,302,130,304,131,304,134,305,135,305,137,306,139",
-    "zoneName": "EAT"
-}, {
-    "timezone": "Asia/Yekaterinburg",
-    "country": "RU",
-    "pin": "334,46",
-    "offset": 6,
-    "points": "333,53,335,54,335,54,333,55,331,54,329,54,327,55,326,54,326,55,324,53,321,53,322,51,322,50,324,50,325,49,324,48,325,48,324,47,326,47,325,46,326,46,325,44,325,43,324,43,325,42,323,41,322,40,326,40,329,40,332,39,333,35,342,31,341,31,342,31,341,31,341,30,340,29,342,29,342,29,341,29,345,30,346,29,345,28,343,28,344,28,344,27,343,27,345,25,346,24,351,24,350,26,351,27,351,27,351,29,352,30,350,32,346,32,346,33,350,33,354,31,353,30,356,29,357,30,357,31,358,31,361,32,358,31,359,30,358,29,353,29,352,28,353,27,351,26,354,25,354,24,355,25,354,26,355,26,359,27,356,25,358,25,357,25,358,25,362,25,360,26,362,26,362,27,360,28,365,29,365,30,364,31,364,31,364,32,366,32,366,34,367,34,367,35,369,35,369,36,368,37,369,37,367,39,369,40,369,40,364,41,357,40,356,42,353,44,349,44,348,44,348,45,350,46,348,47,348,48,346,48,341,50,335,50,335,51,336,51,335,51,334,52,335,52,333,53",
-    "zoneName": "YEKT"
-}, {
-    "timezone": "Africa/Djibouti",
-    "country": "DJ",
-    "pin": "310,109",
-    "offset": 3,
-    "points": "310,109,310,109,310,109",
-    "zoneName": "EAT"
-}, {
-    "timezone": "Africa/Douala",
-    "country": "CM",
-    "pin": "263,119",
-    "offset": 1,
-    "points": "270,117,270,119,272,121,272,123,270,122,264,122,263,119,263,120,262,119,262,117,264,116,265,115,266,116,266,115,269,110,270,109,270,107,271,107,271,110,272,111,269,112,272,114,270,117",
-    "zoneName": "WAT"
-}, {
-    "timezone": "Africa/Freetown",
-    "country": "SL",
-    "pin": "232,113",
-    "offset": 0,
-    "points": "235,115,234,115,232,114,232,112,233,111,234,111,235,112,235,114,236,114,235,115",
-    "zoneName": "GMT"
-}, {
-    "timezone": "Africa/Gaborone",
-    "country": "BW",
-    "pin": "286,159",
-    "offset": 2,
-    "points": "287,158,285,161,282,160,281,162,279,162,279,161,278,159,278,156,279,156,279,150,282,150,283,151,285,150,286,152,289,153,289,155,291,156,287,158",
-    "zoneName": "CAT"
-}, {
-    "timezone": "Africa/Harare",
-    "country": "ZW",
-    "pin": "293,150",
-    "offset": 2,
-    "points": "293,156,289,155,289,153,286,152,285,150,288,150,291,147,296,148,295,151,296,153,295,155,293,156",
-    "zoneName": "CAT"
-}, {
-    "timezone": "Africa/El_Aaiun",
-    "country": "EH",
-    "pin": "232,87",
-    "offset": 0,
-    "points": "233,89,233,92,232,93,232,95,227,95,226,96,226,95,228,92,228,92,229,91,230,89,231,88,232,87,238,87,238,89,233,89",
-    "zoneName": "WET"
-}, {
-    "timezone": "Africa/Johannesburg",
-    "country": "ZA",
-    "pin": "289,161",
-    "offset": 2,
-    "points": "283,172,278,173,276,172,276,173,275,171,275,170,275,169,273,165,274,164,274,165,275,165,278,164,278,159,279,161,279,162,280,162,282,160,285,161,288,158,290,156,293,156,294,159,294,161,294,161,293,162,294,163,294,163,294,162,296,162,295,165,289,171,286,172,283,172",
-    "zoneName": "SAST"
-}, {
-    "timezone": "Africa/Juba",
-    "country": "SS",
-    "pin": "294,118",
-    "offset": 3,
-    "points": "299,117,299,118,300,118,300,119,298,119,297,120,293,120,291,119,289,119,289,119,287,116,284,113,285,111,286,111,287,112,290,112,292,111,293,111,295,110,295,108,296,108,296,110,297,111,297,113,296,113,296,114,297,115,299,117",
-    "zoneName": "EAT"
-}, {
-    "timezone": "Africa/Kampala",
-    "country": "UG",
-    "pin": "295,125",
-    "offset": 3,
-    "points": "293,126,291,127,292,124,293,122,293,122,293,120,297,120,297,119,299,122,297,125,297,126,293,126",
-    "zoneName": "EAT"
-}, {
-    "timezone": "Africa/Khartoum",
-    "country": "SD",
-    "pin": "295,103",
-    "offset": 3,
-    "points": "300,107,299,110,298,110,297,112,296,110,296,108,295,108,295,108,295,110,293,111,292,111,290,112,287,112,286,111,285,111,284,113,283,113,283,111,282,110,281,107,280,107,282,103,283,103,283,97,285,97,285,94,294,94,297,95,299,93,301,94,302,96,302,99,304,100,301,101,301,106,300,107,300,107",
-    "zoneName": "EAT"
-}, {
-    "timezone": "Africa/Kinshasa",
-    "country": "CD",
-    "pin": "271,131",
-    "offset": 1,
-    "points": "271,131,272,130,273,128,275,126,276,119,277,118,277,118,279,119,283,120,281,120,283,122,281,122,281,123,283,125,282,126,283,126,282,126,284,127,281,128,281,128,281,128,279,128,279,131,278,131,278,135,277,135,277,136,274,136,273,133,267,133,268,131,269,132,270,131,270,132,271,131",
-    "zoneName": "WAT"
-}, {
-    "timezone": "Africa/Lagos",
-    "country": "NG",
-    "pin": "255,116",
-    "offset": 1,
-    "points": "261,119,258,119,256,116,254,116,254,112,255,110,255,109,256,106,258,106,260,107,261,106,263,107,265,106,267,107,269,106,270,108,270,109,269,110,266,115,266,116,264,115,262,117,262,118,261,119",
-    "zoneName": "WAT"
-}, {
-    "timezone": "Africa/Libreville",
-    "country": "GA",
-    "pin": "263,124",
-    "offset": 1,
-    "points": "269,125,270,126,270,128,267,128,267,128,266,128,267,130,266,131,263,128,262,126,263,126,263,125,264,125,263,124,263,124,266,124,266,122,268,122,268,123,270,123,270,124,269,125",
-    "zoneName": "WAT"
-}, {
-    "timezone": "Africa/Lome",
-    "country": "TG",
-    "pin": "252,116",
-    "offset": 0,
-    "points": "252,116,251,116,251,113,250,110,251,110,251,111,252,111,253,116,252,116",
-    "zoneName": "GMT"
-}, {
-    "timezone": "Africa/Kigali",
-    "country": "RW",
-    "pin": "292,128",
-    "offset": 2,
-    "points": "292,128,291,129,290,129,291,127,292,126,293,128,292,128",
-    "zoneName": "CAT"
-}, {
-    "timezone": "Africa/Luanda",
-    "country": "AO",
-    "pin": "268,137",
-    "offset": 1,
-    "points": "281,140,281,141,283,140,283,143,281,143,281,148,283,149,279,150,276,149,269,149,268,149,266,149,267,144,269,142,269,140,268,138,269,137,267,133,273,133,274,136,277,136,277,135,280,135,280,138,281,140",
-    "zoneName": "WAT"
-}, {
-    "timezone": "Africa/Lubumbashi",
-    "country": "CD",
-    "pin": "288,141",
-    "offset": 2,
-    "points": "291,132,291,134,293,136,290,137,289,138,290,139,289,141,290,142,291,142,291,144,290,144,288,141,287,142,286,142,285,141,284,141,283,140,281,141,280,135,278,135,277,134,278,133,278,131,279,131,279,128,281,128,281,128,281,128,284,127,282,126,283,126,282,126,283,125,281,123,281,122,283,122,281,120,283,120,281,119,282,118,285,118,285,118,288,118,289,119,291,119,293,120,293,122,293,122,292,124,291,127,290,128,291,132",
-    "zoneName": "CAT"
-}, {
-    "timezone": "Africa/Lusaka",
-    "country": "ZM",
-    "pin": "289,146",
-    "offset": 2,
-    "points": "290,147,290,148,287,150,284,149,283,149,281,148,281,143,283,143,283,140,284,141,285,141,286,142,287,142,288,141,290,144,291,144,291,142,290,142,289,141,290,139,289,138,290,137,293,136,296,138,297,140,296,140,297,142,295,144,296,144,292,146,292,147,290,147",
-    "zoneName": "CAT"
-}, {
-    "timezone": "Africa/Malabo",
-    "country": "GQ",
-    "pin": "262,120",
-    "offset": 1,
-    "points": "266,123,266,124,263,123,264,122,266,122,266,123",
-    "zoneName": "WAT"
-}, {
-    "timezone": "Africa/Maputo",
-    "country": "MZ",
-    "pin": "295,161",
-    "offset": 2,
-    "points": "296,160,295,161,295,162,296,161,296,162,295,162,294,159,293,156,295,155,296,153,295,151,296,148,292,147,292,146,296,144,297,145,298,145,298,146,298,147,299,149,300,146,298,144,298,141,302,141,306,140,306,146,305,148,303,149,300,151,298,152,298,154,299,156,299,158,296,160",
-    "zoneName": "CAT"
-}, {
-    "timezone": "Africa/Mbabane",
-    "country": "SZ",
-    "pin": "293,162",
-    "offset": 2,
-    "points": "294,161,295,162,294,163,293,162,294,161,294,161",
-    "zoneName": "SAST"
-}, {
-    "timezone": "Africa/Mogadishu",
-    "country": "SO",
-    "pin": "313,122",
-    "offset": 3,
-    "points": "310,125,308,127,307,126,307,121,308,119,312,118,317,114,311,113,309,110,310,109,312,111,321,109,321,111,321,111,321,111,321,112,317,119,310,125",
-    "zoneName": "EAT"
-}, {
-    "timezone": "Africa/Monrovia",
-    "country": "LR",
-    "pin": "235,116",
-    "offset": 0,
-    "points": "239,118,240,119,238,119,234,116,236,113,237,113,237,115,238,115,238,114,239,115,238,116,240,117,239,118",
-    "zoneName": "GMT"
-}, {
-    "timezone": "Africa/Nairobi",
-    "country": "KE",
-    "pin": "301,127",
-    "offset": 3,
-    "points": "308,127,306,129,304,131,302,130,302,129,297,126,297,125,299,122,297,119,298,119,300,119,305,120,307,119,308,119,307,121,307,126,308,127",
-    "zoneName": "EAT"
-}, {
-    "timezone": "Africa/Maseru",
-    "country": "LS",
-    "pin": "288,166",
-    "offset": 2,
-    "points": "289,167,289,167,288,166,290,165,291,166,289,167",
-    "zoneName": "SAST"
-}, {
-    "timezone": "Africa/Ndjamena",
-    "country": "TD",
-    "pin": "271,108",
-    "offset": 1,
-    "points": "278,112,276,113,276,114,272,115,269,112,270,111,272,111,271,110,271,107,270,107,269,105,272,102,272,97,271,95,271,93,272,92,283,98,283,103,282,103,280,107,281,107,282,110,280,110,279,112,278,112",
-    "zoneName": "WAT"
-}, {
-    "timezone": "Africa/Niamey",
-    "country": "NE",
-    "pin": "253,106",
-    "offset": 1,
-    "points": "256,106,255,108,255,109,254,108,253,108,253,107,251,107,252,106,251,106,250,104,255,104,256,101,256,98,258,98,267,92,270,94,271,93,271,95,272,97,272,102,269,105,269,106,267,107,265,106,263,107,261,106,260,107,258,106,256,106",
-    "zoneName": "WAT"
-}, {
-    "timezone": "Africa/Nouakchott",
-    "country": "MR",
-    "pin": "228,100",
-    "offset": 0,
-    "points": "234,103,233,105,230,102,227,102,227,103,228,100,227,98,228,97,227,95,226,96,232,95,232,93,233,92,233,89,238,89,238,87,243,90,241,90,242,103,237,103,235,104,234,103",
-    "zoneName": "GMT"
-}, {
-    "timezone": "Africa/Ouagadougou",
-    "country": "BF",
-    "pin": "248,108",
-    "offset": 0,
-    "points": "249,110,246,110,246,112,246,111,243,112,242,111,242,109,244,108,244,106,245,107,247,105,250,104,250,104,251,106,252,106,251,107,253,107,253,109,252,110,249,110",
-    "zoneName": "GMT"
-}, {
-    "timezone": "Africa/Porto-Novo",
-    "country": "BJ",
-    "pin": "254,116",
-    "offset": 1,
-    "points": "254,114,254,116,252,116,252,112,251,111,252,109,253,109,254,108,255,109,255,110,254,112,254,114",
-    "zoneName": "WAT"
-}, {
-    "timezone": "Africa/Tunis",
-    "country": "TN",
-    "pin": "264,74",
-    "offset": 1,
-    "points": "266,80,264,81,264,82,263,83,263,80,261,79,260,78,262,76,261,74,263,73,264,73,264,74,265,74,265,75,266,76,264,78,266,79,266,80",
-    "zoneName": "CET"
-}, {
-    "timezone": "Africa/Sao_Tome",
-    "country": "ST",
-    "pin": "259,125",
-    "offset": 0,
-    "points": "260,123,260,123,260,123",
-    "zoneName": "GMT"
-}, {
-    "timezone": "Africa/Tripoli",
-    "country": "LY",
-    "pin": "268,79",
-    "offset": 2,
-    "points": "285,88,285,97,283,97,283,98,272,92,270,94,264,91,263,89,264,88,264,86,263,83,264,82,264,81,266,80,266,79,271,80,272,81,276,83,278,82,278,80,281,79,282,80,285,81,284,83,285,88",
-    "zoneName": "EET"
-}, {
-    "timezone": "Africa/Windhoek",
-    "country": "NA",
-    "pin": "274,156",
-    "offset": 2,
-    "points": "278,163,278,164,277,165,274,165,274,164,273,165,272,164,271,162,270,156,267,151,266,149,268,149,269,149,276,149,279,150,284,149,285,150,283,151,282,150,279,150,279,156,278,156,278,163",
-    "zoneName": "WAST"
-}, {
-    "timezone": "America/Adak",
-    "country": "US",
-    "pin": "5,53",
-    "offset": -10,
-    "points": "7,53,6,53,8,52,7,53",
-    "zoneName": "HST"
-}, {
-    "timezone": "America/Argentina/Salta",
-    "country": "AR",
-    "pin": "159,159",
-    "offset": -3,
-    "points": "162,180,162,182,163,182,160,182,160,183,150,183,150,180,152,179,151,176,152,175,153,177,155,177,155,175,160,175,160,174,162,174,162,180",
-    "zoneName": "ART"
-}, {
-    "timezone": "America/Argentina/Salta",
-    "country": "AR",
-    "pin": "159,159",
-    "offset": -3,
-    "points": "159,156,161,157,161,156,163,156,163,156,163,159,162,161,158,162,157,161,158,160,155,160,155,159,157,158,158,159,158,157,159,159,161,159,161,158,160,158,159,156",
-    "zoneName": "ART"
-}, {
-    "timezone": "America/Anchorage",
-    "country": "US",
-    "pin": "42,40",
-    "offset": -9,
-    "points": "42,42,40,43,39,43,40,42,39,42,40,41,43,41,42,40,42,40,40,40,36,43,37,43,36,44,30,47,30,47,25,48,25,48,27,48,27,47,31,45,31,44,32,43,30,44,30,43,29,44,27,43,25,44,25,37,27,36,26,36,27,35,25,35,25,33,26,33,25,33,25,32,26,33,25,32,25,27,33,26,34,26,33,27,35,26,39,27,39,27,38,27,39,27,51,28,54,28,54,42,54,41,50,42,46,41,47,40,44,40,45,40,43,41,44,41,44,41,44,41,42,42",
-    "zoneName": "AKST"
-}, {
-    "timezone": "America/Anguilla",
-    "country": "AI",
-    "pin": "162,100",
-    "offset": -4,
-    "points": "162,100,162,100,162,100",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Antigua",
-    "country": "AG",
-    "pin": "164,101",
-    "offset": -4,
-    "points": "164,101,164,101,164,101",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Araguaina",
-    "country": "BR",
-    "pin": "183,135",
-    "offset": -3,
-    "points": "185,136,185,136,185,138,186,139,185,141,186,141,186,143,184,143,182,143,182,142,181,143,180,143,180,142,180,143,180,140,182,137,182,135,183,134,183,133,183,132,184,133,184,135,185,136",
-    "zoneName": "BRT"
-}, {
-    "timezone": "America/Argentina/Buenos_Aires",
-    "country": "AR",
-    "pin": "169,173",
-    "offset": -3,
-    "points": "167,171,169,172,169,173,171,174,170,175,171,176,169,178,165,179,163,179,164,180,163,180,163,181,164,181,163,182,162,182,162,173,164,173,165,172,167,171",
-    "zoneName": "ART"
-}, {
-    "timezone": "America/Argentina/Catamarca",
-    "country": "AR",
-    "pin": "159,165",
-    "offset": -3,
-    "points": "159,188,157,188,156,189,151,189,151,188,150,187,151,187,150,187,151,186,150,184,160,183,161,184,161,183,162,184,160,184,161,185,159,186,159,188",
-    "zoneName": "ART"
-}, {
-    "timezone": "America/Argentina/Catamarca",
-    "country": "AR",
-    "pin": "159,165",
-    "offset": -3,
-    "points": "160,167,158,164,154,164,155,162,155,160,158,160,157,161,159,162,158,163,159,164,159,164,160,167",
-    "zoneName": "ART"
-}, {
-    "timezone": "America/Argentina/Cordoba",
-    "country": "AR",
-    "pin": "161,169",
-    "offset": -3,
-    "points": "163,173,162,173,162,174,160,174,160,170,159,169,159,168,160,166,159,164,161,161,162,161,163,159,163,156,165,158,170,160,169,163,173,163,174,162,174,161,175,161,175,163,173,164,170,167,169,172,166,171,164,173,163,173",
-    "zoneName": "ART"
-}, {
-    "timezone": "America/Argentina/Jujuy",
-    "country": "AR",
-    "pin": "159,159",
-    "offset": -3,
-    "points": "157,157,158,155,159,156,159,157,160,158,161,158,161,159,160,159,159,159,158,157,158,159,157,158,157,157",
-    "zoneName": "ART"
-}, {
-    "timezone": "America/Argentina/La_Rioja",
-    "country": "AR",
-    "pin": "157,166",
-    "offset": -3,
-    "points": "156,167,154,166,154,165,153,164,154,164,158,164,160,167,159,169,157,169,156,167",
-    "zoneName": "ART"
-}, {
-    "timezone": "America/Argentina/Mendoza",
-    "country": "AR",
-    "pin": "154,171",
-    "offset": -3,
-    "points": "152,170,156,170,157,171,157,175,155,175,155,177,153,177,152,175,152,174,153,171,152,170",
-    "zoneName": "ART"
-}, {
-    "timezone": "America/Argentina/Rio_Gallegos",
-    "country": "AR",
-    "pin": "154,197",
-    "offset": -3,
-    "points": "151,189,156,189,157,190,159,191,158,192,154,195,154,197,155,198,150,197,149,197,150,195,148,196,148,195,148,193,150,192,149,191,150,191,151,189",
-    "zoneName": "ART"
-}, {
-    "timezone": "America/Argentina/San_Juan",
-    "country": "AR",
-    "pin": "155,169",
-    "offset": -3,
-    "points": "153,167,154,164,154,165,154,166,156,167,157,169,156,169,156,170,154,169,152,170,152,168,153,167",
-    "zoneName": "ART"
-}, {
-    "timezone": "America/Argentina/San_Luis",
-    "country": "AR",
-    "pin": "158,171",
-    "offset": -3,
-    "points": "159,169,160,170,160,175,157,175,156,169,159,169",
-    "zoneName": "ART"
-}, {
-    "timezone": "America/Argentina/Tucuman",
-    "country": "AR",
-    "pin": "159,162",
-    "offset": -3,
-    "points": "158,161,160,161,160,164,159,164,158,163,159,162,158,161",
-    "zoneName": "ART"
-}, {
-    "timezone": "America/Aruba",
-    "country": "AW",
-    "pin": "153,108",
-    "offset": -4,
-    "points": "153,108,153,108,153,108",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Argentina/Ushuaia",
-    "country": "AR",
-    "pin": "155,201",
-    "offset": -3,
-    "points": "155,201,155,198,155,199,155,199,156,200,160,201,158,201,155,201",
-    "zoneName": "ART"
-}, {
-    "timezone": "America/Asuncion",
-    "country": "PY",
-    "pin": "170,160",
-    "offset": -3,
-    "points": "174,161,173,163,169,163,170,160,165,158,163,156,164,152,167,152,169,152,169,156,172,156,173,158,175,158,174,161",
-    "zoneName": "PYST"
-}, {
-    "timezone": "America/Bahia_Banderas",
-    "country": "MX",
-    "pin": "104,96",
-    "offset": -6,
-    "points": "104,96,103,96,104,96",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Atikokan",
-    "country": "CA",
-    "pin": "123,57",
-    "offset": -5,
-    "points": "125,58,122,58,123,57,124,57,124,58,125,58",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Bahia",
-    "country": "BR",
-    "pin": "197,143",
-    "offset": -2,
-    "points": "187,146,186,146,186,141,185,141,186,140,187,139,188,140,189,140,189,138,191,138,193,137,194,138,195,137,197,137,198,139,197,140,198,141,196,143,196,147,195,150,194,149,195,147,194,147,193,147,192,146,189,145,189,145,187,146",
-    "zoneName": "BRT"
-}, {
-    "timezone": "America/Barbados",
-    "country": "BB",
-    "pin": "167,107",
-    "offset": -4,
-    "points": "167,106,167,107,167,106",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Belem",
-    "country": "BR",
-    "pin": "183,127",
-    "offset": -3,
-    "points": "179,126,180,125,179,126,180,125,183,125,182,127,180,128,182,127,181,128,183,127,183,126,186,127,185,130,182,132,183,133,182,135,182,137,180,139,177,138,178,138,177,136,178,134,177,132,177,130,178,129,177,127,178,127,177,126,176,123,174,122,174,122,177,122,178,119,180,122,181,123,179,126",
-    "zoneName": "BRT"
-}, {
-    "timezone": "America/Belize",
-    "country": "BZ",
-    "pin": "128,101",
-    "offset": -6,
-    "points": "128,101,128,101,128,101",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Blanc-Sablon",
-    "country": "CA",
-    "pin": "171,54",
-    "offset": -4,
-    "points": "169,54,167,55,169,54",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Boa_Vista",
-    "country": "BR",
-    "pin": "166,121",
-    "offset": -4,
-    "points": "167,118,166,119,167,120,167,121,167,122,168,123,168,125,167,125,166,126,165,126,164,127,163,126,163,122,161,122,160,119,163,120,163,119,165,119,166,118,167,118",
-    "zoneName": "AMT"
-}, {
-    "timezone": "America/Bogota",
-    "country": "CO",
-    "pin": "147,119",
-    "offset": -5,
-    "points": "154,126,153,131,152,130,153,129,152,128,150,128,149,128,146,125,142,124,140,123,143,120,142,119,143,117,142,115,143,114,143,113,143,114,143,113,145,112,145,110,148,109,150,108,151,108,149,110,148,112,149,113,149,115,150,115,153,115,154,117,156,117,156,119,157,120,156,121,157,122,157,123,156,122,153,123,153,124,154,124,153,124,154,126",
-    "zoneName": "COT"
-}, {
-    "timezone": "America/Boise",
-    "country": "US",
-    "pin": "89,64",
-    "offset": -7,
-    "points": "96,66,96,67,87,67,87,66,86,66,86,64,87,63,88,62,88,61,89,62,92,62,93,63,96,63,96,66",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Cambridge_Bay",
-    "country": "CA",
-    "pin": "104,29",
-    "offset": -7,
-    "points": "99,18,100,19,99,19,101,19,100,20,102,19,104,20,103,21,97,21,97,20,99,20,97,20,98,19,97,19,99,18",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Cambridge_Bay",
-    "country": "CA",
-    "pin": "104,29",
-    "offset": -7,
-    "points": "108,36,97,35,95,34,92,34,81,30,81,28,89,29,92,30,89,31,90,31,97,31,100,32,99,32,101,33,100,32,101,32,101,32,101,32,100,31,103,30,99,30,100,30,103,29,105,31,106,30,109,31,113,31,113,30,115,30,116,30,116,31,117,30,116,31,118,32,117,30,120,30,120,30,120,29,119,30,120,28,116,28,117,27,116,27,116,26,119,25,118,25,120,25,121,26,121,27,123,28,122,27,121,28,122,28,121,28,125,29,123,29,124,29,124,30,125,30,126,29,126,32,108,32,108,36",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Cambridge_Bay",
-    "country": "CA",
-    "pin": "104,29",
-    "offset": -7,
-    "points": "115,24,116,24,116,25,116,25,114,25,114,26,113,26,107,24,111,24,110,23,115,24",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Cambridge_Bay",
-    "country": "CA",
-    "pin": "104,29",
-    "offset": -7,
-    "points": "100,23,103,24,105,26,105,26,110,27,110,28,106,28,107,28,107,29,108,28,109,29,107,29,104,29,104,29,102,28,99,30,93,30,92,29,93,29,88,29,87,28,97,28,97,24,99,24,100,26,101,25,100,23,100,23",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Campo_Grande",
-    "country": "BR",
-    "pin": "174,153",
-    "offset": -3,
-    "points": "176,150,177,151,179,152,179,153,175,158,173,158,172,156,169,156,170,150,172,149,173,150,175,149,175,150,176,150",
-    "zoneName": "AMST"
-}, {
-    "timezone": "America/Cancun",
-    "country": "MX",
-    "pin": "129,96",
-    "offset": -6,
-    "points": "128,95,130,96,128,98,129,98,128,100,128,99,127,100,126,100,126,98,128,96,128,95",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Caracas",
-    "country": "VE",
-    "pin": "157,110",
-    "offset": -4.5,
-    "points": "163,111,165,112,165,113,167,113,166,115,166,115,165,116,165,117,166,118,163,119,163,120,160,119,161,122,162,122,159,124,159,124,158,124,157,123,157,122,156,121,157,120,156,119,156,116,154,117,153,115,150,115,149,112,148,112,149,110,151,109,150,109,151,110,150,111,150,112,151,112,151,112,151,110,153,109,153,108,153,109,155,109,155,110,158,110,160,111,162,110,161,110,164,110,163,110,163,111",
-    "zoneName": "VET"
-}, {
-    "timezone": "America/Cayenne",
-    "country": "GF",
-    "pin": "177,118",
-    "offset": -3,
-    "points": "176,117,178,119,177,122,175,122,175,120,174,118,175,117,176,117",
-    "zoneName": "GFT"
-}, {
-    "timezone": "America/Cayman",
-    "country": "KY",
-    "pin": "137,98",
-    "offset": -5,
-    "points": "139,98,139,98,139,98",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Chicago",
-    "country": "US",
-    "pin": "128,67",
-    "offset": -6,
-    "points": "128,72,132,74,132,75,131,76,132,80,132,84,130,83,130,83,129,83,129,82,128,83,128,82,128,83,124,83,126,83,125,84,126,84,126,85,125,84,125,85,120,83,118,84,118,84,118,85,116,86,117,85,116,85,116,86,115,86,115,87,114,87,115,87,115,89,112,88,112,87,109,84,107,84,107,85,105,84,104,82,104,81,107,81,107,74,108,74,108,73,109,73,109,70,108,70,108,69,109,69,109,67,110,67,109,64,111,63,110,63,111,62,111,61,109,61,110,60,110,59,106,59,105,57,118,57,118,56,119,57,126,58,122,60,124,60,124,60,128,61,128,62,128,63,129,63,128,66,129,67,130,67,128,68,128,72",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Chihuahua",
-    "country": "MX",
-    "pin": "103,85",
-    "offset": -7,
-    "points": "106,85,106,86,106,88,105,88,103,88,101,89,98,86,99,86,99,82,100,82,100,81,102,81,104,83,105,84,106,85",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Coral_Harbour",
-    "country": "",
-    "pin": "250,125",
-    "offset": -5,
-    "points": "131,33,132,34,133,34,136,35,137,36,136,36,139,36,137,37,135,36,131,37,131,36,129,37,130,36,130,34,131,33",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Costa_Rica",
-    "country": "CR",
-    "pin": "133,111",
-    "offset": -6,
-    "points": "132,112,131,111,131,109,134,110,135,112,135,112,135,114,131,111,132,112",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Creston",
-    "country": "CA",
-    "pin": "88,57",
-    "offset": -7,
-    "points": "89,57,87,57,88,56,89,57",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Cuiaba",
-    "country": "BR",
-    "pin": "172,147",
-    "offset": -3,
-    "points": "179,146,176,148,176,150,175,150,175,149,173,150,172,149,170,150,169,149,169,148,166,148,166,144,167,142,167,141,165,140,164,137,169,137,169,135,170,137,171,138,180,139,180,141,180,143,179,146",
-    "zoneName": "AMST"
-}, {
-    "timezone": "America/Curacao",
-    "country": "CW",
-    "pin": "154,108",
-    "offset": -4,
-    "points": "154,108,154,108,154,108",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Danmarkshavn",
-    "country": "GL",
-    "pin": "224,18",
-    "offset": 0,
-    "points": "223,15,223,15,224,15,221,16,221,16,220,17,221,17,223,17,224,17,221,17,224,18,225,18,218,18,223,19,220,19,223,20,218,20,219,14,223,15",
-    "zoneName": "GMT"
-}, {
-    "timezone": "America/Dawson",
-    "country": "CA",
-    "pin": "56,36",
-    "offset": -8,
-    "points": "56,36,56,36,56,36",
-    "zoneName": "PST"
-}, {
-    "timezone": "America/Dawson_Creek",
-    "country": "CA",
-    "pin": "83,42",
-    "offset": -7,
-    "points": "83,45,83,50,79,48,78,46,83,45",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Denver",
-    "country": "US",
-    "pin": "104,70",
-    "offset": -7,
-    "points": "93,63,92,62,91,62,91,60,89,59,89,57,105,57,106,59,108,59,108,60,110,61,109,61,111,61,111,62,110,63,111,63,109,64,110,67,109,67,109,69,108,69,108,70,109,70,109,73,108,73,108,74,107,74,107,81,104,81,104,82,102,81,99,81,99,76,96,76,95,74,95,74,92,74,92,67,96,67,96,63,93,63",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Detroit",
-    "country": "US",
-    "pin": "135,66",
-    "offset": -5,
-    "points": "132,67,129,67,130,66,130,64,130,63,131,62,132,63,132,61,134,62,134,62,134,63,133,65,135,64,136,65,134,67,132,67",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Detroit",
-    "country": "US",
-    "pin": "135,66",
-    "offset": -5,
-    "points": "125,60,127,59,127,60,130,61,132,60,134,61,131,61,130,62,129,61,128,62,129,62,128,61,126,61,125,60",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Dominica",
-    "country": "DM",
-    "pin": "165,104",
-    "offset": -4,
-    "points": "165,103,165,104,165,103",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Edmonton",
-    "country": "CA",
-    "pin": "92,51",
-    "offset": -7,
-    "points": "92,57,88,56,88,55,85,53,86,52,86,52,83,51,83,42,97,42,97,51,99,51,97,52,97,57,92,57",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Eirunepe",
-    "country": "BR",
-    "pin": "153,134",
-    "offset": -4,
-    "points": "156,138,148,135,148,134,149,132,150,131,153,131,156,138",
-    "zoneName": "ACT"
-}, {
-    "timezone": "America/El_Salvador",
-    "country": "SV",
-    "pin": "126,106",
-    "offset": -6,
-    "points": "126,106,125,106,126,105,128,106,128,107,126,106",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Fortaleza",
-    "country": "BR",
-    "pin": "197,130",
-    "offset": -3,
-    "points": "201,134,202,135,201,135,199,137,198,136,198,135,197,136,194,135,194,136,192,138,189,138,189,140,187,140,186,139,185,138,185,136,184,135,184,133,182,132,185,130,186,126,187,127,187,127,188,127,188,128,188,130,188,128,189,129,190,128,191,129,194,129,198,132,201,132,201,134",
-    "zoneName": "BRT"
-}, {
-    "timezone": "America/Glace_Bay",
-    "country": "CA",
-    "pin": "167,61",
-    "offset": -4,
-    "points": "167,61,166,61,166,61,167,61",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Godthab",
-    "country": "GL",
-    "pin": "178,36",
-    "offset": -3,
-    "points": "188,42,187,42,188,41,187,41,188,41,187,41,187,41,186,41,187,40,186,41,187,40,183,41,184,40,183,40,183,40,182,40,183,39,182,39,182,39,181,39,182,39,181,39,182,39,180,38,181,37,180,38,180,38,180,37,180,37,179,37,180,37,179,37,180,37,179,37,179,36,178,36,180,36,178,36,180,35,179,35,180,35,181,36,179,34,180,35,178,36,178,35,179,35,177,35,178,34,177,34,180,34,177,34,177,34,176,34,178,33,176,33,180,32,175,33,176,33,175,33,177,33,176,32,177,32,175,32,180,32,175,31,181,31,177,31,178,31,175,31,176,30,178,31,176,30,180,31,179,30,179,30,176,30,179,30,180,29,179,30,179,29,180,29,180,29,180,29,180,29,179,29,180,28,179,28,180,28,174,27,180,27,179,27,179,27,178,26,179,26,177,26,178,26,177,26,179,26,176,26,178,25,176,25,175,25,175,26,173,26,172,25,174,25,173,25,174,25,173,24,174,24,173,23,174,23,172,23,173,22,172,22,172,22,170,22,172,21,168,20,169,20,169,20,161,19,158,15,160,15,160,14,162,14,156,13,162,12,163,13,162,12,165,12,165,12,166,12,165,11,166,11,172,12,167,11,169,11,174,11,17
 6,11,175,12,176,11,181,12,179,11,181,11,179,10,180,10,188,11,189,11,188,11,188,11,188,11,191,11,186,10,195,10,187,10,196,10,196,10,199,10,196,9,202,9,214,9,201,10,215,9,216,10,214,10,220,10,204,11,216,11,213,12,213,12,221,11,220,12,217,13,224,12,223,12,228,11,234,12,229,13,221,13,228,13,221,14,222,14,226,14,225,14,219,14,218,20,223,20,223,21,219,20,220,20,219,20,222,21,219,21,224,22,219,22,219,22,219,22,220,23,220,22,222,22,221,23,219,23,217,23,219,23,214,22,216,23,212,23,213,23,212,23,212,24,215,24,212,24,216,24,213,24,215,24,215,25,216,25,216,26,210,25,212,25,210,26,215,26,211,26,212,26,209,27,213,27,210,28,212,28,215,27,219,28,213,30,208,30,206,30,205,30,206,31,204,31,202,33,198,33,198,34,197,33,198,33,197,33,197,33,197,33,197,34,195,34,194,34,195,34,194,35,193,35,194,36,192,36,194,36,194,37,192,36,193,37,192,37,192,37,191,37,192,38,190,38,191,38,190,38,192,39,190,39,191,39,190,40,191,40,189,40,191,40,190,41,190,41,189,41,190,42,189,41,188,42",
-    "zoneName": "WGT"
-}, {
-    "timezone": "America/Goose_Bay",
-    "country": "CA",
-    "pin": "166,51",
-    "offset": -4,
-    "points": "171,53,161,53,161,52,162,52,162,52,161,52,160,53,158,53,158,51,156,52,157,51,156,50,157,49,156,49,157,49,157,48,159,49,161,49,162,48,161,48,161,47,162,47,161,47,162,45,160,44,162,43,160,43,161,43,161,42,160,42,160,41,162,43,161,43,163,43,162,44,163,44,162,44,164,45,163,45,165,46,163,46,164,46,164,47,166,48,166,48,166,49,167,48,167,48,168,48,167,49,168,48,168,49,170,49,167,50,169,50,166,51,170,50,171,50,170,51,171,53",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Grand_Turk",
-    "country": "TC",
-    "pin": "151,95",
-    "offset": -5,
-    "points": "151,95,151,95,151,95",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Grenada",
-    "country": "GD",
-    "pin": "164,108",
-    "offset": -4,
-    "points": "165,108,165,108,165,108",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Guadeloupe",
-    "country": "GP",
-    "pin": "165,102",
-    "offset": -4,
-    "points": "165,102,165,102,165,102",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Guatemala",
-    "country": "GT",
-    "pin": "124,105",
-    "offset": -6,
-    "points": "125,106,123,105,122,104,123,103,124,103,123,101,124,101,124,100,126,100,126,103,127,103,125,106",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Guayaquil",
-    "country": "EC",
-    "pin": "139,128",
-    "offset": -5,
-    "points": "141,130,140,132,139,131,138,131,139,128,139,129,137,128,139,124,141,123,142,124,144,124,145,125,145,125,146,126,141,130",
-    "zoneName": "ECT"
-}, {
-    "timezone": "America/Guyana",
-    "country": "GY",
-    "pin": "169,116",
-    "offset": -4,
-    "points": "170,116,171,118,170,118,169,119,172,122,170,122,168,123,167,122,167,121,167,120,166,119,167,118,165,117,165,116,166,115,166,115,167,114,167,113,169,115,169,116,169,115,170,116",
-    "zoneName": "GYT"
-}, {
-    "timezone": "America/Halifax",
-    "country": "CA",
-    "pin": "162,63",
-    "offset": -4,
-    "points": "161,63,162,62,160,62,161,61,163,62,164,61,165,62,161,63,159,65,158,64,158,63,160,62,161,63",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Havana",
-    "country": "CU",
-    "pin": "136,93",
-    "offset": -5,
-    "points": "146,96,147,97,142,97,143,96,141,96,141,95,136,94,136,94,137,94,136,93,132,95,134,93,138,93,146,96",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Hermosillo",
-    "country": "MX",
-    "pin": "96,85",
-    "offset": -7,
-    "points": "90,81,91,80,96,81,99,81,99,86,98,86,99,88,98,88,96,87,97,86,94,85,93,82,90,81",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Indiana/Petersburg",
-    "country": "US",
-    "pin": "129,72",
-    "offset": -5,
-    "points": "129,72,129,72,129,72",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Indiana/Tell_City",
-    "country": "US",
-    "pin": "129,72",
-    "offset": -6,
-    "points": "130,72,130,72,130,72",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Indiana/Vevay",
-    "country": "US",
-    "pin": "132,71",
-    "offset": -5,
-    "points": "132,71,132,71,132,71",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Indiana/Indianapolis",
-    "country": "US",
-    "pin": "130,70",
-    "offset": -5,
-    "points": "132,71,130,72,130,71,128,71,128,68,130,68,130,67,132,67,132,70,132,71",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Indiana/Knox",
-    "country": "US",
-    "pin": "130,68",
-    "offset": -6,
-    "points": "130,67,129,68,130,67",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Indiana/Marengo",
-    "country": "US",
-    "pin": "130,72",
-    "offset": -5,
-    "points": "130,72,130,72,130,72,130,72",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Indiana/Vincennes",
-    "country": "US",
-    "pin": "128,71",
-    "offset": -5,
-    "points": "128,72,128,71,130,71,130,72,128,72",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Indiana/Winamac",
-    "country": "US",
-    "pin": "130,68",
-    "offset": -5,
-    "points": "130,68,129,68,130,68",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Inuvik",
-    "country": "CA",
-    "pin": "64,30",
-    "offset": -7,
-    "points": "65,30,64,30,65,30",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Iqaluit",
-    "country": "CA",
-    "pin": "155,36",
-    "offset": -5,
-    "points": "139,20,138,20,140,20,138,21,140,21,132,21,132,20,139,20",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Iqaluit",
-    "country": "CA",
-    "pin": "155,36",
-    "offset": -5,
-    "points": "139,10,145,10,144,11,145,10,142,10,156,10,155,10,156,10,156,12,154,12,156,12,152,12,156,12,156,13,152,13,153,14,149,14,152,14,151,14,147,14,146,14,148,15,142,15,147,15,142,15,146,16,143,16,145,16,145,17,141,17,142,17,141,18,136,18,142,18,141,19,137,19,138,19,135,18,136,19,132,19,132,18,134,18,134,17,136,17,132,17,132,15,136,16,134,16,137,15,132,15,134,15,132,15,132,14,138,14,139,14,134,13,144,13,140,13,143,12,140,12,140,12,139,13,132,13,132,12,136,12,132,12,132,11,133,11,132,10,140,11,135,11,138,10,137,10,141,10,138,10,139,10",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Iqaluit",
-    "country": "CA",
-    "pin": "155,36",
-    "offset": -5,
-    "points": "132,30,133,29,132,29,132,28,136,28,134,28,137,29,136,29,137,30,135,30,137,31,134,33,133,32,132,32,132,30",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Iqaluit",
-    "country": "CA",
-    "pin": "155,36",
-    "offset": -5,
-    "points": "144,24,140,24,138,23,142,23,144,24",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Iqaluit",
-    "country": "CA",
-    "pin": "155,36",
-    "offset": -5,
-    "points": "133,23,137,23,139,24,138,24,138,24,138,25,139,24,142,25,140,25,142,25,141,24,142,24,146,24,146,25,144,25,147,25,145,26,146,25,146,26,148,25,147,26,148,26,147,26,149,26,148,26,149,25,151,26,149,27,150,27,149,27,152,26,150,27,151,27,151,28,153,27,152,27,155,27,152,28,155,28,153,28,156,27,155,28,153,28,156,29,154,29,155,29,154,29,155,29,155,29,156,29,154,29,156,30,156,33,155,33,156,34,156,37,154,36,156,37,156,39,151,37,150,37,151,37,149,36,148,36,148,35,148,36,148,35,147,36,147,35,146,35,146,35,147,36,142,36,141,35,142,34,148,34,147,33,150,32,148,30,148,30,147,30,148,30,145,29,144,30,145,29,143,28,143,28,143,28,143,28,142,28,142,27,140,27,139,27,140,27,141,28,136,28,138,28,135,27,137,28,132,28,132,26,133,25,132,25,132,25,133,25,132,25,132,24,133,24,132,23,133,24,132,23,133,23",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/La_Paz",
-    "country": "BO",
-    "pin": "155,148",
-    "offset": -4,
-    "points": "164,154,163,156,161,156,161,157,160,156,158,155,157,157,156,157,155,153,155,152,153,149,154,148,154,147,155,142,153,140,155,140,157,139,159,138,160,142,166,144,166,148,169,148,169,149,170,150,170,153,168,152,164,152,164,154",
-    "zoneName": "BOT"
-}, {
-    "timezone": "America/Jamaica",
-    "country": "JM",
-    "pin": "143,100",
-    "offset": -5,
-    "points": "144,100,143,100,141,100,143,99,144,100",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Juneau",
-    "country": "US",
-    "pin": "63,44",
-    "offset": -9,
-    "points": "59,43,62,42,66,45,65,46,65,45,64,45,65,45,64,45,65,45,64,44,64,44,63,44,62,42,62,42,62,44,61,44,61,43,61,43,61,43,60,43,61,44,60,44,58,43,59,43",
-    "zoneName": "AKST"
-}, {
-    "timezone": "America/Kentucky/Louisville",
-    "country": "US",
-    "pin": "131,72",
-    "offset": -5,
-    "points": "130,72,130,72,131,71,130,72",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Kentucky/Monticello",
-    "country": "US",
-    "pin": "132,74",
-    "offset": -5,
-    "points": "132,74,133,74,132,74,132,74",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Kralendijk",
-    "country": "BQ",
-    "pin": "155,108",
-    "offset": -4,
-    "points": "162,101,162,100,162,101",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Lima",
-    "country": "PE",
-    "pin": "143,142",
-    "offset": -5,
-    "points": "153,149,153,150,152,150,151,149,146,146,144,145,144,144,139,135,137,133,138,133,137,131,138,130,139,130,138,131,140,132,141,130,145,127,146,126,145,125,146,125,149,128,150,128,153,129,152,130,153,131,152,131,149,132,148,134,147,135,149,137,148,138,150,138,150,139,152,138,152,140,153,140,155,142,154,147,154,148,153,149",
-    "zoneName": "PET"
-}, {
-    "timezone": "America/Managua",
-    "country": "NI",
-    "pin": "130,108",
-    "offset": -6,
-    "points": "132,110,131,110,128,107,129,107,129,106,131,106,132,104,135,104,134,110,132,110",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Manaus",
-    "country": "BR",
-    "pin": "167,129",
-    "offset": -4,
-    "points": "167,125,168,125,169,127,172,128,169,134,169,135,169,137,164,137,163,136,162,136,161,137,160,138,158,138,157,139,156,138,153,131,154,127,153,124,154,124,153,124,153,123,156,122,157,123,158,124,159,124,159,124,161,122,162,122,163,124,163,126,164,127,165,126,166,126,167,125",
-    "zoneName": "AMT"
-}, {
-    "timezone": "America/Los_Angeles",
-    "country": "US",
-    "pin": "86,78",
-    "offset": -8,
-    "points": "91,62,88,62,88,61,88,62,87,63,86,64,86,66,87,66,87,67,92,67,92,75,91,75,91,77,91,79,91,79,87,80,85,78,82,77,82,76,80,73,80,72,79,72,78,71,77,69,78,67,77,66,78,61,78,61,78,61,78,60,78,60,78,60,78,60,77,58,80,58,79,59,80,58,80,59,79,60,80,59,80,57,89,57,89,59,91,60,91,62",
-    "zoneName": "PST"
-}, {
-    "timezone": "America/Lower_Princes",
-    "country": "SX",
-    "pin": "162,100",
-    "offset": -4,
-    "points": "162,100,162,100,162,100",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Maceio",
-    "country": "BR",
-    "pin": "200,138",
-    "offset": -3,
-    "points": "199,140,198,141,197,140,198,139,197,138,198,137,199,138,201,137,199,140",
-    "zoneName": "BRT"
-}, {
-    "timezone": "America/Marigot",
-    "country": "MF",
-    "pin": "162,100",
-    "offset": -4,
-    "points": "162,100,162,100,162,100",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Martinique",
-    "country": "MQ",
-    "pin": "165,105",
-    "offset": -4,
-    "points": "165,104,165,104,165,104",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Matamoros",
-    "country": "MX",
-    "pin": "115,89",
-    "offset": -6,
-    "points": "113,89,112,89,109,84,108,84,107,85,107,85,107,84,109,84,112,87,112,88,115,89,115,90,113,89",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Mazatlan",
-    "country": "MX",
-    "pin": "102,93",
-    "offset": -7,
-    "points": "104,93,106,95,105,96,104,96,104,95,103,94,100,90,98,89,98,88,100,88,101,90,104,93",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Mazatlan",
-    "country": "MX",
-    "pin": "102,93",
-    "offset": -7,
-    "points": "91,86,93,86,98,93,97,93,94,91,94,89,93,88,92,88,90,86,92,87,91,86",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Menominee",
-    "country": "US",
-    "pin": "128,62",
-    "offset": -6,
-    "points": "128,62,128,61,124,60,128,61,129,62,128,62",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Mexico_City",
-    "country": "MX",
-    "pin": "112,98",
-    "offset": -6,
-    "points": "119,103,118,102,116,103,114,103,104,98,103,97,104,96,105,96,106,95,105,94,106,92,108,91,107,90,110,91,111,93,114,94,117,99,119,100,122,99,122,100,124,100,124,101,123,101,124,102,123,103,122,105,119,102,119,103",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Merida",
-    "country": "MX",
-    "pin": "126,96",
-    "offset": -6,
-    "points": "124,96,125,95,128,95,128,96,126,98,126,100,122,100,122,99,123,99,124,96",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Metlakatla",
-    "country": "US",
-    "pin": "67,48",
-    "offset": -8,
-    "points": "67,48,67,48,67,48",
-    "zoneName": "PST"
-}, {
-    "timezone": "America/Miquelon",
-    "country": "PM",
-    "pin": "172,60",
-    "offset": -3,
-    "points": "172,60,172,60,172,60",
-    "zoneName": "PMST"
-}, {
-    "timezone": "America/Moncton",
-    "country": "CA",
-    "pin": "160,61",
-    "offset": -4,
-    "points": "157,58,160,59,159,60,160,60,160,61,161,61,158,62,156,62,156,62,156,60,154,59,155,58,157,58",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Monterrey",
-    "country": "MX",
-    "pin": "111,89",
-    "offset": -6,
-    "points": "107,90,108,91,106,92,105,94,104,94,101,90,103,88,105,88,106,88,106,86,106,85,108,84,109,84,112,89,115,89,115,90,115,90,114,90,114,94,111,93,110,91,107,90",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Montevideo",
-    "country": "UY",
-    "pin": "172,173",
-    "offset": -2,
-    "points": "172,173,170,173,169,172,170,167,171,167,172,168,173,168,176,170,175,173,172,173",
-    "zoneName": "UYT"
-}, {
-    "timezone": "America/Montreal",
-    "country": "",
-    "pin": "250,125",
-    "offset": -5,
-    "points": "146,63,147,62,144,62,141,61,139,59,140,53,140,54,140,53,141,52,140,51,140,50,139,49,142,48,144,47,143,44,141,44,143,42,142,41,143,41,142,41,142,40,141,41,142,40,142,39,142,38,146,39,148,38,150,39,150,39,151,39,150,40,151,40,153,40,153,42,151,42,153,42,153,43,154,43,152,44,154,43,155,44,154,45,156,44,155,44,156,44,156,45,158,43,158,44,158,43,159,43,159,43,160,43,159,42,160,41,160,42,161,42,161,43,160,43,162,43,160,44,162,45,161,47,162,47,161,47,161,48,162,48,161,49,159,49,157,48,157,49,156,49,157,49,156,50,157,51,156,52,158,51,158,53,160,53,161,52,162,52,162,52,161,52,161,53,171,53,171,53,168,54,167,55,164,55,158,55,158,55,156,57,155,57,152,60,149,61,157,57,160,57,161,58,159,58,155,58,153,60,152,62,151,63,146,63",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Montserrat",
-    "country": "MS",
-    "pin": "164,102",
-    "offset": -4,
-    "points": "164,102,164,102,164,102",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Nassau",
-    "country": "BS",
-    "pin": "143,90",
-    "offset": -5,
-    "points": "143,90,143,90,143,90",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/New_York",
-    "country": "US",
-    "pin": "147,68",
-    "offset": -5,
-    "points": "132,82,131,76,132,75,133,74,130,72,132,71,132,71,132,67,136,67,140,66,140,65,144,65,144,64,146,63,152,62,154,59,156,60,156,62,157,63,155,64,154,63,154,64,152,64,151,66,152,67,153,67,153,67,151,67,151,67,151,68,148,68,146,71,145,70,146,72,145,73,145,72,144,71,145,70,144,70,144,72,143,72,144,72,143,72,144,74,143,73,144,74,145,75,144,74,145,75,143,75,145,76,143,76,144,76,143,76,144,76,144,77,138,80,137,82,139,88,138,90,137,90,136,88,136,88,136,88,135,87,136,86,135,86,135,84,133,83,131,84,132,82",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Nipigon",
-    "country": "CA",
-    "pin": "127,57",
-    "offset": -5,
-    "points": "127,57,127,57,127,57",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Nome",
-    "country": "US",
-    "pin": "20,35",
-    "offset": -9,
-    "points": "25,32,23,32,22,31,18,30,19,29,23,29,25,27,25,32",
-    "zoneName": "AKST"
-}, {
-    "timezone": "America/Nome",
-    "country": "US",
-    "pin": "20,35",
-    "offset": -9,
-    "points": "25,35,24,36,19,35,18,35,19,34,16,34,23,33,22,33,25,33,25,35",
-    "zoneName": "AKST"
-}, {
-    "timezone": "America/Nome",
-    "country": "US",
-    "pin": "20,35",
-    "offset": -9,
-    "points": "25,42,22,42,20,41,21,40,19,39,22,37,23,37,25,37,25,42",
-    "zoneName": "AKST"
-}, {
-    "timezone": "America/Noronha",
-    "country": "BR",
-    "pin": "205,130",
-    "offset": -2,
-    "points": "205,130,205,130,205,130",
-    "zoneName": "FNT"
-}, {
-    "timezone": "America/North_Dakota/Beulah",
-    "country": "US",
-    "pin": "109,59",
-    "offset": -6,
-    "points": "109,59,108,60,108,59,109,59",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/North_Dakota/Center",
-    "country": "US",
-    "pin": "109,60",
-    "offset": -6,
-    "points": "110,60,109,60,110,60",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/North_Dakota/New_Salem",
-    "country": "US",
-    "pin": "109,60",
-    "offset": -6,
-    "points": "110,60,110,60,110,61,108,60,110,60",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Ojinaga",
-    "country": "MX",
-    "pin": "105,84",
-    "offset": -7,
-    "points": "102,81,106,85,105,84,104,83,102,81,99,82,100,81,100,81,102,81",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Panama",
-    "country": "PA",
-    "pin": "140,113",
-    "offset": -5,
-    "points": "142,113,143,114,142,115,141,114,141,113,142,114,140,112,138,114,139,115,138,115,138,115,137,114,137,114,136,113,135,114,135,113,135,112,137,113,140,112,142,113",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Pangnirtung",
-    "country": "CA",
-    "pin": "159,33",
-    "offset": -5,
-    "points": "156,10,160,10,165,11,156,12,156,10",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Pangnirtung",
-    "country": "CA",
-    "pin": "159,33",
-    "offset": -5,
-    "points": "156,34,157,34,157,35,157,35,160,35,159,36,160,36,160,36,160,37,159,36,160,38,159,37,159,38,158,37,158,37,156,37,156,34",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Pangnirtung",
-    "country": "CA",
-    "pin": "159,33",
-    "offset": -5,
-    "points": "156,30,157,30,156,30,158,30,157,31,158,31,158,31,158,31,160,31,159,31,160,31,161,31,160,31,161,32,160,32,162,31,161,32,163,32,163,32,164,32,165,32,163,33,164,33,162,33,163,33,163,33,163,34,162,33,162,35,159,34,161,33,159,33,159,33,158,33,156,32,157,33,156,33,157,33,156,33,156,30",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Paramaribo",
-    "country": "SR",
-    "pin": "173,117",
-    "offset": -3,
-    "points": "175,118,175,120,174,122,172,121,172,122,171,122,169,119,170,118,171,118,171,117,175,117,175,118",
-    "zoneName": "SRT"
-}, {
-    "timezone": "America/Phoenix",
-    "country": "US",
-    "pin": "94,79",
-    "offset": -7,
-    "points": "99,80,99,81,96,81,91,80,91,77,91,75,91,75,92,74,95,74,95,74,96,76,99,76,99,80",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Port-au-Prince",
-    "country": "HT",
-    "pin": "150,99",
-    "offset": -5,
-    "points": "148,99,149,99,148,99",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Port_of_Spain",
-    "country": "TT",
-    "pin": "165,110",
-    "offset": -4,
-    "points": "164,110,164,110,164,110",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Porto_Velho",
-    "country": "BR",
-    "pin": "161,137",
-    "offset": -4,
-    "points": "167,142,166,144,164,144,160,142,159,138,157,139,158,138,160,138,161,137,162,136,163,136,165,137,165,140,167,140,167,142",
-    "zoneName": "AMT"
-}, {
-    "timezone": "America/Puerto_Rico",
-    "country": "PR",
-    "pin": "158,99",
-    "offset": -4,
-    "points": "158,99,158,99,158,99",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Rainy_River",
-    "country": "CA",
-    "pin": "119,57",
-    "offset": -6,
-    "points": "119,57,119,57,119,57",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Rankin_Inlet",
-    "country": "CA",
-    "pin": "122,38",
-    "offset": -6,
-    "points": "132,12,125,12,125,12,129,12,122,12,132,11,132,12",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Rankin_Inlet",
-    "country": "CA",
-    "pin": "122,38",
-    "offset": -6,
-    "points": "113,19,114,19,114,20,115,20,111,21,110,20,111,20,108,20,108,20,109,20,108,19,111,20,111,19,112,19,110,19,113,19",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Rankin_Inlet",
-    "country": "CA",
-    "pin": "122,38",
-    "offset": -6,
-    "points": "125,16,126,16,122,16,121,16,123,16,119,15,124,15,118,15,117,15,119,14,116,14,119,14,118,14,119,14,116,13,120,13,117,13,121,12,119,12,120,12,127,14,128,13,128,14,129,14,129,15,132,15,128,16,128,15,127,16,128,16,127,16,127,16,125,16",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Rankin_Inlet",
-    "country": "CA",
-    "pin": "122,38",
-    "offset": -6,
-    "points": "132,21,122,21,122,21,122,20,121,19,118,19,118,19,115,18,117,18,121,18,120,19,124,19,124,19,123,19,126,19,123,19,126,20,132,20,132,21",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Rankin_Inlet",
-    "country": "CA",
-    "pin": "122,38",
-    "offset": -6,
-    "points": "132,19,125,19,130,18,127,17,129,17,132,18,132,19",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Rankin_Inlet",
-    "country": "CA",
-    "pin": "122,38",
-    "offset": -6,
-    "points": "132,28,127,27,126,26,129,26,125,26,125,25,126,25,125,24,128,23,132,23,130,24,130,24,130,25,132,26,129,26,132,26,132,28",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Rankin_Inlet",
-    "country": "CA",
-    "pin": "122,38",
-    "offset": -6,
-    "points": "125,36,124,37,119,36,123,37,124,37,122,38,122,38,120,39,120,39,119,40,120,40,118,42,108,42,108,32,126,32,126,29,128,30,128,30,127,31,129,32,130,31,131,30,132,30,132,33,130,33,131,33,129,34,123,33,129,35,128,36,125,36",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Rankin_Inlet",
-    "country": "CA",
-    "pin": "122,38",
-    "offset": -6,
-    "points": "118,22,120,22,125,22,122,24,119,24,120,24,120,25,117,24,117,23,119,23,118,22",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Recife",
-    "country": "BR",
-    "pin": "202,136",
-    "offset": -3,
-    "points": "196,136,197,136,198,135,199,137,201,135,202,136,201,137,199,138,198,137,197,138,195,137,194,138,193,137,194,136,194,135,196,136",
-    "zoneName": "BRT"
-}, {
-    "timezone": "America/Regina",
-    "country": "CA",
-    "pin": "105,55",
-    "offset": -6,
-    "points": "104,57,97,57,97,52,99,51,97,51,97,42,108,42,108,48,108,49,109,50,109,57,104,57",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Resolute",
-    "country": "CA",
-    "pin": "118,21",
-    "offset": -6,
-    "points": "118,20,120,20,120,21,116,21,118,20",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Rio_Branco",
-    "country": "BR",
-    "pin": "156,139",
-    "offset": -4,
-    "points": "148,135,152,136,157,139,155,140,152,140,152,138,150,139,150,138,148,138,149,137,147,135,148,135",
-    "zoneName": "ACT"
-}, {
-    "timezone": "America/Santa_Isabel",
-    "country": "MX",
-    "pin": "90,83",
-    "offset": -8,
-    "points": "91,80,91,83,93,86,91,86,92,85,89,84,88,81,88,80,91,80",
-    "zoneName": "PST"
-}, {
-    "timezone": "America/Santarem",
-    "country": "BR",
-    "pin": "174,128",
-    "offset": -3,
-    "points": "176,125,177,126,178,127,177,127,178,129,177,130,177,132,178,134,177,136,178,138,177,138,171,138,170,137,169,134,172,128,168,126,168,123,170,122,172,122,172,121,174,121,174,123,176,123,176,125",
-    "zoneName": "BRT"
-}, {
-    "timezone": "America/Santiago",
-    "country": "CL",
-    "pin": "152,171",
-    "offset": -3,
-    "points": "152,199,154,198,155,198,155,201,150,201,153,201,152,200,154,201,154,201,154,201,153,200,154,199,152,199,152,199",
-    "zoneName": "CLT"
-}, {
-    "timezone": "America/Santiago",
-    "country": "CL",
-    "pin": "152,171",
-    "offset": -3,
-    "points": "148,193,148,195,148,196,150,195,149,197,150,197,155,198,152,198,151,200,149,199,150,199,151,198,151,198,149,198,149,199,148,199,149,198,148,198,148,197,149,198,149,197,149,198,149,198,149,198,149,197,148,196,148,197,149,197,148,197,149,197,148,197,148,197,148,197,147,197,148,196,147,196,148,195,148,195,147,196,147,195,146,195,147,195,147,194,148,194,147,193,147,194,147,193,147,193,147,193,147,192,146,192,148,192,148,191,146,191,147,191,147,191,147,191,147,190,145,190,146,189,147,189,147,190,148,188,148,189,148,188,149,188,148,188,149,187,148,186,149,184,149,184,149,184,149,183,149,183,150,183,148,183,147,182,148,180,148,177,148,177,151,172,151,165,152,162,152,157,153,155,152,150,154,149,155,152,155,153,156,157,157,157,156,158,155,159,155,162,153,164,153,167,152,168,153,173,152,174,152,175,151,176,152,179,150,180,150,183,150,184,151,186,150,187,151,187,150,187,151,188,150,188,150,190,149,191,149,193,148,193",
-    "zoneName": "CLT"
-}, {
-    "timezone": "America/Santo_Domingo",
-    "country": "DO",
-    "pin": "153,99",
-    "offset": -4,
-    "points": "151,100,150,100,150,99,150,97,153,98,154,98,153,98,155,99,155,100,151,100",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Scoresbysund",
-    "country": "GL",
-    "pin": "219,27",
-    "offset": -1,
-    "points": "216,25,219,25,218,26,220,25,219,26,220,26,220,26,219,26,220,26,219,26,220,27,217,27,216,26,216,25",
-    "zoneName": "EGT"
-}, {
-    "timezone": "America/Sao_Paulo",
-    "country": "BR",
-    "pin": "185,158",
-    "offset": -2,
-    "points": "181,166,179,168,178,170,180,167,179,167,179,168,176,172,176,171,176,170,175,170,173,168,172,168,171,167,170,167,173,164,175,162,175,161,174,161,175,159,176,157,178,155,179,152,177,151,176,149,179,146,180,142,181,143,182,142,182,143,184,143,186,143,186,146,189,145,195,147,194,149,195,150,195,152,193,155,193,156,192,157,188,157,183,160,182,160,183,161,182,161,183,161,182,164,181,166",
-    "zoneName": "BRST"
-}, {
-    "timezone": "America/Sitka",
-    "country": "US",
-    "pin": "62,46",
-    "offset": -9,
-    "points": "66,45,67,46,65,46,66,45,66,45",
-    "zoneName": "AKST"
-}, {
-    "timezone": "America/St_Barthelemy",
-    "country": "BL",
-    "pin": "163,100",
-    "offset": -4,
-    "points": "163,100,163,100,163,100",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/St_Johns",
-    "country": "CA",
-    "pin": "177,59",
-    "offset": -3.5,
-    "points": "173,53,172,54,173,54,172,54,171,56,172,55,173,56,172,56,173,56,173,57,174,56,176,57,175,58,176,57,175,58,175,59,177,58,176,59,177,59,176,60,176,60,176,59,175,60,175,59,175,58,173,60,174,59,172,59,173,59,173,58,171,59,168,59,169,58,168,58,169,57,170,57,169,57,170,56,169,56,170,55,173,53",
-    "zoneName": "NST"
-}, {
-    "timezone": "America/Thule",
-    "country": "GL",
-    "pin": "154,19",
-    "offset": -4,
-    "points": "161,19,155,19,153,19,156,18,151,18,158,17,153,17,153,17,149,16,158,15,161,19",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/St_Kitts",
-    "country": "KN",
-    "pin": "163,101",
-    "offset": -4,
-    "points": "163,101,163,101,163,101",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/St_Lucia",
-    "country": "LC",
-    "pin": "165,106",
-    "offset": -4,
-    "points": "165,105,165,106,165,105",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/St_Thomas",
-    "country": "VI",
-    "pin": "160,100",
-    "offset": -4,
-    "points": "160,99,160,99,160,99",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/St_Vincent",
-    "country": "VC",
-    "pin": "165,107",
-    "offset": -4,
-    "points": "165,106,165,107,165,106",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Swift_Current",
-    "country": "CA",
-    "pin": "100,55",
-    "offset": -6,
-    "points": "100,55,100,55,100,55",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Tegucigalpa",
-    "country": "HN",
-    "pin": "129,105",
-    "offset": -6,
-    "points": "129,106,129,107,128,106,126,105,126,104,128,103,131,103,133,103,135,104,132,104,131,106,129,106",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Thunder_Bay",
-    "country": "CA",
-    "pin": "126,58",
-    "offset": -5,
-    "points": "126,58,126,58,126,58",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Tijuana",
-    "country": "MX",
-    "pin": "87,80",
-    "offset": -8,
-    "points": "87,80,87,80,87,80",
-    "zoneName": "PST"
-}, {
-    "timezone": "America/Toronto",
-    "country": "CA",
-    "pin": "140,64",
-    "offset": -5,
-    "points": "146,62,147,62,143,64,142,63,143,64,143,64,140,64,139,65,140,65,135,67,137,65,137,63,137,62,138,63,139,63,138,61,137,61,136,62,133,61,133,60,132,58,131,58,130,57,127,57,128,58,126,58,126,58,124,58,124,57,125,56,125,55,124,53,125,53,125,52,126,52,127,51,126,50,125,50,125,47,127,46,128,47,132,48,136,48,136,51,138,54,140,54,140,60,141,61,144,62,146,62",
-    "zoneName": "EST"
-}, {
-    "timezone": "America/Tortola",
-    "country": "VG",
-    "pin": "160,99",
-    "offset": -4,
-    "points": "160,99,160,99,160,99",
-    "zoneName": "AST"
-}, {
-    "timezone": "America/Vancouver",
-    "country": "CA",
-    "pin": "79,57",
-    "offset": -8,
-    "points": "72,54,76,55,79,58,76,57,77,57,76,57,75,56,74,56,75,56,72,55,73,55,72,54",
-    "zoneName": "PST"
-}, {
-    "timezone": "America/Vancouver",
-    "country": "CA",
-    "pin": "79,57",
-    "offset": -8,
-    "points": "63,43,62,42,59,43,57,42,83,42,83,45,78,46,79,48,86,52,86,52,85,53,88,55,88,57,79,57,81,56,81,57,80,56,81,57,80,57,80,56,79,57,79,56,79,56,79,55,79,56,78,56,78,56,78,56,78,55,77,56,77,55,77,55,76,55,77,54,76,54,76,55,75,55,76,54,75,55,74,54,75,54,73,54,74,54,73,54,74,53,73,53,72,53,73,52,74,53,74,52,75,52,73,52,73,52,73,52,72,53,72,52,72,52,72,52,71,51,73,51,71,51,71,50,70,51,69,50,70,50,69,49,69,50,69,49,70,48,69,49,70,48,70,48,69,49,69,47,67,46,65,44,63,43",
-    "zoneName": "PST"
-}, {
-    "timezone": "America/Whitehorse",
-    "country": "CA",
-    "pin": "62,41",
-    "offset": -8,
-    "points": "57,29,60,29,61,32,64,32,64,33,66,33,66,35,69,36,70,37,69,37,70,37,70,39,73,40,74,41,77,40,78,42,54,41,54,28,57,29",
-    "zoneName": "PST"
-}, {
-    "timezone": "America/Winnipeg",
-    "country": "CA",
-    "pin": "115,56",
-    "offset": -6,
-    "points": "122,58,119,57,118,56,118,57,109,57,109,50,108,49,108,48,108,42,118,42,118,43,121,43,122,45,121,46,124,45,126,46,125,47,125,50,126,50,127,51,126,52,125,52,125,53,124,53,125,55,125,56,123,57,122,58",
-    "zoneName": "CST"
-}, {
-    "timezone": "America/Yakutat",
-    "country": "US",
-    "pin": "56,42",
-    "offset": -9,
-    "points": "56,42,56,42,56,42",
-    "zoneName": "AKST"
-}, {
-    "timezone": "America/Yellowknife",
-    "country": "CA",
-    "pin": "91,38",
-    "offset": -7,
-    "points": "83,31,92,34,95,34,97,35,108,36,108,42,78,42,77,40,74,41,73,40,70,39,70,37,69,37,70,37,69,36,66,35,66,33,64,33,64,32,61,32,60,29,62,30,61,29,63,28,64,28,64,29,70,28,67,28,67,29,68,28,68,29,69,28,73,27,72,27,76,29,77,28,78,28,77,29,79,28,82,28,81,28,81,30,83,31",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Yellowknife",
-    "country": "CA",
-    "pin": "91,38",
-    "offset": -7,
-    "points": "88,17,90,18,88,18,89,18,87,19,86,19,86,18,83,20,79,19,84,18,88,17",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Yellowknife",
-    "country": "CA",
-    "pin": "91,38",
-    "offset": -7,
-    "points": "84,22,87,22,90,23,85,24,83,25,83,26,79,26,75,25,78,23,77,22,81,21,84,22",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Yellowknife",
-    "country": "CA",
-    "pin": "91,38",
-    "offset": -7,
-    "points": "91,19,97,20,97,21,93,22,91,21,96,20,87,20,90,20,87,20,91,20,88,20,91,19",
-    "zoneName": "MST"
-}, {
-    "timezone": "America/Yellowknife",
-    "country": "CA",
-    "pin": "91,38",
-    "offset": -7,
-    "points": "90,23,92,23,91,24,93,24,96,24,95,25,97,24,97,28,87,28,87,28,87,28,95,27,87,27,86,26,90,26,86,26,87,25,85,25,86,25,86,24,90,23",
-    "zoneName": "MST"
-}, {
-    "timezone": "Antarctica/Macquarie",
-    "country": "AU",
-    "pin": "471,201",
-    "offset": 11,
-    "points": "471,201,471,201,471,201",
-    "zoneName": "MIST"
-}, {
-    "timezone": "Arctic/Longyearbyen",
-    "country": "SJ",
-    "pin": "272,17",
-    "offset": 1,
-    "points": "275,14,275,14,275,15,275,14,280,16,276,16,276,17,274,18,274,19,273,19,272,18,273,18,269,17,273,17,270,17,274,17,269,17,269,17,274,16,273,16,273,16,271,16,271,15,270,16,271,16,268,16,267,16,268,16,266,15,267,15,266,15,267,15,266,15,265,15,269,14,267,14,269,15,269,15,270,14,273,15,272,14,275,14",
-    "zoneName": "CET"
-}, {
-    "timezone": "Arctic/Longyearbyen",
-    "country": "SJ",
-    "pin": "272,17",
-    "offset": 1,
-    "points": "285,14,288,14,283,15,275,14,277,14,276,13,278,14,277,13,281,14,282,13,282,13,282,14,285,14",
-    "zoneName": "CET"
-}, {
-    "timezone": "Asia/Aden",
-    "country": "YE",
-    "pin": "313,107",
-    "offset": 3,
-    "points": "313,107,310,107,309,104,310,101,314,102,314,103,318,100,322,99,324,102,323,102,322,103,313,107",
-    "zoneName": "AST"
-}, {
-    "timezone": "Asia/Almaty",
-    "country": "KZ",
-    "pin": "357,65",
-    "offset": 6,
-    "points": "348,66,345,68,343,68,342,66,344,65,345,64,344,63,343,61,337,60,339,58,339,58,340,57,342,57,345,55,344,54,344,52,342,52,342,51,342,51,342,51,342,49,346,48,348,48,349,50,352,50,352,51,357,49,356,50,358,51,361,55,362,54,363,55,366,54,368,56,371,56,371,57,369,58,369,60,365,59,364,62,365,62,363,62,361,63,362,63,362,65,361,66,359,65,355,66,353,65,352,65,352,66,350,66,348,66",
-    "zoneName": "ALMT"
-}, {
-    "timezone": "Asia/Amman",
-    "country": "JO",
-    "pin": "300,81",
-    "offset": 2,
-    "points": "302,82,303,83,302,83,300,84,299,84,299,80,301,80,304,79,305,80,301,81,302,82",
-    "zoneName": "EET"
-}, {
-    "timezone": "Asia/Anadyr",
-    "country": "RU",
-    "pin": "497,35",
-    "offset": 12,
-    "points": "10,32,14,33,13,34,12,34,12,34,10,34,11,34,11,35,9,35,11,36,10,36,6,35,6,34,2,34,2,33,2,33,0,33,1,34,0,35,0,29,7,31,8,33,9,33,7,32,10,32",
-    "zoneName": "ANAT"
-}, {
-    "timezone": "Asia/Anadyr",
-    "country": "RU",
-    "pin": "497,35",
-    "offset": 12,
-    "points": "497,35,493,35,498,36,499,38,499,39,496,38,492,39,491,38,487,39,484,37,486,37,484,36,473,35,471,34,471,33,470,33,471,32,469,31,470,30,476,30,476,29,475,28,476,28,483,28,486,30,488,29,486,28,487,28,495,28,500,29,500,35,498,35,497,35",
-    "zoneName": "ANAT"
-}, {
-    "timezone": "Asia/Aqtau",
-    "country": "KZ",
-    "pin": "320,63",
-    "offset": 5,
-    "points": "328,63,328,68,325,66,323,67,323,66,321,65,320,63,322,63,321,63,321,62,324,62,323,60,321,60,319,61,317,60,318,60,318,59,315,58,319,58,325,57,325,57,326,57,327,60,329,61,329,62,328,63",
-    "zoneName": "AQTT"
-}, {
-    "timezone": "Asia/Aqtobe",
-    "country": "KZ",
-    "pin": "329,55",
-    "offset": 5,
-    "points": "326,55,326,54,327,55,328,54,331,54,333,55,335,54,336,54,337,56,337,57,339,58,337,60,335,59,331,62,329,62,328,60,326,59,326,57,324,57,326,56,326,55",
-    "zoneName": "AQTT"
-}, {
-    "timezone": "Asia/Ashgabat",
-    "country": "TM",
-    "pin": "331,72",
-    "offset": 5,
-    "points": "340,74,340,75,337,76,335,75,335,74,334,74,332,73,329,72,325,73,325,71,324,71,324,70,325,70,323,69,324,68,323,67,325,66,327,68,329,68,329,67,331,66,331,66,331,66,331,66,333,66,334,68,336,68,337,70,343,72,342,73,341,73,340,74",
-    "zoneName": "TMT"
-}, {
-    "timezone": "Asia/Baghdad",
-    "country": "IQ",
-    "pin": "312,79",
-    "offset": 3,
-    "points": "315,83,315,85,312,84,308,82,304,80,304,79,307,77,307,74,309,73,312,73,313,75,314,75,313,78,314,79,316,80,316,81,316,82,317,83,315,83",
-    "zoneName": "AST"
-}, {
-    "timezone": "Asia/Bahrain",
-    "country": "BH",
-    "pin": "320,88",
-    "offset": 3,
-    "points": "320,89,320,89,320,89",
-    "zoneName": "AST"
-}, {
-    "timezone": "Asia/Bangkok",
-    "country": "TH",
-    "pin": "390,106",
-    "offset": 7,
-    "points": "391,116,392,117,390,117,390,116,389,116,389,116,386,113,387,110,388,109,388,106,386,104,387,102,385,99,386,99,386,97,387,98,389,97,390,97,390,98,391,98,390,101,392,100,393,100,393,99,394,100,397,103,396,105,394,105,392,106,393,109,391,107,390,107,390,106,389,107,388,112,389,112,390,115,391,116",
-    "zoneName": "ICT"
-}, {
-    "timezone": "Asia/Baku",
-    "country": "AZ",
-    "pin": "319,69",
-    "offset": 4,
-    "points": "314,67,316,68,317,67,320,69,319,69,318,72,317,71,317,70,317,70,315,71,315,70,313,69,314,69,313,68,315,68,314,67",
-    "zoneName": "AZT"
-}, {
-    "timezone": "Asia/Chongqing",
-    "country": "",
-    "pin": "250,125",
-    "offset": 8,
-    "points": "403,95,402,95,401,95,401,95,399,95,398,94,398,93,396,93,394,94,394,93,393,94,392,93,391,94,391,96,391,96,390,95,389,95,389,94,388,94,388,93,387,93,387,91,385,92,386,90,387,89,387,87,386,86,387,86,387,85,388,84,387,81,385,80,386,79,385,78,387,78,388,77,387,77,388,77,387,75,388,73,388,72,389,72,385,71,386,70,384,70,385,68,386,68,385,66,390,66,396,67,399,66,403,66,404,65,407,67,409,66,408,67,408,69,406,69,404,70,403,72,404,73,403,77,404,79,402,79,403,80,402,80,403,82,401,83,401,84,402,85,402,87,401,87,402,87,402,88,402,89,405,89,404,90,405,90,406,91,405,93,406,92,407,95,405,95,405,94,405,94,404,93,403,95",
-    "zoneName": "CST"
-}, {
-    "timezone": "Asia/Beirut",
-    "country": "LB",
-    "pin": "299,78",
-    "offset": 2,
-    "points": "300,79,299,79,300,77,301,77,301,77,300,79",
-    "zoneName": "EET"
-}, {
-    "timezone": "Asia/Bishkek",
-    "country": "KG",
-    "pin": "354,65",
-    "offset": 6,
-    "points": "354,69,353,69,353,70,350,71,346,70,352,68,350,67,349,68,347,67,349,66,348,66,349,66,352,66,352,65,353,65,355,66,359,65,361,66,359,68,357,68,356,69,354,69",
-    "zoneName": "KGT"
-}, {
-    "timezone": "Asia/Brunei",
-    "country": "BN",
-    "pin": "410,118",
-    "offset": 8,
-    "points": "410,118,410,119,410,118",
-    "zoneName": "BNT"
-}, {
-    "timezone": "Asia/Choibalsan",
-    "country": "MN",
-    "pin": "409,58",
-    "offset": 8,
-    "points": "412,61,411,62,409,62,408,63,406,62,405,60,405,59,407,59,406,56,409,55,412,56,410,58,411,59,415,58,416,59,416,61,415,60,412,61",
-    "zoneName": "CHOT"
-}, {
-    "timezone": "Asia/Colombo",
-    "country": "LK",
-    "pin": "361,115",
-    "offset": 5.5,
-    "points": "363,116,362,117,361,116,361,114,361,111,363,113,364,115,363,116",
-    "zoneName": "IST"
-}, {
-    "timezone": "Asia/Damascus",
-    "country": "SY",
-    "pin": "300,78",
-    "offset": 2,
-    "points": "302,80,301,80,299,80,299,79,301,77,300,76,301,75,301,74,304,74,309,73,307,75,307,77,302,80",
-    "zoneName": "EET"
-}, {
-    "timezone": "Asia/Dhaka",
-    "country": "BD",
-    "pin": "376,92",
-    "offset": 6,
-    "points": "375,94,375,94,375,95,374,95,373,91,372,91,374,90,372,89,373,88,374,89,375,89,375,90,378,90,377,92,377,93,378,92,379,95,378,95,378,96,378,94,378,94,377,94,377,93,376,93,376,92,375,92,376,93,374,92,375,92,376,94,375,94",
-    "zoneName": "BDT"
-}, {
-    "timezone": "Asia/Dili",
-    "country": "TL",
-    "pin": "424,137",
-    "offset": 9,
-    "points": "424,137,427,137,424,138,424,137",
-    "zoneName": "TLT"
-}, {
-    "timezone": "Asia/Dubai",
-    "country": "AE",
-    "pin": "327,90",
-    "offset": 4,
-    "points": "328,91,328,92,327,92,327,94,323,93,322,92,325,91,328,89,328,90,328,91",
-    "zoneName": "GST"
-}, {
-    "timezone": "Asia/Dushanbe",
-    "country": "TJ",
-    "pin": "346,71",
-    "offset": 5,
-    "points": "346,73,344,73,345,72,344,70,345,70,346,69,345,69,348,68,348,68,348,69,349,69,347,69,346,70,349,70,350,71,352,70,352,71,354,72,354,73,352,73,350,74,349,72,349,72,346,73",
-    "zoneName": "TJT"
-}, {
-    "timezone": "Asia/Gaza",
-    "country": "PS",
-    "pin": "298,81",
-    "offset": 2,
-    "points": "298,81,298,82,298,81",
-    "zoneName": "EET"
-}, {
-    "timezone": "Asia/Harbin",
-    "country": "",
-    "pin": "250,125",
-    "offset": 8,
-    "points": "424,68,423,65,423,66,421,65,421,63,420,64,420,62,419,61,420,61,421,60,422,60,420,59,423,58,423,58,425,54,424,53,421,54,420,53,423,51,425,52,427,56,431,57,432,59,437,58,437,59,435,62,433,62,432,63,432,65,431,66,431,66,430,65,430,66,428,67,428,68,426,67,424,68",
-    "zoneName": "CST"
-}, {
-    "timezone": "Asia/Hebron",
-    "country": "PS",
-    "pin": "299,81",
-    "offset": 2,
-    "points": "299,81,299,80,299,81,298,81,299,81",
-    "zoneName": "EET"
-}, {
-    "timezone": "Asia/Ho_Chi_Minh",
-    "country": "VN",
-    "pin": "398,110",
-    "offset": 7,
-    "points": "397,112,395,113,396,111,395,111,396,110,397,110,397,109,399,108,400,104,396,99,394,98,396,97,395,97,395,96,393,96,393,95,392,94,392,93,394,94,396,93,398,93,398,94,400,95,398,96,398,96,397,99,401,104,402,107,401,109,398,110,398,112,397,112",
-    "zoneName": "ICT"
-}, {
-    "timezone": "Asia/Hong_Kong",
-    "country": "HK",
-    "pin": "409,94",
-    "offset": 8,
-    "points": "409,94,408,94,409,94",
-    "zoneName": "HKT"
-}, {
-    "timezone": "Asia/Hovd",
-    "country": "MN",
-    "pin": "377,58",
-    "offset": 7,
-    "points": "387,63,386,64,386,66,384,66,383,63,376,62,376,60,375,59,372,58,372,57,378,54,381,55,381,56,385,56,385,56,386,57,388,57,388,58,386,58,387,59,385,60,387,61,387,63",
-    "zoneName": "HOVT"
-}, {
-    "timezone": "Asia/Irkutsk",
-    "country": "RU",
-    "pin": "395,52",
-    "offset": 9,
-    "points": "411,46,410,46,411,48,412,48,412,49,408,51,409,51,408,52,406,52,404,53,401,53,400,55,401,55,400,56,396,55,393,55,392,55,392,54,387,52,388,51,384,50,383,50,384,49,384,48,386,47,385,46,386,45,389,44,390,45,390,44,392,43,392,43,395,44,396,43,396,42,397,42,396,41,395,41,398,39,398,38,397,37,398,37,398,36,400,36,401,36,400,37,402,37,402,38,402,38,403,38,402,39,402,40,404,40,402,42,402,43,406,42,406,43,411,41,413,42,413,42,415,43,415,44,413,44,413,45,414,45,413,46,411,46",
-    "zoneName": "IRKT"
-}, {
-    "timezone": "Asia/Jakarta",
-    "country": "ID",
-    "pin": "398,134",
-    "offset": 7,
-    "points": "406,135,407,136,409,136,409,137,400,136,396,134,397,133,400,134,401,134,403,135,404,134,406,135",
-    "zoneName": "WIB"
-}, {
-    "timezone": "Asia/Jakarta",
-    "country": "ID",
-    "pin": "398,134",
-    "offset": 7,
-    "points": "397,131,397,133,396,133,396,133,395,133,395,133,392,131,389,125,388,125,387,123,383,119,382,117,385,118,386,119,393,124,393,125,394,125,394,126,395,126,395,129,397,128,397,129,397,131",
-    "zoneName": "WIB"
-}, {
-    "timezone": "Asia/Jayapura",
-    "country": "ID",
-    "pin": "445,129",
-    "offset": 9,
-    "points": "438,131,437,131,437,130,436,130,436,129,435,130,435,131,434,130,433,129,435,128,436,129,436,128,434,128,433,127,432,127,432,126,434,125,436,126,436,128,438,130,441,127,446,129,446,138,444,136,445,136,443,136,443,136,443,135,444,135,442,135,443,135,441,132,438,131",
-    "zoneName": "WIT"
-}, {
-    "timezone": "Asia/Kabul",
-    "country": "AF",
-    "pin": "346,77",
-    "offset": 4.5,
-    "points": "338,84,335,84,336,82,335,81,334,79,335,78,334,78,335,76,337,76,341,73,344,74,346,73,349,72,349,72,350,74,352,73,354,73,349,75,350,76,349,78,347,78,348,79,347,79,346,81,345,81,344,81,343,82,342,84,338,84",
-    "zoneName": "AFT"
-}, {
-    "timezone": "Asia/Jerusalem",
-    "country": "IL",
-    "pin": "299,81",
-    "offset": 2,
-    "points": "298,81,299,79,300,79,299,80,299,80,299,81,298,81,299,81,298,84,298,82,298,81",
-    "zoneName": "IST"
-}, {
-    "timezone": "Asia/Kamchatka",
-    "country": "RU",
-    "pin": "470,51",
-    "offset": 12,
-    "points": "476,45,477,47,475,47,475,48,475,49,472,50,472,51,470,51,470,52,468,54,466,47,468,45,468,45,471,44,475,41,477,41,477,40,478,40,478,39,480,38,477,38,476,39,477,39,476,39,475,39,476,38,475,37,476,37,476,36,477,36,477,35,484,36,486,37,484,37,486,38,491,38,492,39,489,40,487,42,484,41,481,42,481,41,479,42,477,42,477,43,475,44,477,45,476,45",
-    "zoneName": "PETT"
-}, {
-    "timezone": "Asia/Karachi",
-    "country": "PK",
-    "pin": "343,90",
-    "offset": 5,
-    "points": "348,86,347,88,348,89,349,91,348,91,346,91,344,92,344,91,343,91,342,89,336,90,336,89,338,88,338,87,337,87,337,86,336,85,335,84,339,84,342,84,343,82,346,81,347,79,348,79,347,78,349,78,349,77,350,76,349,75,350,74,354,74,355,74,356,75,358,76,355,77,353,77,353,79,355,80,354,81,354,82,350,86,348,86",
-    "zoneName": "PKT"
-}, {
-    "timezone": "Asia/Kashgar",
-    "country": "",
-    "pin": "250,125",
-    "offset": 6,
-    "points": "361,83,359,82,359,80,360,80,360,79,359,78,360,77,359,77,358,76,356,75,355,74,354,74,354,73,354,72,352,71,352,70,354,69,356,69,357,68,358,68,362,67,361,66,362,65,362,63,361,63,363,62,365,63,363,63,368,65,365,64,366,65,365,65,365,67,364,68,364,70,365,70,364,74,365,75,364,76,365,76,364,77,366,80,365,81,365,81,366,81,366,82,365,82,363,83,361,83",
-    "zoneName": "XJT"
-}, {
-    "timezone": "Asia/Kathmandu",
-    "country": "NP",
-    "pin": "368,87",
-    "offset": 5.8,
-    "points": "368,86,372,86,372,88,369,88,367,87,366,87,361,85,362,84,363,83,368,85,368,86",
-    "zoneName": "NPT"
-}, {
-    "timezone": "Asia/Kolkata",
-    "country": "IN",
-    "pin": "373,94",
-    "offset": 5.5,
-    "points": "362,106,361,109,361,111,360,111,360,112,360,112,359,112,358,113,357,114,356,113,352,103,351,97,351,96,351,95,352,95,351,95,351,94,351,94,350,96,348,96,346,94,347,94,348,93,346,93,345,92,346,92,345,92,346,91,349,91,347,87,348,86,350,86,354,82,354,81,355,80,353,79,353,77,355,77,358,76,359,77,360,77,359,78,360,79,360,80,359,80,359,82,363,83,361,85,369,88,372,88,372,86,373,86,374,88,378,88,378,87,377,86,379,86,381,84,384,84,384,85,384,85,384,86,385,86,385,87,385,87,384,87,382,88,381,92,380,92,379,95,378,92,377,93,377,92,378,90,375,90,375,89,374,89,373,88,372,89,374,90,372,91,373,91,374,95,373,94,373,95,372,94,371,95,371,96,370,97,368,98,364,101,364,102,362,103,362,106",
-    "zoneName": "IST"
-}, {
-    "timezone": "Asia/Krasnoyarsk",
-    "country": "RU",
-    "pin": "379,47",
-    "offset": 8,
-    "points": "396,16,388,17,392,15,393,15,392,16,394,15,396,16,396,16",
-    "zoneName": "KRAT"
-}, {
-    "timezone": "Asia/Krasnoyarsk",
-    "country": "RU",
-    "pin": "379,47",
-    "offset": 8,
-    "points": "385,14,386,14,384,14,389,14,389,15,388,15,389,15,382,15,380,14,379,14,385,14",
-    "zoneName": "KRAT"
-}, {
-    "timezone": "Asia/Krasnoyarsk",
-    "country": "RU",
-    "pin": "379,47",
-    "offset": 8,
-    "points": "383,12,386,13,384,13,385,14,380,14,377,14,383,12",
-    "zoneName": "KRAT"
-}, {
-    "timezone": "Asia/Krasnoyarsk",
-    "country": "RU",
-    "pin": "379,47",
-    "offset": 8,
-    "points": "384,51,388,51,386,54,386,55,385,56,381,56,381,55,378,54,374,56,374,55,375,55,374,54,372,53,374,52,373,51,374,50,373,49,373,49,373,48,374,47,373,46,374,45,372,44,373,43,373,43,371,42,367,42,368,41,367,40,369,40,367,39,369,37,368,37,369,36,369,35,367,35,367,34,366,34,366,32,364,32,364,31,364,31,365,30,365,29,360,28,362,27,360,26,362,25,359,24,366,25,364,26,364,27,364,27,364,27,364,28,367,28,365,27,366,27,366,26,366,26,362,24,362,24,362,23,362,23,362,23,371,22,371,22,369,22,371,22,369,21,371,21,372,21,371,21,374,20,381,20,379,19,380,19,388,19,387,19,390,19,391,18,395,17,398,18,395,18,399,18,398,19,404,18,406,19,405,19,408,20,408,20,406,20,408,20,407,21,400,23,397,23,399,23,396,24,404,23,404,23,403,23,404,24,404,24,406,25,406,26,407,26,403,27,402,28,397,29,398,29,398,31,397,32,397,32,398,34,399,34,397,35,400,36,398,36,398,37,397,37,398,38,398,39,396,40,395,41,397,41,397,42,396,42,396,43,396,43,393,43,390,45,390,45,389,44,386,45,385,46,386,47,384,48,384,49,383,50,384,51",
-    "zoneName": "KRAT"
-}, {
-    "timezone": "Asia/Kuala_Lumpur",
-    "country": "MY",
-    "pin": "391,121",
-    "offset": 8,
-    "points": "394,121,395,123,394,123,391,121,390,119,389,116,390,116,390,117,392,116,393,117,394,121",
-    "zoneName": "MYT"
-}, {
-    "timezone": "Asia/Kuching",
-    "country": "MY",
-    "pin": "403,123",
-    "offset": 8,
-    "points": "410,118,412,115,412,116,413,115,413,116,414,117,416,118,414,118,415,119,411,119,409,123,406,123,405,124,404,124,402,123,402,122,405,123,404,123,405,121,407,121,408,119,409,119,410,118,410,119,410,118",
-    "zoneName": "MYT"
-}, {
-    "timezone": "Asia/Kuwait",
-    "country": "KW",
-    "pin": "317,84",
-    "offset": 3,
-    "points": "317,83,317,83,317,83",
-    "zoneName": "AST"
-}, {
-    "timezone": "Asia/Macau",
-    "country": "MO",
-    "pin": "408,94",
-    "offset": 8,
-    "points": "408,94,408,94,408,94",
-    "zoneName": "CST"
-}, {
-    "timezone": "Asia/Magadan",
-    "country": "RU",
-    "pin": "459,42",
-    "offset": 12,
-    "points": "464,42,464,42,466,43,460,43,460,43,462,43,458,42,457,43,455,43,454,43,454,42,452,41,454,40,453,39,450,39,445,38,444,37,445,36,444,35,445,34,444,33,445,32,443,32,446,31,446,30,447,30,447,29,448,29,447,28,448,28,446,28,450,25,457,25,458,25,457,25,461,27,470,26,472,27,472,28,474,28,474,29,476,28,476,29,476,30,470,30,469,31,471,32,470,33,471,33,471,34,477,35,477,36,476,36,476,37,475,37,476,38,475,39,476,39,472,41,473,40,472,40,473,39,469,39,464,42",
-    "zoneName": "MAGT"
-}, {
-    "timezone": "Asia/Makassar",
-    "country": "ID",
-    "pin": "416,132",
-    "offset": 8,
-    "points": "412,128,411,130,409,131,409,129,411,127,410,125,410,125,410,124,408,124,410,122,411,119,413,119,414,120,413,120,413,120,413,120,414,122,414,122,415,124,414,123,413,126,411,127,412,128",
-    "zoneName": "WITA"
-}, {
-    "timezone": "Asia/Makassar",
-    "country": "ID",
-    "pin": "416,132",
-    "offset": 8,
-    "points": "420,129,420,130,421,131,419,132,418,130,418,129,417,129,417,133,416,133,416,131,416,130,415,130,415,129,416,127,416,126,417,124,418,123,422,124,424,123,423,124,417,124,417,125,417,126,418,127,419,126,421,126,421,126,418,128,420,129",
-    "zoneName": "WITA"
-}, {
-    "timezone": "Asia/Manila",
-    "country": "PH",
-    "pin": "418,105",
-    "offset": 8,
-    "points": "423,117,422,116,423,115,422,114,421,115,420,114,420,115,419,115,420,114,421,113,422,113,422,114,423,113,423,112,424,112,424,111,425,112,426,115,425,116,425,115,424,117,424,117,423,117",
-    "zoneName": "PHT"
-}, {
-    "timezone": "Asia/Manila",
-    "country": "PH",
-    "pin": "418,105",
-    "offset": 8,
-    "points": "421,105,421,106,421,105,422,106,422,106,422,107,422,108,420,106,420,107,419,106,418,106,418,105,417,104,417,105,417,104,416,102,417,103,418,99,420,99,420,102,419,104,419,106,421,105",
-    "zoneName": "PHT"
-}, {
-    "timezone": "Asia/Muscat",
-    "country": "OM",
-    "pin": "331,92",
-    "offset": 4,
-    "points": "328,100,327,100,326,101,324,102,322,99,326,97,327,94,327,93,327,92,328,92,328,90,329,92,332,92,333,94,331,97,330,97,330,99,329,99,328,100",
-    "zoneName": "GST"
-}, {
-    "timezone": "Asia/Nicosia",
-    "country": "CY",
-    "pin": "296,76",
-    "offset": 2,
-    "points": "296,77,295,76,298,75,297,76,297,76,296,77",
-    "zoneName": "EET"
-}, {
-    "timezone": "Asia/Novokuznetsk",
-    "country": "RU",
-    "pin": "371,50",
-    "offset": 7,
-    "points": "373,46,374,47,373,48,373,49,373,49,374,50,374,50,373,51,374,52,373,53,371,52,370,51,371,51,368,49,367,47,373,46",
-    "zoneName": "KRAT"
-}, {
-    "timezone": "Asia/Novosibirsk",
-    "country": "RU",
-    "pin": "365,49",
-    "offset": 7,
-    "points": "367,47,368,49,367,50,366,50,365,51,362,49,358,51,356,50,357,49,355,50,355,49,354,48,356,47,355,47,356,46,354,44,356,42,357,40,364,41,366,40,368,41,368,42,371,42,373,43,372,44,374,45,373,46,367,47",
-    "zoneName": "NOVT"
-}, {
-    "timezone": "Asia/Omsk",
-    "country": "RU",
-    "pin": "352,49",
-    "offset": 7,
-    "points": "354,44,356,46,355,47,356,47,354,48,355,49,355,50,352,51,352,50,349,50,349,48,348,48,348,47,350,46,348,45,348,44,349,44,351,44,354,44",
-    "zoneName": "OMST"
-}, {
-    "timezone": "Asia/Omsk",
-    "country": "RU",
-    "pin": "352,49",
-    "offset": 7,
-    "points": "373,53,372,53,374,54,375,55,374,55,375,56,371,57,371,56,368,56,366,54,363,55,362,54,361,55,358,51,362,49,365,51,366,50,368,49,371,51,370,51,371,52,373,53",
-    "zoneName": "OMST"
-}, {
-    "timezone": "Asia/Phnom_Penh",
-    "country": "KH",
-    "pin": "396,109",
-    "offset": 7,
-    "points": "397,109,397,110,394,110,394,109,393,110,392,106,394,105,397,106,397,105,399,105,399,108,397,109",
-    "zoneName": "ICT"
-}, {
-    "timezone": "Asia/Pontianak",
-    "country": "ID",
-    "pin": "402,125",
-    "offset": 7,
-    "points": "411,127,409,130,407,129,405,130,405,129,403,129,403,127,402,126,401,123,402,122,404,124,405,124,406,123,408,123,408,124,410,124,410,125,410,125,411,127",
-    "zoneName": "WIB"
-}, {
-    "timezone": "Asia/Pyongyang",
-    "country": "KP",
-    "pin": "425,71",
-    "offset": 9,
-    "points": "426,72,424,73,423,72,424,71,424,71,424,70,423,70,423,69,425,68,426,67,428,68,428,67,429,67,431,65,431,66,430,67,430,68,427,70,428,72,426,72",
-    "zoneName": "KST"
-}, {
-    "timezone": "Asia/Qatar",
-    "country": "QA",
-    "pin": "322,90",
-    "offset": 3,
-    "points": "322,90,321,91,321,90,321,89,322,90",
-    "zoneName": "AST"
-}, {
-    "timezone": "Asia/Qyzylorda",
-    "country": "KZ",
-    "pin": "341,63",
-    "offset": 6,
-    "points": "344,52,344,54,345,55,342,57,340,57,339,58,337,57,337,56,336,54,333,53,335,52,334,52,335,51,336,51,335,51,336,51,335,51,335,50,342,49,342,51,342,52,344,52",
-    "zoneName": "QYZT"
-}, {
-    "timezone": "Asia/Qyzylorda",
-    "country": "KZ",
-    "pin": "341,63",
-    "offset": 6,
-    "points": "342,65,340,64,336,65,334,63,334,61,335,60,334,60,333,61,334,61,333,61,333,61,331,61,335,59,341,61,343,61,344,63,345,64,344,65,342,66,342,65",
-    "zoneName": "QYZT"
-}, {
-    "timezone": "Asia/Rangoon",
-    "country": "MM",
-    "pin": "384,102",
-    "offset": 6.5,
-    "points": "386,104,388,106,388,109,387,111,387,107,386,106,386,102,385,102,384,101,384,102,383,102,383,103,382,102,382,103,382,102,381,103,382,102,381,103,381,101,381,98,380,99,380,98,381,98,380,98,381,98,380,97,379,96,379,97,378,96,379,94,380,92,381,92,382,88,384,87,385,87,385,87,386,85,387,87,387,88,387,89,385,91,385,92,387,91,387,93,388,93,388,94,389,94,389,95,391,95,389,97,386,97,386,99,385,99,387,102,386,104",
-    "zoneName": "MMT"
-}, {
-    "timezone": "Asia/Riyadh",
-    "country": "SA",
-    "pin": "315,91",
-    "offset": 3,
-    "points": "310,101,309,102,307,98,304,96,303,92,302,91,299,86,298,86,299,84,300,84,303,83,301,81,304,80,306,81,312,84,317,85,318,87,320,88,319,89,321,91,322,91,321,91,323,93,327,93,327,94,326,97,318,100,314,103,314,102,312,101,310,101,310,101",
-    "zoneName": "AST"
-}, {
-    "timezone": "Asia/Sakhalin",
-    "country": "RU",
-    "pin": "448,60",
-    "offset": 11,
-    "points": "450,56,451,57,450,57,449,57,448,59,449,61,449,61,448,60,447,61,447,57,448,54,447,52,447,51,448,50,448,50,449,50,449,52,449,53,450,56",
-    "zoneName": "SAKT"
-}, {
-    "timezone": "Asia/Samarkand",
-    "country": "UZ",
-    "pin": "343,70",
-    "offset": 5,
-    "points": "345,71,345,72,344,73,342,73,343,72,337,70,336,68,334,68,333,66,331,66

<TRUNCATED>

[10/51] [abbrv] ambari git commit: AMBARI-19867. Grafana install fails if custom directory's parent does not exist. (Attila Doroszlai via stoader)

Posted by rz...@apache.org.
AMBARI-19867. Grafana install fails if custom directory's parent does not exist. (Attila Doroszlai via stoader)

(cherry picked from commit db40937430b442613cf91d96e36fd12c131f5d0d)

Change-Id: I75790e6393317e3793cd0de518138f442a0cc995


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: f04d7ba8b88fcd0f0ff1cad4188b790ce5eed643
Parents: 218371c
Author: Attila Doroszlai <ad...@hortonworks.com>
Authored: Mon Feb 6 15:42:29 2017 +0100
Committer: Zuul <re...@hortonworks.com>
Committed: Mon Feb 6 21:39:00 2017 -0800

----------------------------------------------------------------------
 .../common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py     | 1 +
 .../test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_grafana.py | 1 +
 2 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f04d7ba8/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
index ca1ab76..7e822f2 100644
--- a/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
+++ b/ambari-server/src/main/resources/common-services/AMBARI_METRICS/0.1.0/package/scripts/ams.py
@@ -418,6 +418,7 @@ def ams(name=None, action=None):
                 owner=params.ams_user,
                 group=params.user_group,
                 mode=0755,
+                create_parents = True,
                 recursive_ownership = True
                 )
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f04d7ba8/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_grafana.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_grafana.py b/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_grafana.py
index 07b27a6..dc064e4 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_grafana.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/AMBARI_METRICS/test_metrics_grafana.py
@@ -91,6 +91,7 @@ class TestMetricsGrafana(RMFTestCase):
                               owner = 'ams',
                               group = 'hadoop',
                               mode=0755,
+                              create_parents = True,
                               recursive_ownership = True
                               )
 


[06/51] [abbrv] ambari git commit: AMBARI-19828. UI changes to resolve discrepancies between what the stack vs Ambari reports as "live" for NodeManagers. (Vivek Subramanian via yusaku)

Posted by rz...@apache.org.
AMBARI-19828. UI changes to resolve discrepancies between what the stack vs Ambari reports as "live" for NodeManagers. (Vivek Subramanian via yusaku)

(cherry picked from commit 0ffa1bcd924d1d1c3e7236cafe2f23a2199bbdad)

Change-Id: I4e40f78a2cec51ed193766a81f32af641ce556d7


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: e016c76b4c2bf5820281cdc9ff56461cbb902fa1
Parents: e052e3f
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Thu Feb 2 10:36:48 2017 -0800
Committer: Zuul <re...@hortonworks.com>
Committed: Mon Feb 6 20:04:01 2017 -0800

----------------------------------------------------------------------
 ambari-web/app/messages.js                             | 13 ++++++++++++-
 ambari-web/app/views/main/service/services/hdfs.js     | 10 ++++++----
 ambari-web/app/views/main/service/services/yarn.js     |  2 +-
 .../test/views/main/service/services/hdfs_test.js      |  6 ++++--
 .../test/views/main/service/services/yarn_test.js      |  2 +-
 5 files changed, 24 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e016c76b/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 941c271..0cd41e0 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -2897,7 +2897,18 @@ Em.I18n.translations = {
   'dashboard.services.yarn.resourceManager.standby':'Standby ResourceManager',
   'dashboard.services.resourceManager.nodes.heap':'ResourceManager Heap',
   'dashboard.services.yarn.nodeManagers.status': 'NodeManagers Status',
-  'dashboard.services.yarn.nodeManagers.status.msg': '{0} active / {1} lost / {2} unhealthy / {3} rebooted / {4} decommissioned',
+  'dashboard.services.yarn.nodeManagers.status.active': 'active',
+  'dashboard.services.yarn.nodeManagers.status.lost': 'lost',
+  'dashboard.services.yarn.nodeManagers.status.unhealthy': 'unhealthy',
+  'dashboard.services.yarn.nodeManagers.status.rebooted': 'rebooted',
+  'dashboard.services.yarn.nodeManagers.status.decommissioned': 'decommissioned',
+  'dashboard.services.yarn.nodeManagers.status.tooltip.active': 'This is the number of NodeManagers that are active as reported from the ResourceManager',
+  'dashboard.services.yarn.nodeManagers.status.tooltip.lost': 'This is the number of NodeManagers that are lost as reported from the ResourceManager. ' +
+    'Even if a NodeManager process is up, the ResourceManager might see the status as lost if the NodeManager is not communicating with the ' +
+    'ResourceManager as expected. This can be due to situations such as a network issue or a hanging NodeManager process due to excessive garbage collection.',
+  'dashboard.services.yarn.nodeManagers.status.tooltip.unhealthy': 'This is the number of NodeManagers that are unhealthy as reported from the ResourceManager.',
+  'dashboard.services.yarn.nodeManagers.status.tooltip.rebooted': 'This is the number of NodeManagers that are in the rebooted state as reported from the ResourceManager.',
+  'dashboard.services.yarn.nodeManagers.status.tooltip.decommissioned': 'This is the number of NodeManagers that are decommissioned as reported from the ResourceManager.',
   'dashboard.services.yarn.containers': 'Containers',
   'dashboard.services.yarn.containers.msg': '{0} allocated / {1} pending / {2} reserved',
   'dashboard.services.yarn.apps': 'Applications',

http://git-wip-us.apache.org/repos/asf/ambari/blob/e016c76b/ambari-web/app/views/main/service/services/hdfs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/hdfs.js b/ambari-web/app/views/main/service/services/hdfs.js
index 40fb761..f85e095 100644
--- a/ambari-web/app/views/main/service/services/hdfs.js
+++ b/ambari-web/app/views/main/service/services/hdfs.js
@@ -74,10 +74,12 @@ App.MainDashboardServiceHdfsView = App.MainDashboardServiceView.extend({
       $('[rel=healthTooltip]').tooltip('destroy')
     }
   }),
-
-  didInsertElement: function() {
-    App.tooltip($("[rel='tooltip']"));
-  },
+  
+  metricsNotAvailableObserver: function () {
+    if(!this.get("service.metricsNotAvailable")) {
+      App.tooltip($("[rel='tooltip']"));
+    }
+  }.observes("service.metricsNotAvailable"),
 
   willDestroyElement: function() {
     $("[rel='tooltip']").tooltip('destroy');

http://git-wip-us.apache.org/repos/asf/ambari/blob/e016c76b/ambari-web/app/views/main/service/services/yarn.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/yarn.js b/ambari-web/app/views/main/service/services/yarn.js
index cf8adeb..84ba520 100644
--- a/ambari-web/app/views/main/service/services/yarn.js
+++ b/ambari-web/app/views/main/service/services/yarn.js
@@ -55,7 +55,6 @@ App.MainDashboardServiceYARNView = App.MainDashboardServiceView.extend({
   _nmUnhealthy: Em.computed.formatUnavailable('service.nodeManagersCountUnhealthy'),
   _nmRebooted: Em.computed.formatUnavailable('service.nodeManagersCountRebooted'),
   _nmDecom: Em.computed.formatUnavailable('service.nodeManagersCountDecommissioned'),
-  nodeManagersStatus: Em.computed.i18nFormat('dashboard.services.yarn.nodeManagers.status.msg', '_nmActive', '_nmLost', '_nmUnhealthy', '_nmRebooted', '_nmDecom'),
 
   _allocated: Em.computed.formatUnavailable('service.containersAllocated'),
   _pending: Em.computed.formatUnavailable('service.containersPending'),
@@ -82,6 +81,7 @@ App.MainDashboardServiceYARNView = App.MainDashboardServiceView.extend({
 
   didInsertElement: function(){
     App.tooltip($("[rel='queue-tooltip']"), {html: true, placement: "right"});
+    App.tooltip($("[rel='tooltip']"));
   },
 
   willDestroyElement: function(){

http://git-wip-us.apache.org/repos/asf/ambari/blob/e016c76b/ambari-web/test/views/main/service/services/hdfs_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/service/services/hdfs_test.js b/ambari-web/test/views/main/service/services/hdfs_test.js
index 06d0e01..efa0e3b 100644
--- a/ambari-web/test/views/main/service/services/hdfs_test.js
+++ b/ambari-web/test/views/main/service/services/hdfs_test.js
@@ -124,7 +124,7 @@ describe('App.MainDashboardServiceHdfsView', function () {
     });
   });
 
-  describe("#didInsertElement()", function() {
+  describe("#metricsNotAvailableObserver()", function() {
 
     beforeEach(function() {
       sinon.stub(App, 'tooltip');
@@ -134,7 +134,9 @@ describe('App.MainDashboardServiceHdfsView', function () {
     });
 
     it("App.tooltip should be called", function() {
-      view.didInsertElement();
+      view.set("service", Em.Object.create({
+        metricsNotAvailable: false
+      }));
       expect(App.tooltip.calledOnce).to.be.true;
     });
   });

http://git-wip-us.apache.org/repos/asf/ambari/blob/e016c76b/ambari-web/test/views/main/service/services/yarn_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/service/services/yarn_test.js b/ambari-web/test/views/main/service/services/yarn_test.js
index 9c1cf7a..57b3b05 100644
--- a/ambari-web/test/views/main/service/services/yarn_test.js
+++ b/ambari-web/test/views/main/service/services/yarn_test.js
@@ -127,7 +127,7 @@ describe('App.MainDashboardServiceYARNView', function () {
 
     it("App.tooltip should be called", function() {
       view.didInsertElement();
-      expect(App.tooltip.calledOnce).to.be.true;
+      expect(App.tooltip.calledTwice).to.be.true;
     });
   });
 


[16/51] [abbrv] ambari git commit: AMBARI-19792. Hive View 2.0: Jobs page shows 'Invalid date - Jan 24'. (dipayanb)

Posted by rz...@apache.org.
AMBARI-19792. Hive View 2.0: Jobs page shows 'Invalid date - Jan 24'. (dipayanb)

(cherry picked from commit 3f41dbc80fcc1fe2a3620df8df5d1da58c5bb126)

Change-Id: I4d9773d5989f07de16c124e393618eb6a2098f82


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: 14d78ab4a42bdeb25426d1837c9b8f7c7d14ce09
Parents: 2fed50c
Author: Dipayan Bhowmick <di...@gmail.com>
Authored: Thu Feb 2 12:05:14 2017 +0530
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 00:28:57 2017 -0800

----------------------------------------------------------------------
 .../hive20/src/main/resources/ui/app/app.js     |  9 -------
 .../resources/ui/app/components/jobs-browser.js |  4 ----
 .../main/resources/ui/app/controllers/jobs.js   |  7 +++---
 .../src/main/resources/ui/app/routes/jobs.js    | 25 ++++++++++++--------
 .../app/templates/components/jobs-browser.hbs   |  1 +
 .../src/main/resources/ui/config/environment.js |  2 --
 6 files changed, 20 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/14d78ab4/contrib/views/hive20/src/main/resources/ui/app/app.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/app.js b/contrib/views/hive20/src/main/resources/ui/app/app.js
index 0f83ee5..af4fdc4 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/app.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/app.js
@@ -26,15 +26,6 @@ let App;
 Ember.MODEL_FACTORY_INJECTIONS = true;
 
 App = Ember.Application.extend({
-  // Basic logging, e.g. "Transitioned into 'post'"
-  LOG_TRANSITIONS: false,
-
-  // Extremely detailed logging, highlighting every internal
-  // step made while transitioning into a route, including
-  // `beforeModel`, `model`, and `afterModel` hooks, and
-  // information about redirects and aborted transitions
-  LOG_TRANSITIONS_INTERNAL: false,
-
   modulePrefix: config.modulePrefix,
   podModulePrefix: config.podModulePrefix,
   Resolver

http://git-wip-us.apache.org/repos/asf/ambari/blob/14d78ab4/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js
index e3b22e9..b0a82b0 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js
@@ -39,10 +39,6 @@ export default Ember.Component.extend({
   actions: {
     setDateRange(startDate, endDate) {
       this.sendAction('filterChanged', startDate, endDate);
-    },
-
-    expandJob(jobId) {
-      console.log("Job to be expanded", jobId);
     }
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/14d78ab4/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js
index 9ab46f3..2ca4474 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js
@@ -26,12 +26,13 @@ export default Ember.Controller.extend({
 
 
   startTimeText: Ember.computed('startTime', function() {
-    return this.get('moment').moment(this.get('startTime')).format('YYYY-MM-DD');
+    let st = typeof(this.get('startTime')) === 'string' ? parseInt(this.get('startTime')) : this.get('startTime');
+    return this.get('moment').moment(st).format('YYYY-MM-DD');
   }),
 
   endTimeText: Ember.computed('endTime', function() {
-    return this.get('moment').moment(this.get('endTime')).format('YYYY-MM-DD');
+    let et = typeof(this.get('endTime')) === 'string' ? parseInt(this.get('endTime')) : this.get('endTime');
+    return this.get('moment').moment(et).format('YYYY-MM-DD');
   })
 
-
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/14d78ab4/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js b/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js
index a2ebc25..419fd07 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js
+++ b/contrib/views/hive20/src/main/resources/ui/app/routes/jobs.js
@@ -34,22 +34,24 @@ export default Ember.Route.extend({
   model(params) {
     let now = this.get('moment').moment();
     if(Ember.isEmpty(params.startTime) || Ember.isEmpty(params.endTime)) {
-      let initialValue = now.clone();
-      params.endTime = now.valueOf();
-      params.startTime = now.subtract('7', 'days').valueOf();
-      this.set('timeInitializedTo', initialValue);
+      let clone = now.clone();
+      params.endTime = now.endOf('day').valueOf();
+      params.startTime = clone.subtract('7', 'days').startOf('day').valueOf();
+      this.set('startInitTo', params.startTime);
+      this.set('endInitTo', params.endTime);
     }
 
     return this.store.query('job', params);
   },
 
   setupController(controller, model) {
-    if(!Ember.isEmpty(this.get('timeInitializedTo'))) {
+    if(!(Ember.isEmpty(this.get('startInitTo')) || Ember.isEmpty(this.get('endInitTo')))) {
 
-      controller.set('endTime', this.get('timeInitializedTo').valueOf());
-      controller.set('startTime', this.get('timeInitializedTo').subtract('7', 'days').valueOf());
+      controller.set('endTime', this.get('endInitTo'));
+      controller.set('startTime', this.get('startInitTo'));
       //unset timeInitializedTo
-      this.set('timeInitializedTo');
+      this.set('endInitTo');
+      this.set('startInitTo');
     }
 
     this._super(...arguments);
@@ -58,9 +60,12 @@ export default Ember.Route.extend({
 
   actions: {
     dateFilterChanged(startTime, endTime) {
-      this.controller.set('startTime', this.get('moment').moment(startTime, 'YYYY-MM-DD').valueOf())
-      this.controller.set('endTime', this.get('moment').moment(endTime, 'YYYY-MM-DD').valueOf())
+      this.controller.set('startTime', this.get('moment').moment(startTime, 'YYYY-MM-DD').startOf('day').valueOf())
+      this.controller.set('endTime', this.get('moment').moment(endTime, 'YYYY-MM-DD').endOf('day').valueOf())
       this.refresh();
+    },
+    hideDatePicker() {
+      console.log("Hiddennnnn");
     }
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/14d78ab4/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs b/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs
index 47b499a..abb4a97 100644
--- a/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs
+++ b/contrib/views/hive20/src/main/resources/ui/app/templates/components/jobs-browser.hbs
@@ -32,6 +32,7 @@
         start=startTime
         end=endTime
         opens="left"
+        autoApply=true
         applyAction=(action "setDateRange")
       }}
     </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/14d78ab4/contrib/views/hive20/src/main/resources/ui/config/environment.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/config/environment.js b/contrib/views/hive20/src/main/resources/ui/config/environment.js
index 42dde20..9efd491 100644
--- a/contrib/views/hive20/src/main/resources/ui/config/environment.js
+++ b/contrib/views/hive20/src/main/resources/ui/config/environment.js
@@ -34,8 +34,6 @@ module.exports = function(environment) {
     APP: {
       // Here you can pass flags/options to your application instance
       // when it is created
-      LOG_VIEW_LOOKUPS: false,
-      LOG_ACTIVE_GENERATION: false
     }
   };
 


[19/51] [abbrv] ambari git commit: AMBARI-19847 Improve Log Feeder simulation to help scale testing (mgergely)

Posted by rz...@apache.org.
AMBARI-19847 Improve Log Feeder simulation to help scale testing (mgergely)

Change-Id: I7dd15fc114eb651d1e8b9d7182e853cc30828b2f
(cherry picked from commit 25499712d21c9c1f3f4e20308fe1a0bad5d8de51)


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

Branch: refs/heads/branch-feature-BUG-74026
Commit: ea45fdd3592471c76168c8a05da01f88813cf330
Parents: df7037e
Author: Miklos Gergely <mg...@hortonworks.com>
Authored: Fri Feb 3 09:57:22 2017 +0100
Committer: Zuul <re...@hortonworks.com>
Committed: Tue Feb 7 00:59:04 2017 -0800

----------------------------------------------------------------------
 .../ambari/logfeeder/input/InputSimulate.java   | 52 ++++++++++++--------
 .../ambari/logfeeder/util/LogFeederUtil.java    | 12 +++++
 2 files changed, 44 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ea45fdd3/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputSimulate.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputSimulate.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputSimulate.java
index 743be69..be97a52 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputSimulate.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputSimulate.java
@@ -21,24 +21,25 @@ package org.apache.ambari.logfeeder.input;
 import java.net.InetAddress;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Random;
+import java.util.Set;
+import java.util.TreeSet;
 
 import org.apache.ambari.logfeeder.filter.Filter;
 import org.apache.ambari.logfeeder.filter.FilterJSON;
 import org.apache.ambari.logfeeder.util.LogFeederUtil;
-import org.apache.commons.lang3.StringUtils;
 import org.apache.solr.common.util.Base64;
 
+import com.google.common.base.Joiner;
+
 public class InputSimulate extends Input {
 
-  private static final String LOG_MESSAGE_PREFIX = "Simulated log message for testing, line";
-  
-  private static final String LOG_TEXT_PATTERN =
-      "{ logtime=\"%d\", level=\"%s\", log_message=\"<LOG_MESSAGE_PATTERN>\"}";
+  private static final String LOG_TEXT_PATTERN = "{ logtime=\"%d\", level=\"%s\", log_message=\"%s\"}";
   
   private static final Map<String, String> typeToFilePath = new HashMap<>();
   public static void loadTypeToFilePath(List<Map<String, Object>> inputList) {
@@ -55,16 +56,21 @@ public class InputSimulate extends Input {
   
   private final List<String> types;
   private final String level;
-  private final String logText;
+  private final int numberOfWords;
+  private final int minLogWords;
+  private final int maxLogWords;
   private final long sleepMillis;
   
   public InputSimulate() throws Exception {
     this.types = getSimulatedLogTypes();
     this.level = LogFeederUtil.getStringProperty("logfeeder.simulate.log_level", "WARN");
-    this.logText = getLogText();
+    this.numberOfWords = LogFeederUtil.getIntProperty("logfeeder.simulate.number_of_words", 1000, 50, 1000000);
+    this.minLogWords = LogFeederUtil.getIntProperty("logfeeder.simulate.min_log_words", 5, 1, 10);
+    this.maxLogWords = LogFeederUtil.getIntProperty("logfeeder.simulate.max_log_words", 10, 10, 20);
     this.sleepMillis = LogFeederUtil.getIntProperty("logfeeder.simulate.sleep_milliseconds", 10000);
     
     Filter filter = new FilterJSON();
+    filter.loadConfig(Collections.<String, Object> emptyMap());
     filter.setInput(this);
     addFilter(filter);
   }
@@ -80,15 +86,6 @@ public class InputSimulate extends Input {
     }
   }
 
-  private String getLogText() {
-    int logTextSize = LogFeederUtil.getIntProperty("logfeeder.simulate.log_message_size", 100);
-    int fillerSize = Math.max(logTextSize - LOG_MESSAGE_PREFIX.length() - 10, 0);
-    String filler = StringUtils.repeat("X", fillerSize);
-    String logMessagePattern = LOG_MESSAGE_PREFIX + " %08d " + filler;
-    
-    return LOG_TEXT_PATTERN.replaceAll("<LOG_MESSAGE_PATTERN>", logMessagePattern);
-  }
-
   @Override
   public boolean isReady() {
     return true;
@@ -103,12 +100,12 @@ public class InputSimulate extends Input {
     while (true) {
       String type = imitateRandomLogFile();
       
+      String line = getLine();
       InputMarker marker = getInputMarker(type);
-      String line = getLine(marker);
       
       outputLine(line, marker);
       
-      try { Thread.sleep(sleepMillis); } catch(Exception e) {}
+      try { Thread.sleep(sleepMillis); } catch(Exception e) { /* Ignore */ }
     }
   }
 
@@ -143,9 +140,24 @@ public class InputSimulate extends Input {
     return Base64.byteArrayToBase64(fileKey.getBytes());
   }
 
-  private String getLine(InputMarker marker) {
+  private String getLine() {
     Date d = new Date();
-    return String.format(logText, d.getTime(), level, marker.lineNumber);
+    String logMessage = createLogMessage();
+    return String.format(LOG_TEXT_PATTERN, d.getTime(), level, logMessage);
+  }
+  
+  private String createLogMessage() {
+    int logMessageLength = minLogWords + random.nextInt(maxLogWords - minLogWords + 1);
+    Set<Integer> words = new TreeSet<>();
+    List<String> logMessage = new ArrayList<>();
+    while (words.size() < logMessageLength) {
+      int word = random.nextInt(numberOfWords);
+      if (words.add(word)) {
+        logMessage.add(String.format("Word%06d", word));
+      }
+    }
+    
+    return Joiner.on(' ').join(logMessage);
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/ambari/blob/ea45fdd3/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/LogFeederUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/LogFeederUtil.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/LogFeederUtil.java
index 5bf600e..73cf449 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/LogFeederUtil.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/LogFeederUtil.java
@@ -171,8 +171,20 @@ public class LogFeederUtil {
   }
 
   public static int getIntProperty(String key, int defaultValue) {
+    return getIntProperty(key, defaultValue, null, null);
+  }
+
+  public static int getIntProperty(String key, int defaultValue, Integer minValue, Integer maxValue) {
     String value = getStringProperty(key);
     int retValue = objectToInt(value, defaultValue, ", key=" + key);
+    if (minValue != null && retValue < minValue) {
+      LOG.info("Minimum rule was applied for " + key + ": " + retValue + " < " + minValue);
+      retValue = minValue;
+    }
+    if (maxValue != null && retValue > maxValue) {
+      LOG.info("Maximum rule was applied for " + key + ": " + retValue + " > " + maxValue);
+      retValue = maxValue;
+    }
     return retValue;
   }