ambari git commit: AMBARI-19275. Single API to download all client configs. (jaimin)

2016-12-28 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 eae2a4c5e -> 08a998455


AMBARI-19275. Single API to download all client configs. (jaimin)


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

Branch: refs/heads/branch-2.5
Commit: 08a9984553d26d939b227800cbe2414fbf7d1856
Parents: eae2a4c
Author: Jaimin Jetly 
Authored: Wed Dec 28 16:09:40 2016 -0800
Committer: Jaimin Jetly 
Committed: Wed Dec 28 16:12:20 2016 -0800

--
 ambari-server/pom.xml   |   5 +
 .../server/api/services/ComponentService.java   |  27 +-
 .../api/services/HostComponentService.java  |  25 +-
 .../server/configuration/Configuration.java |  19 +
 .../internal/ClientConfigResourceProvider.java  | 850 +--
 .../api/services/ComponentServiceTest.java  |   4 +-
 .../api/services/HostComponentServiceTest.java  |   4 +-
 .../ClientConfigResourceProviderTest.java   |  36 +-
 8 files changed, 684 insertions(+), 286 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/08a99845/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index c3cdc8b..af9bf7a 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -1025,6 +1025,11 @@
   commons-csv
 
 
+  org.apache.commons
+  commons-compress
+  1.5
+
+
   uk.com.robust-it
   cloning
   1.9.2

http://git-wip-us.apache.org/repos/asf/ambari/blob/08a99845/ambari-server/src/main/java/org/apache/ambari/server/api/services/ComponentService.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ComponentService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ComponentService.java
index ded2596..1725b11 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ComponentService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ComponentService.java
@@ -41,6 +41,8 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.Validate;
 
 /**
  * Service responsible for components resource requests.
@@ -99,7 +101,12 @@ public class ComponentService extends BaseService {
*/
   @GET
   @Produces("text/plain")
-  public Response getComponents(String body, @Context HttpHeaders headers, 
@Context UriInfo ui) {
+  public Response getComponents(String body, @Context HttpHeaders headers, 
@Context UriInfo ui,
+ @QueryParam("format") String format) {
+
+if (format != null && format.equals("client_config_tar")) {
+  return createClientConfigResource(body, headers, ui, null);
+}
 return handleRequest(headers, body, ui, Request.Type.GET,
 createComponentResource(m_clusterName, m_serviceName, null));
   }
@@ -227,7 +234,20 @@ public class ComponentService extends BaseService {
 mapIds.put(Resource.Type.Cluster, m_clusterName);
 mapIds.put(Resource.Type.Service, m_serviceName);
 mapIds.put(Resource.Type.Component, componentName);
+String filePrefixName;
+
+if (StringUtils.isEmpty(componentName)) {
+  if (StringUtils.isEmpty(m_serviceName)) {
+filePrefixName = m_clusterName + "(" + 
Resource.InternalType.Cluster.toString().toUpperCase()+")";
+  } else {
+filePrefixName = m_serviceName + "(" + 
Resource.InternalType.Service.toString().toUpperCase()+")";
+  }
+} else {
+  filePrefixName = componentName;
+}
 
+Validate.notNull(filePrefixName, "compressed config file name should not 
be null");
+String fileName =  filePrefixName + "-configs" + 
Configuration.DEF_ARCHIVE_EXTENSION;
 
 Response response = handleRequest(headers, body, ui, Request.Type.GET,
 createResource(Resource.Type.ClientConfig, mapIds));
@@ -240,7 +260,7 @@ public class ComponentService extends BaseService {
 Response.ResponseBuilder rb = Response.status(Response.Status.OK);
 Configuration configs = new Configuration();
 String tmpDir = configs.getProperty(Configuration.SERVER_TMP_DIR.getKey());
-File file = new File(tmpDir + File.separator + componentName + "-configs" 
+ Configuration.DEF_ARCHIVE_EXTENSION);
+File file = new File(tmpDir,fileName);
 InputStream 

ambari git commit: AMBARI-19275. Single API to download all client configs. (jaimin)

2016-12-28 Thread jaimin
Repository: ambari
Updated Branches:
  refs/heads/trunk 6add93ea4 -> 6db03934b


AMBARI-19275. Single API to download all client configs. (jaimin)


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

Branch: refs/heads/trunk
Commit: 6db03934bddb971de258a73150145f928e52c5cb
Parents: 6add93e
Author: Jaimin Jetly 
Authored: Wed Dec 28 16:09:40 2016 -0800
Committer: Jaimin Jetly 
Committed: Wed Dec 28 16:10:28 2016 -0800

--
 ambari-server/pom.xml   |   5 +
 .../server/api/services/ComponentService.java   |  27 +-
 .../api/services/HostComponentService.java  |  25 +-
 .../server/configuration/Configuration.java |  19 +
 .../internal/ClientConfigResourceProvider.java  | 850 +--
 .../api/services/ComponentServiceTest.java  |   4 +-
 .../api/services/HostComponentServiceTest.java  |   4 +-
 .../ClientConfigResourceProviderTest.java   |  36 +-
 8 files changed, 684 insertions(+), 286 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6db03934/ambari-server/pom.xml
--
diff --git a/ambari-server/pom.xml b/ambari-server/pom.xml
index 102cb71..90c6b61 100644
--- a/ambari-server/pom.xml
+++ b/ambari-server/pom.xml
@@ -1039,6 +1039,11 @@
   commons-csv
 
 
+  org.apache.commons
+  commons-compress
+  1.5
+
+
   uk.com.robust-it
   cloning
   1.9.2

http://git-wip-us.apache.org/repos/asf/ambari/blob/6db03934/ambari-server/src/main/java/org/apache/ambari/server/api/services/ComponentService.java
--
diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ComponentService.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ComponentService.java
index ded2596..1725b11 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/api/services/ComponentService.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/api/services/ComponentService.java
@@ -41,6 +41,8 @@ import javax.ws.rs.core.UriInfo;
 import org.apache.ambari.server.api.resources.ResourceInstance;
 import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.controller.spi.Resource;
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.Validate;
 
 /**
  * Service responsible for components resource requests.
@@ -99,7 +101,12 @@ public class ComponentService extends BaseService {
*/
   @GET
   @Produces("text/plain")
-  public Response getComponents(String body, @Context HttpHeaders headers, 
@Context UriInfo ui) {
+  public Response getComponents(String body, @Context HttpHeaders headers, 
@Context UriInfo ui,
+ @QueryParam("format") String format) {
+
+if (format != null && format.equals("client_config_tar")) {
+  return createClientConfigResource(body, headers, ui, null);
+}
 return handleRequest(headers, body, ui, Request.Type.GET,
 createComponentResource(m_clusterName, m_serviceName, null));
   }
@@ -227,7 +234,20 @@ public class ComponentService extends BaseService {
 mapIds.put(Resource.Type.Cluster, m_clusterName);
 mapIds.put(Resource.Type.Service, m_serviceName);
 mapIds.put(Resource.Type.Component, componentName);
+String filePrefixName;
+
+if (StringUtils.isEmpty(componentName)) {
+  if (StringUtils.isEmpty(m_serviceName)) {
+filePrefixName = m_clusterName + "(" + 
Resource.InternalType.Cluster.toString().toUpperCase()+")";
+  } else {
+filePrefixName = m_serviceName + "(" + 
Resource.InternalType.Service.toString().toUpperCase()+")";
+  }
+} else {
+  filePrefixName = componentName;
+}
 
+Validate.notNull(filePrefixName, "compressed config file name should not 
be null");
+String fileName =  filePrefixName + "-configs" + 
Configuration.DEF_ARCHIVE_EXTENSION;
 
 Response response = handleRequest(headers, body, ui, Request.Type.GET,
 createResource(Resource.Type.ClientConfig, mapIds));
@@ -240,7 +260,7 @@ public class ComponentService extends BaseService {
 Response.ResponseBuilder rb = Response.status(Response.Status.OK);
 Configuration configs = new Configuration();
 String tmpDir = configs.getProperty(Configuration.SERVER_TMP_DIR.getKey());
-File file = new File(tmpDir + File.separator + componentName + "-configs" 
+ Configuration.DEF_ARCHIVE_EXTENSION);
+File file = new File(tmpDir,fileName);
 InputStream resultInputStream = 

[1/2] ambari git commit: AMBARI-19312. Improve and Fix 'Alerts page' after new guidelines. (xiwang)

2016-12-28 Thread xiwang
Repository: ambari
Updated Branches:
  refs/heads/trunk 74d636392 -> 6add93ea4


AMBARI-19312. Improve and Fix 'Alerts page' after new guidelines. (xiwang)


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

Branch: refs/heads/trunk
Commit: 6add93ea482555084e5d001c47bf1f86f2dfe99b
Parents: a2c907b
Author: Xi Wang 
Authored: Wed Dec 28 13:52:46 2016 -0800
Committer: Xi Wang 
Committed: Wed Dec 28 13:52:53 2016 -0800

--
 ambari-web/app/styles/alerts.less  | 16 
 ambari-web/app/styles/application.less |  4 +---
 2 files changed, 17 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/6add93ea/ambari-web/app/styles/alerts.less
--
diff --git a/ambari-web/app/styles/alerts.less 
b/ambari-web/app/styles/alerts.less
index a04db8a..c13c8c9 100644
--- a/ambari-web/app/styles/alerts.less
+++ b/ambari-web/app/styles/alerts.less
@@ -87,6 +87,16 @@
 }
   }
 
+  > thead > tr > th,  > thead > tr > td,
+  > tbody > tr > th,  > tbody > tr > td,
+  > tfoot > tr > th,  > tfoot > tr > td {
+vertical-align: middle;
+  }
+
+  a.ui-icon-circle-close {
+visibility: hidden;
+  }
+
   .filter-input-width {
 width: ~"calc(100% - 20px)";
   }
@@ -135,6 +145,12 @@
 }
 
 #alert-instances-table {
+  > thead > tr > th,  > thead > tr > td,
+  > tbody > tr > th,  > tbody > tr > td,
+  > tfoot > tr > th,  > tfoot > tr > td {
+vertical-align: middle;
+  }
+
   .col0,
   td:first-child,
   th:first-child {

http://git-wip-us.apache.org/repos/asf/ambari/blob/6add93ea/ambari-web/app/styles/application.less
--
diff --git a/ambari-web/app/styles/application.less 
b/ambari-web/app/styles/application.less
index c35f0d1..a89296c 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -1745,7 +1745,7 @@ ul.inline li {
 opacity: 0.2;
 padding: 1px;
 position: relative;
-margin-top: 6px;
+margin-top: 8px;
 z-index: 10;
 &:hover {
   opacity: 0.7;
@@ -1765,7 +1765,6 @@ ul.inline li {
 .active-sort {
   color: #555;
   text-decoration: none;
-  background-color: #e5e5e5;
   border-radius: 0;
 }
   }
@@ -1777,7 +1776,6 @@ ul.inline li {
   color: #555;
   text-decoration: none;
   background-color: #e5e5e5;
-  box-shadow: inset 0 -5px 8px rgba(0, 0, 0, 0.05);
 }
 .filter-btn {
   color: #999;



[2/2] ambari git commit: AMBARI-19305. Improve and Fix 'Services page' after new guidelines.(xiwang)

2016-12-28 Thread xiwang
AMBARI-19305. Improve and Fix 'Services page' after new guidelines.(xiwang)


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

Branch: refs/heads/trunk
Commit: a2c907b2d9c2da58c7907e0ee9a3b5ad5376f361
Parents: 74d6363
Author: Xi Wang 
Authored: Tue Dec 27 18:44:57 2016 -0800
Committer: Xi Wang 
Committed: Wed Dec 28 13:52:53 2016 -0800

--
 .../app/styles/enhanced_service_dashboard.less  | 40 +++-
 .../service/widgets/create/expression_view.js   |  1 +
 2 files changed, 39 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a2c907b2/ambari-web/app/styles/enhanced_service_dashboard.less
--
diff --git a/ambari-web/app/styles/enhanced_service_dashboard.less 
b/ambari-web/app/styles/enhanced_service_dashboard.less
index 0d549d7..dfbe042 100644
--- a/ambari-web/app/styles/enhanced_service_dashboard.less
+++ b/ambari-web/app/styles/enhanced_service_dashboard.less
@@ -180,6 +180,8 @@
 
 #widget-preview {
   max-width: 200px;
+  margin: auto;
+  margin-bottom: 20px;
   .widget {
 .img-thumbnail .corner-icon {
   display: none;
@@ -475,12 +477,46 @@
 }
 
 .add-metric-menu{
-  .select-options-dropdown {
+  .dropdown-menu.select-options-dropdown {
 width: 240px;
-border: none;
+padding: 0px;
+-moz-background-clip: padding;
+-webkit-background-clip: padding;
+background-clip: padding-box;
+border-bottom: 250px transparent solid;
+border-left: none;
+border-right: none;
+-webkit-box-shadow: none;
+-moz-box-shadow: none;
+box-shadow: none;
 &>li>div {
   padding: 3px;
 }
+li.metric-select {
+  padding: 5px;
+  padding-bottom: 0px;
+  border-left: 1px #ccc solid;
+  border-right: 1px #ccc solid;
+  border-bottom: none;
+  border-top: none;
+}
+li.aggregator-select {
+  padding: 5px;
+  padding-bottom: 0px;
+  border-left: 1px #ccc solid;
+  border-right: 1px #ccc solid;
+  border-bottom: none;
+  border-top: none;
+}
+li.actions-buttons{
+  padding: 5px;
+  padding-left: 8px;
+  border: 1px #ccc solid;
+  border-top: none;
+  button {
+margin-right: 5px;
+  }
+}
   }
 }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a2c907b2/ambari-web/app/views/main/service/widgets/create/expression_view.js
--
diff --git 
a/ambari-web/app/views/main/service/widgets/create/expression_view.js 
b/ambari-web/app/views/main/service/widgets/create/expression_view.js
index 436e3e9..c4a1a3e 100644
--- a/ambari-web/app/views/main/service/widgets/create/expression_view.js
+++ b/ambari-web/app/views/main/service/widgets/create/expression_view.js
@@ -266,6 +266,7 @@ App.AddMetricExpressionView = Em.View.extend({
 var component = this.get('componentMap').findProperty('serviceName', 
event.context.get('serviceName'))
   .get('components').findProperty('id', event.context.get('id'));
 this.set('currentSelectedComponent', component);
+event.stopPropagation();
   },
 
   /**



ambari git commit: AMBARI-19308 Non-editable properties should be handled for add/delete host component. (ababiichuk)

2016-12-28 Thread ababiichuk
Repository: ambari
Updated Branches:
  refs/heads/trunk 540f4ee9a -> 74d636392


AMBARI-19308 Non-editable properties should be handled for add/delete host 
component. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: 74d636392d4b82f6322af5a62a6dfe680743aaf4
Parents: 540f4ee
Author: ababiichuk 
Authored: Wed Dec 28 20:52:23 2016 +0200
Committer: ababiichuk 
Committed: Wed Dec 28 23:26:31 2016 +0200

--
 ambari-web/app/controllers/main/host/details.js | 297 +++
 ambari-web/app/messages.js  |   3 +
 .../modal_popups/dependent_configs_list.hbs | 138 ++---
 .../host/details/addDeleteComponentPopup.hbs|   8 +-
 .../dependent_configs_list_popup.js |   8 +-
 .../test/controllers/main/host/details_test.js  | 121 +++-
 6 files changed, 383 insertions(+), 192 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/74d63639/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 c38838f..cb4a2ad 100644
--- a/ambari-web/app/controllers/main/host/details.js
+++ b/ambari-web/app/controllers/main/host/details.js
@@ -151,33 +151,68 @@ App.MainHostDetailsController = 
Em.Controller.extend(App.SupportClientConfigsDow
 }
   ],
 
+  /**
+   * Determines whether adding/deleting host component requires configs changes
+   * @type {Boolean}
+   */
+  isReconfigureRequired: false,
+
+  /**
+   * Array of all properties affected by adding/deleting host component
+   * @type {Array}
+   */
+  allPropertiesToChange: [],
+
+  /**
+   * Array of editable properties affected by adding/deleting host component
+   * @type {Array}
+   */
+  recommendedPropertiesToChange: [],
+
+  /**
+   * Array of non-editable properties affected by adding/deleting host 
component
+   * @type {Array}
+   */
+  requiredPropertiesToChange: [],
+
+  /**
+   * Properties affected by adding/deleting host component, grouped by 
service, formatted for PUT call
+   * @type {Array}
+   */
+  groupedPropertiesToChange: [],
+
+  hasPropertiesToChange: 
Em.computed.or('recommendedPropertiesToChange.length', 
'requiredPropertiesToChange.length'),
+
   addDeleteComponentPopupBody: Em.View.extend({
 templateName: 
require('templates/main/host/details/addDeleteComponentPopup'),
-isReconfigure: false,
 commonMessage: '',
 manualKerberosWarning: 
App.get('router.mainAdminKerberosController.isManualKerberos') ?
   Em.I18n.t('hosts.host.manualKerberosWarning') : '',
-propertiesToChange: [],
 lastComponent: false,
-lastComponentError: '',
-setPopupSize: function () {
-  this.set('parentView.hasPropertiesToChange', 
!!this.get('propertiesToChange.length'));
-}.observes('propertiesToChange.length')
+lastComponentError: ''
   }),
 
-  applyConfigsCustomization: function (configs) {
-configs.propertiesToChange.forEach(function (property) {
+  clearConfigsChanges: function () {
+var arrayNames = ['allPropertiesToChange', 
'recommendedPropertiesToChange', 'requiredPropertiesToChange', 
'groupedPropertiesToChange'];
+arrayNames.forEach(function (arrayName) {
+  this.get(arrayName).clear();
+}, this);
+this.set('isReconfigureRequired', false);
+  },
+
+  applyConfigsCustomization: function () {
+this.get('recommendedPropertiesToChange').forEach(function (property) {
   var value = property.saveRecommended ? property.recommendedValue : 
property.initialValue,
 filename = property.propertyFileName;
-  if (configs.groups.length) {
-var group = configs.groups.find(function (item) {
+  if (this.get('groupedPropertiesToChange.length')) {
+var group = this.get('groupedPropertiesToChange').find(function (item) 
{
   return item.properties.hasOwnProperty(filename);
 });
 if (group) {
   group.properties[filename][property.propertyName] = value;
 }
   }
-});
+}, this);
   },
 
   /**
@@ -427,7 +462,8 @@ App.MainHostDetailsController = 
Em.Controller.extend(App.SupportClientConfigsDow
   if (componentsMapItem.deletePropertyName) {
 this.set(componentsMapItem.deletePropertyName, true);
   }
-  returnFunc = this.showDeleteComponentPopup(component, true, 
componentsMapItem.configsCallbackName);
+  this.set('isReconfigureRequired', true);
+  returnFunc = this.showDeleteComponentPopup(component, 

ambari git commit: AMBARI-19206: When Namenode HA is enabled, hbase.rootdir property for ambari-metrics (distributed) does not get updated (sangeetar)

2016-12-28 Thread sangeetar
Repository: ambari
Updated Branches:
  refs/heads/trunk 69e973c41 -> 540f4ee9a


AMBARI-19206: When Namenode HA is enabled, hbase.rootdir property for 
ambari-metrics (distributed) does not get updated (sangeetar)


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

Branch: refs/heads/trunk
Commit: 540f4ee9ac15d1d1794e8a57db043114dd441dc5
Parents: 69e973c
Author: Sangeeta Ravindran 
Authored: Wed Dec 28 11:51:06 2016 -0800
Committer: Sangeeta Ravindran 
Committed: Wed Dec 28 11:51:06 2016 -0800

--
 .../nameNode/rollback_controller.js  |  1 +
 .../nameNode/step9_controller.js | 19 ++-
 ambari-web/app/messages.js   | 11 ++-
 .../nameNode/step3_controller_test.js|  4 ++--
 4 files changed, 27 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/540f4ee9/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
index fc44724..262a3e6 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
@@ -75,6 +75,7 @@ App.HighAvailabilityRollbackController = 
App.HighAvailabilityProgressPageControl
   'deleteSNameNode',
   'startAllServices',
   'reconfigureHBase',
+  'reconfigureAMS',
   'reconfigureAccumulo',
   'reconfigureHawq',
   'installPXF',

http://git-wip-us.apache.org/repos/asf/ambari/blob/540f4ee9/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
index 713e1c3..b98c2df 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
@@ -22,7 +22,7 @@ App.HighAvailabilityWizardStep9Controller = 
App.HighAvailabilityProgressPageCont
 
   name:"highAvailabilityWizardStep9Controller",
 
-  commands: ['startSecondNameNode', 'installZKFC', 'startZKFC', 'installPXF', 
'reconfigureRanger', 'reconfigureHBase', 'reconfigureAccumulo', 
'reconfigureHawq', 'deleteSNameNode', 'stopHDFS', 'startAllServices'],
+  commands: ['startSecondNameNode', 'installZKFC', 'startZKFC', 'installPXF', 
'reconfigureRanger', 'reconfigureHBase', 'reconfigureAMS', 
'reconfigureAccumulo', 'reconfigureHawq', 'deleteSNameNode', 'stopHDFS', 
'startAllServices'],
 
   hbaseSiteTag: "",
   accumuloSiteTag: "",
@@ -45,6 +45,9 @@ App.HighAvailabilityWizardStep9Controller = 
App.HighAvailabilityProgressPageCont
 if (!App.Service.find().someProperty('serviceName', 'HBASE')) {
   tasksToRemove.push('reconfigureHBase');
 }
+if (!App.Service.find().someProperty('serviceName', 'AMBARI_METRICS')) {
+  tasksToRemove.push('reconfigureAMS');
+}
 if (!App.Service.find().someProperty('serviceName', 'ACCUMULO')) {
   tasksToRemove.push('reconfigureAccumulo');
 }
@@ -261,6 +264,20 @@ App.HighAvailabilityWizardStep9Controller = 
App.HighAvailabilityProgressPageCont
 });
   },
 
+  reconfigureAMS: function () {
+var data = this.get('content.serviceConfigProperties');
+var configData = this.reconfigureSites(['ams-hbase-site'], data, 
Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE',
 false)));
+App.ajax.send({
+  name: 'common.service.configurations',
+  sender: this,
+  data: {
+desired_config: configData
+  },
+  success: 'saveConfigTag',
+  error: 'onTaskError'
+});
+  },
+
   reconfigureAccumulo: function () {
 var data = this.get('content.serviceConfigProperties');
 var configData = this.reconfigureSites(['accumulo-site'], data, 
Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE',
 false)));

http://git-wip-us.apache.org/repos/asf/ambari/blob/540f4ee9/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js 

ambari git commit: AMBARI-19206: When Namenode HA is enabled, hbase.rootdir property for ambari-metrics (distributed) does not get updated (sangeetar)

2016-12-28 Thread sangeetar
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 a76c5c8b2 -> eae2a4c5e


AMBARI-19206: When Namenode HA is enabled, hbase.rootdir property for 
ambari-metrics (distributed) does not get updated (sangeetar)


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

Branch: refs/heads/branch-2.5
Commit: eae2a4c5e4b4b5dc279d9553d025fb00eb337849
Parents: a76c5c8
Author: Sangeeta Ravindran 
Authored: Wed Dec 28 11:25:14 2016 -0800
Committer: Sangeeta Ravindran 
Committed: Wed Dec 28 11:25:14 2016 -0800

--
 .../nameNode/rollback_controller.js  |  1 +
 .../nameNode/step9_controller.js | 19 ++-
 ambari-web/app/messages.js   | 11 ++-
 .../nameNode/step3_controller_test.js|  4 ++--
 4 files changed, 27 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/eae2a4c5/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
index fc44724..262a3e6 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/rollback_controller.js
@@ -75,6 +75,7 @@ App.HighAvailabilityRollbackController = 
App.HighAvailabilityProgressPageControl
   'deleteSNameNode',
   'startAllServices',
   'reconfigureHBase',
+  'reconfigureAMS',
   'reconfigureAccumulo',
   'reconfigureHawq',
   'installPXF',

http://git-wip-us.apache.org/repos/asf/ambari/blob/eae2a4c5/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
index 713e1c3..b98c2df 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
@@ -22,7 +22,7 @@ App.HighAvailabilityWizardStep9Controller = 
App.HighAvailabilityProgressPageCont
 
   name:"highAvailabilityWizardStep9Controller",
 
-  commands: ['startSecondNameNode', 'installZKFC', 'startZKFC', 'installPXF', 
'reconfigureRanger', 'reconfigureHBase', 'reconfigureAccumulo', 
'reconfigureHawq', 'deleteSNameNode', 'stopHDFS', 'startAllServices'],
+  commands: ['startSecondNameNode', 'installZKFC', 'startZKFC', 'installPXF', 
'reconfigureRanger', 'reconfigureHBase', 'reconfigureAMS', 
'reconfigureAccumulo', 'reconfigureHawq', 'deleteSNameNode', 'stopHDFS', 
'startAllServices'],
 
   hbaseSiteTag: "",
   accumuloSiteTag: "",
@@ -45,6 +45,9 @@ App.HighAvailabilityWizardStep9Controller = 
App.HighAvailabilityProgressPageCont
 if (!App.Service.find().someProperty('serviceName', 'HBASE')) {
   tasksToRemove.push('reconfigureHBase');
 }
+if (!App.Service.find().someProperty('serviceName', 'AMBARI_METRICS')) {
+  tasksToRemove.push('reconfigureAMS');
+}
 if (!App.Service.find().someProperty('serviceName', 'ACCUMULO')) {
   tasksToRemove.push('reconfigureAccumulo');
 }
@@ -261,6 +264,20 @@ App.HighAvailabilityWizardStep9Controller = 
App.HighAvailabilityProgressPageCont
 });
   },
 
+  reconfigureAMS: function () {
+var data = this.get('content.serviceConfigProperties');
+var configData = this.reconfigureSites(['ams-hbase-site'], data, 
Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE',
 false)));
+App.ajax.send({
+  name: 'common.service.configurations',
+  sender: this,
+  data: {
+desired_config: configData
+  },
+  success: 'saveConfigTag',
+  error: 'onTaskError'
+});
+  },
+
   reconfigureAccumulo: function () {
 var data = this.get('content.serviceConfigProperties');
 var configData = this.reconfigureSites(['accumulo-site'], data, 
Em.I18n.t('admin.highAvailability.step4.save.configuration.note').format(App.format.role('NAMENODE',
 false)));

http://git-wip-us.apache.org/repos/asf/ambari/blob/eae2a4c5/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js 

ambari git commit: AMBARI-19252. Incorrect Method types displayed in the description of created Alert notification. (Vivek Subramanian via yusaku)

2016-12-28 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 4f8934d68 -> a76c5c8b2


AMBARI-19252. Incorrect Method types displayed in the description of created 
Alert notification. (Vivek Subramanian via yusaku)


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

Branch: refs/heads/branch-2.5
Commit: a76c5c8b2ce19b8d46805b12baf22d64c45d0f6e
Parents: 4f8934d
Author: Yusaku Sako 
Authored: Wed Dec 28 10:06:45 2016 -0800
Committer: Yusaku Sako 
Committed: Wed Dec 28 10:06:45 2016 -0800

--
 .../manage_alert_notifications_controller.js|  34 +++--
 .../alerts/manage_alert_notifications_popup.hbs |   2 +-
 .../alerts/manage_alert_notifications_view.js   |   4 +
 ...anage_alert_notifications_controller_test.js | 153 ++-
 4 files changed, 180 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/a76c5c8b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
 
b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
index 369a053..84cf6ca 100644
--- 
a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
+++ 
b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
@@ -392,6 +392,7 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
   fillEditCreateInputs: function (addCopyToName) {
 var inputFields = this.get('inputFields');
 var selectedAlertNotification = this.get('selectedAlertNotification');
+var methodValue = 
this.getNotificationTypeText(selectedAlertNotification.get('type'));
 inputFields.set('name.value', (addCopyToName ? 'Copy of ' : '') + 
selectedAlertNotification.get('name'));
 inputFields.set('groups.value', 
selectedAlertNotification.get('groups').toArray());
 inputFields.set('email.value', 
selectedAlertNotification.get('properties')['ambari.dispatch.recipients'] ?
@@ -416,7 +417,7 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
 // not allow to edit global field
 inputFields.set('global.disabled', true);
 inputFields.set('description.value', 
selectedAlertNotification.get('description'));
-inputFields.set('method.value', selectedAlertNotification.get('type'));
+inputFields.set('method.value', methodValue);
 inputFields.get('customProperties').clear();
 var properties = selectedAlertNotification.get('properties');
 var ignoredCustomProperties = this.get('ignoredCustomProperties');
@@ -768,21 +769,12 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
 inputFields.get('customProperties').forEach(function (customProperty) {
   properties[customProperty.name] = customProperty.value;
 });
-var getNotificationType = function() {
-  var methodValue = inputFields.get('method.value');
-  if(methodValue == "Custom SNMP") {
-methodValue = "SNMP";
-  } else if(methodValue == "SNMP") {
-methodValue = "AMBARI_SNMP"
-  }
-  return methodValue;
-};
 var apiObject = {
   AlertTarget: {
 name: inputFields.get('name.value'),
 description: inputFields.get('description.value'),
 global: inputFields.get('allGroups.value') === 'all',
-notification_type: getNotificationType(),
+notification_type: 
this.getNotificationType(inputFields.get('method.value')),
 alert_states: inputFields.get('severityFilter.value'),
 properties: properties
   }
@@ -793,6 +785,26 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
 return apiObject;
   },
 
+  getNotificationType: function(text) {
+var notificationType = text;
+if(notificationType == "Custom SNMP") {
+  notificationType = "SNMP";
+} else if(notificationType == "SNMP") {
+  notificationType = "AMBARI_SNMP";
+}
+return notificationType;
+  },
+
+  getNotificationTypeText: function(notificationType) {
+var notificationTypeText = notificationType;
+if(notificationType == "SNMP") {
+  notificationTypeText = "Custom SNMP";
+} else if(notificationType == "AMBARI_SNMP") {
+  notificationTypeText = "SNMP";
+}
+return notificationTypeText;
+  },
+
   /**
* Send request to server to create Alert Notification
* @param {object} apiObject (@see formatNotificationAPIObject)


ambari git commit: AMBARI-19252. Incorrect Method types displayed in the description of created Alert notification. (Vivek Subramanian via yusaku)

2016-12-28 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/trunk d1109a5ec -> 69e973c41


AMBARI-19252. Incorrect Method types displayed in the description of created 
Alert notification. (Vivek Subramanian via yusaku)


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

Branch: refs/heads/trunk
Commit: 69e973c41cb35541ee165372212947c0d8357d6f
Parents: d1109a5
Author: Yusaku Sako 
Authored: Wed Dec 28 10:05:24 2016 -0800
Committer: Yusaku Sako 
Committed: Wed Dec 28 10:05:24 2016 -0800

--
 .../manage_alert_notifications_controller.js|  34 ++--
 .../alerts/manage_alert_notifications_popup.hbs |   2 +-
 .../alerts/manage_alert_notifications_view.js   |   4 +
 ...anage_alert_notifications_controller_test.js | 154 ++-
 4 files changed, 181 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/69e973c4/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
 
b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
index 466d2e1..8501678 100644
--- 
a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
+++ 
b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
@@ -402,6 +402,7 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
   fillEditCreateInputs: function (addCopyToName) {
 var inputFields = this.get('inputFields');
 var selectedAlertNotification = this.get('selectedAlertNotification');
+var methodValue = 
this.getNotificationTypeText(selectedAlertNotification.get('type'));
 inputFields.set('name.value', (addCopyToName ? 'Copy of ' : '') + 
selectedAlertNotification.get('name'));
 inputFields.set('groups.value', 
selectedAlertNotification.get('groups').toArray());
 inputFields.set('email.value', 
selectedAlertNotification.get('properties')['ambari.dispatch.recipients'] ?
@@ -426,7 +427,7 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
 // not allow to edit global field
 inputFields.set('global.disabled', true);
 inputFields.set('description.value', 
selectedAlertNotification.get('description'));
-inputFields.set('method.value', selectedAlertNotification.get('type'));
+inputFields.set('method.value', methodValue);
 inputFields.get('customProperties').clear();
 var properties = selectedAlertNotification.get('properties');
 var ignoredCustomProperties = this.get('ignoredCustomProperties');
@@ -778,21 +779,12 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
 inputFields.get('customProperties').forEach(function (customProperty) {
   properties[customProperty.name] = customProperty.value;
 });
-var getNotificationType = function() {
-  var methodValue = inputFields.get('method.value');
-  if(methodValue == "Custom SNMP") {
-methodValue = "SNMP";
-  } else if(methodValue == "SNMP") {
-methodValue = "AMBARI_SNMP"
-  }
-  return methodValue;
-};
 var apiObject = {
   AlertTarget: {
 name: inputFields.get('name.value'),
 description: inputFields.get('description.value'),
 global: inputFields.get('allGroups.value') === 'all',
-notification_type: getNotificationType(),
+notification_type: 
this.getNotificationType(inputFields.get('method.value')),
 alert_states: inputFields.get('severityFilter.value'),
 properties: properties
   }
@@ -803,6 +795,26 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
 return apiObject;
   },
 
+  getNotificationType: function(text) {
+var notificationType = text;
+if(notificationType == "Custom SNMP") {
+  notificationType = "SNMP";
+} else if(notificationType == "SNMP") {
+  notificationType = "AMBARI_SNMP";
+}
+return notificationType;
+  },
+
+  getNotificationTypeText: function(notificationType) {
+var notificationTypeText = notificationType;
+if(notificationType == "SNMP") {
+  notificationTypeText = "Custom SNMP";
+} else if(notificationType == "AMBARI_SNMP") {
+  notificationTypeText = "SNMP";
+}
+return notificationTypeText;
+  },
+
   /**
* Send request to server to create Alert Notification
* @param {object} apiObject (@see formatNotificationAPIObject)


ambari git commit: AMBARI-14958. Alerts: Create new Alerts Notification type for SNMP to handle Ambari MIB. (Vivek Subramanian via yusaku)

2016-12-28 Thread yusaku
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 dc566c6cc -> 4f8934d68


AMBARI-14958. Alerts: Create new Alerts Notification type for SNMP to handle 
Ambari MIB. (Vivek Subramanian via yusaku)


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

Branch: refs/heads/branch-2.5
Commit: 4f8934d68575a4de01a579c731671fb6e22679da
Parents: dc566c6
Author: Yusaku Sako 
Authored: Wed Dec 28 10:02:53 2016 -0800
Committer: Yusaku Sako 
Committed: Wed Dec 28 10:02:53 2016 -0800

--
 .../manage_alert_notifications_controller.js| 36 ++-
 .../main/alerts/create_alert_notification.hbs   | 68 +---
 .../alerts/manage_alert_notifications_view.js   |  6 ++
 3 files changed, 97 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/4f8934d6/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
--
diff --git 
a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
 
b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
index 1de15a6..369a053 100644
--- 
a/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
+++ 
b/ambari-web/app/controllers/main/alerts/manage_alert_notifications_controller.js
@@ -157,7 +157,7 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
* used in Type combobox
* @type {Array}
*/
-  methods: ['EMAIL', 'SNMP'],
+  methods: ['EMAIL', 'SNMP', 'Custom SNMP'],
 
   /**
* List of available value for Severity Filter
@@ -311,6 +311,16 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
 errorKey: 'hostError',
 validator: 'hostsValidation'
   }
+],
+CustomSNMP: [
+  {
+errorKey: 'portError',
+validator: 'portValidation'
+  },
+  {
+errorKey: 'hostError',
+validator: 'hostsValidation'
+  }
 ]
   },
 
@@ -451,11 +461,17 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
 
 isEmailMethodSelected: 
Em.computed.equal('controller.inputFields.method.value', 'EMAIL'),
 
+isSNMPMethodSelected: 
Em.computed.equal('controller.inputFields.method.value', 'SNMP'),
+
+isCustomSNMPMethodSelected: 
Em.computed.equal('controller.inputFields.method.value', 'Custom SNMP'),
+
 methodObserver: function () {
   var currentMethod = this.get('controller.inputFields.method.value'),
 validationMap = self.get('validationMap');
   self.get('methods').forEach(function (method) {
-var validations = validationMap[method];
+// Replace blank spaces with empty character
+var mapKey = method.replace(/\s/g, "");
+var validations = validationMap[mapKey];
 if (method === currentMethod) {
   validations.mapProperty('validator').forEach(function (key) {
 this.get(key).call(this);
@@ -735,6 +751,11 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
 properties['ambari.dispatch.credential.password'] = 
inputFields.get('SMTPPassword.value');
 properties['mail.smtp.starttls.enable'] = 
inputFields.get('SMTPSTARTTLS.value');
   }
+} else if(inputFields.get('method.value') === 'SNMP') {
+  properties['ambari.dispatch.snmp.version'] = 
inputFields.get('version.value');
+  properties['ambari.dispatch.snmp.community'] = 
inputFields.get('community.value');
+  properties['ambari.dispatch.recipients'] = 
inputFields.get('host.value').replace(/\s/g, '').split(',');
+  properties['ambari.dispatch.snmp.port'] = inputFields.get('port.value');
 } else {
   properties['ambari.dispatch.snmp.version'] = 
inputFields.get('version.value');
   properties['ambari.dispatch.snmp.oids.trap'] = 
inputFields.get('OIDs.value');
@@ -747,12 +768,21 @@ App.ManageAlertNotificationsController = 
Em.Controller.extend({
 inputFields.get('customProperties').forEach(function (customProperty) {
   properties[customProperty.name] = customProperty.value;
 });
+var getNotificationType = function() {
+  var methodValue = inputFields.get('method.value');
+  if(methodValue == "Custom SNMP") {
+methodValue = "SNMP";
+  } else if(methodValue == "SNMP") {
+methodValue = "AMBARI_SNMP"
+  }
+  return methodValue;
+};
 var apiObject = {
   AlertTarget: {
 name: inputFields.get('name.value'),
 description: 

ambari git commit: AMBARI-19261 : AMS cannot start after NN HA is enabled due to hbase.rootdir pointing to Standby NN. UpgradeCatalog changes(avijayan)

2016-12-28 Thread avijayan
Repository: ambari
Updated Branches:
  refs/heads/trunk d84aa3bcb -> d1109a5ec


AMBARI-19261 : AMS cannot start after NN HA is enabled due to hbase.rootdir 
pointing to Standby NN. UpgradeCatalog changes(avijayan)


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

Branch: refs/heads/trunk
Commit: d1109a5ec1f761bc9cdc990f9c7c3804ff754c74
Parents: d84aa3b
Author: Aravindan Vijayan 
Authored: Wed Dec 28 09:36:29 2016 -0800
Committer: Aravindan Vijayan 
Committed: Wed Dec 28 09:36:29 2016 -0800

--
 .../server/upgrade/UpgradeCatalog250.java   | 29 
 .../server/upgrade/UpgradeCatalog250Test.java   | 72 
 2 files changed, 101 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d1109a5e/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 72b2192..49f50cb 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
@@ -57,6 +57,10 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
   protected static final String GROUPS_TABLE = "groups";
   protected static final String GROUP_TYPE_COL = "group_type";
   private static final String AMS_ENV = "ams-env";
+  private static final String AMS_SITE = "ams-site";
+  private static final String AMS_MODE = 
"timeline.metrics.service.operation.mode";
+  private static final String AMS_HBASE_SITE = "ams-hbase-site";
+  private static final String HBASE_ROOTDIR = "hbase.rootdir";
   private static final String HADOOP_ENV = "hadoop-env";
   private static final String KAFKA_BROKER = "kafka-broker";
   private static final String KAFKA_TIMELINE_METRICS_HOST = 
"kafka.timeline.metrics.host";
@@ -241,6 +245,31 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
 updateConfigurationPropertiesForCluster(cluster, AMS_ENV, 
newProperties, true, true);
   }
 
+
+  boolean isDistributed = false;
+  Config amsSite = cluster.getDesiredConfigByType(AMS_SITE);
+  if (amsSite != null) {
+if ("distributed".equals(amsSite.getProperties().get(AMS_MODE))) {
+  isDistributed = true;
+}
+  }
+
+  if (isDistributed) {
+Config amsHbaseSite = 
cluster.getDesiredConfigByType(AMS_HBASE_SITE);
+if (amsHbaseSite != null) {
+  Map amsHbaseSiteProperties = 
amsHbaseSite.getProperties();
+  String rootDir = amsHbaseSiteProperties.get(HBASE_ROOTDIR);
+  if (StringUtils.isNotEmpty(rootDir) && 
rootDir.startsWith("hdfs://")) {
+int indexOfSlash = rootDir.indexOf("/", 7);
+Map newProperties = new HashMap<>();
+String newRootdir = rootDir.substring(indexOfSlash);
+newProperties.put(HBASE_ROOTDIR, newRootdir);
+LOG.info("Changing ams-hbase-site rootdir to " + newRootdir);
+updateConfigurationPropertiesForCluster(cluster, 
AMS_HBASE_SITE, newProperties, true, true);
+  }
+}
+  }
+
 }
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1109a5e/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 f2424a1..433d1c95 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
@@ -392,6 +392,78 @@ public class UpgradeCatalog250Test {
 assertTrue(Maps.difference(newPropertiesAmsEnv, 
updatedProperties).areEqual());
   }
 
+  @Test
+  public void testAmsHbaseSiteUpdateConfigs() throws Exception {
+
+Map newProperties = new HashMap() {
+  {
+put("hbase.rootdir", "/user/ams/hbase");
+  }
+};
+
+Map oldProperties = new HashMap() {
+  {
+put("hbase.rootdir", 

ambari git commit: AMBARI-19261 : AMS cannot start after NN HA is enabled due to hbase.rootdir pointing to Standby NN. UpgradeCatalog changes(avijayan)

2016-12-28 Thread avijayan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 ebaa0ea79 -> dc566c6cc


AMBARI-19261 : AMS cannot start after NN HA is enabled due to hbase.rootdir 
pointing to Standby NN. UpgradeCatalog changes(avijayan)


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

Branch: refs/heads/branch-2.5
Commit: dc566c6cc3790761a3abe5e7fe173c1f9ea31f1b
Parents: ebaa0ea
Author: Aravindan Vijayan 
Authored: Wed Dec 28 09:34:19 2016 -0800
Committer: Aravindan Vijayan 
Committed: Wed Dec 28 09:34:19 2016 -0800

--
 .../server/upgrade/UpgradeCatalog250.java   | 29 
 .../server/upgrade/UpgradeCatalog250Test.java   | 72 
 2 files changed, 101 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/dc566c6c/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 59988ea..38c7537 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
@@ -57,6 +57,10 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
   protected static final String GROUPS_TABLE = "groups";
   protected static final String GROUP_TYPE_COL = "group_type";
   private static final String AMS_ENV = "ams-env";
+  private static final String AMS_SITE = "ams-site";
+  private static final String AMS_MODE = 
"timeline.metrics.service.operation.mode";
+  private static final String AMS_HBASE_SITE = "ams-hbase-site";
+  private static final String HBASE_ROOTDIR = "hbase.rootdir";
   private static final String HADOOP_ENV = "hadoop-env";
   private static final String KAFKA_BROKER = "kafka-broker";
   private static final String KAFKA_TIMELINE_METRICS_HOST = 
"kafka.timeline.metrics.host";
@@ -191,6 +195,31 @@ public class UpgradeCatalog250 extends 
AbstractUpgradeCatalog {
 updateConfigurationPropertiesForCluster(cluster, AMS_ENV, 
newProperties, true, true);
   }
 
+
+  boolean isDistributed = false;
+  Config amsSite = cluster.getDesiredConfigByType(AMS_SITE);
+  if (amsSite != null) {
+if ("distributed".equals(amsSite.getProperties().get(AMS_MODE))) {
+  isDistributed = true;
+}
+  }
+
+  if (isDistributed) {
+Config amsHbaseSite = 
cluster.getDesiredConfigByType(AMS_HBASE_SITE);
+if (amsHbaseSite != null) {
+  Map amsHbaseSiteProperties = 
amsHbaseSite.getProperties();
+  String rootDir = amsHbaseSiteProperties.get(HBASE_ROOTDIR);
+  if (StringUtils.isNotEmpty(rootDir) && 
rootDir.startsWith("hdfs://")) {
+int indexOfSlash = rootDir.indexOf("/", 7);
+Map newProperties = new HashMap<>();
+String newRootdir = rootDir.substring(indexOfSlash);
+newProperties.put(HBASE_ROOTDIR, newRootdir);
+LOG.info("Changing ams-hbase-site rootdir to " + newRootdir);
+updateConfigurationPropertiesForCluster(cluster, 
AMS_HBASE_SITE, newProperties, true, true);
+  }
+}
+  }
+
 }
   }
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/dc566c6c/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 bb46fa6..370588a 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
@@ -392,6 +392,78 @@ public class UpgradeCatalog250Test {
 assertTrue(Maps.difference(newPropertiesAmsEnv, 
updatedProperties).areEqual());
   }
 
+  @Test
+  public void testAmsHbaseSiteUpdateConfigs() throws Exception {
+
+Map newProperties = new HashMap() {
+  {
+put("hbase.rootdir", "/user/ams/hbase");
+  }
+};
+
+Map oldProperties = new HashMap() {
+  {
+

[2/2] ambari git commit: AMBARI-19296. When adding service, custom core-site properties get reverted back (echekanskiy via dlisnichenko)

2016-12-28 Thread dmitriusan
AMBARI-19296. When adding service, custom core-site properties get reverted 
back (echekanskiy via dlisnichenko)


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

Branch: refs/heads/trunk
Commit: d84aa3bcb184db60e8d1a68429e1c7abb3fa3646
Parents: 1bfffc0
Author: Lisnichenko Dmitro 
Authored: Wed Dec 28 16:58:27 2016 +0200
Committer: Lisnichenko Dmitro 
Committed: Wed Dec 28 16:58:27 2016 +0200

--
 .../stacks/HDP/2.0.6/services/stack_advisor.py  | 51 +++-
 .../stacks/HDP/2.1/services/stack_advisor.py| 20 +---
 .../stacks/HDP/2.3/services/stack_advisor.py|  2 +-
 .../stacks/HDP/2.5/services/stack_advisor.py| 20 +---
 4 files changed, 43 insertions(+), 50 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/d84aa3bc/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index a352cdb..77ed527 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -205,11 +205,8 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
 if "HDFS" in servicesList:
   ambari_user = self.getAmbariUser(services)
   ambariHostName = socket.getfqdn()
-  is_wildcard_value, hosts = self.get_hosts_for_proxyuser(ambari_user, 
services)
-  if not is_wildcard_value:
-hosts.add(ambariHostName)
-putCoreSiteProperty("hadoop.proxyuser.{0}.hosts".format(ambari_user), 
",".join(hosts))
-  putCoreSiteProperty("hadoop.proxyuser.{0}.groups".format(ambari_user), 
"*")
+  self.put_proxyuser_value(ambari_user, ambariHostName, services=services, 
put_function=putCoreSiteProperty)
+  self.put_proxyuser_value(ambari_user, "*", is_groups=True, 
services=services, put_function=putCoreSiteProperty)
   old_ambari_user = self.getOldAmbariUser(services)
   if old_ambari_user is not None:
 
putCoreSitePropertyAttribute("hadoop.proxyuser.{0}.hosts".format(old_ambari_user),
 'delete', 'true')
@@ -254,7 +251,7 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
 for proxyPropertyName, hostSelector in hostSelectorMap.iteritems():
   componentHostNamesString = hostSelector if isinstance(hostSelector, 
basestring) else '*'
   if isinstance(hostSelector, (list, tuple)):
-_, componentHostNames = self.get_hosts_for_proxyuser(user, 
services) # preserve old values
+_, componentHostNames = self.get_data_for_proxyuser(user, 
services) # preserve old values
 for component in hostSelector:
   componentHosts = self.getHostsWithComponent(serviceName, 
component, services, hosts)
   if componentHosts is not None:
@@ -288,13 +285,17 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
 
 return users
 
-  def get_hosts_for_proxyuser(self, user_name, services):
+  def get_data_for_proxyuser(self, user_name, services, groups=False):
 if "core-site" in services["configurations"]:
   coreSite = services["configurations"]["core-site"]['properties']
 else:
   coreSite = {}
 
-property_name = "hadoop.proxyuser.{0}.hosts".format(user_name)
+if groups:
+property_name = "hadoop.proxyuser.{0}.groups".format(user_name)
+else:
+  property_name = "hadoop.proxyuser.{0}.hosts".format(user_name)
+
 if property_name in coreSite:
   property_value = coreSite[property_name]
   if property_value == "*":
@@ -303,6 +304,32 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
 return False, set(property_value.split(","))
 return False, set()
 
+  def put_proxyuser_value(self, user_name, value, is_groups=False, 
services=None, put_function=None):
+is_wildcard_value, current_value = self.get_data_for_proxyuser(user_name, 
services, is_groups)
+result_value = "*"
+result_values_set = self.merge_proxyusers_values(current_value, value)
+if len(result_values_set) > 0:
+  result_value = ",".join(sorted([val for val in result_values_set if 
val]))
+
+if is_groups:
+  property_name = "hadoop.proxyuser.{0}.groups".format(user_name)
+else:
+  property_name = "hadoop.proxyuser.{0}.hosts".format(user_name)
+
+put_function(property_name, result_value)
+
+  def merge_proxyusers_values(self, first, second):
+result = set()
+def append(data):
+  

[1/2] ambari git commit: AMBARI-19296. When adding service, custom core-site properties get reverted back (echekanskiy via dlisnichenko)

2016-12-28 Thread dmitriusan
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 cf28b98aa -> ebaa0ea79
  refs/heads/trunk 1bfffc0c8 -> d84aa3bcb


AMBARI-19296. When adding service, custom core-site properties get reverted 
back (echekanskiy via dlisnichenko)


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

Branch: refs/heads/branch-2.5
Commit: ebaa0ea79c20702e2e03e1cdf331f8816515fecc
Parents: cf28b98
Author: Lisnichenko Dmitro 
Authored: Wed Dec 28 16:57:35 2016 +0200
Committer: Lisnichenko Dmitro 
Committed: Wed Dec 28 16:57:35 2016 +0200

--
 .../stacks/HDP/2.0.6/services/stack_advisor.py  | 86 ++--
 .../stacks/HDP/2.1/services/stack_advisor.py| 20 +
 .../stacks/HDP/2.3/services/stack_advisor.py|  2 +-
 .../stacks/HDP/2.5/services/stack_advisor.py| 20 +
 .../stacks/2.0.6/common/test_stack_advisor.py   | 10 +--
 5 files changed, 67 insertions(+), 71 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/ebaa0ea7/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
--
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
index a98be40..9c0b357 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py
@@ -200,12 +200,23 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
  ambari_user = ambari_user.split('@')[0]
 return ambari_user
 
-  def get_hosts_for_proxyuser(self, user_name, services):
+  def get_data_for_proxyuser(self, user_name, services, groups=False):
+"""
+Returns values of proxyuser properties for given user. Properties can be
+hadoop.proxyuser.username.groups or hadoop.proxyuser.username.hosts
+:param user_name:
+:param services:
+:param groups: if true, will return values for group property, not hosts
+:return: tuple (wildcard_value, set[values]), where wildcard_value 
indicates if property value was *
+"""
 if "core-site" in services["configurations"]:
   coreSite = services["configurations"]["core-site"]['properties']
 else:
   coreSite = {}
-property_name = "hadoop.proxyuser.{0}.hosts".format(user_name)
+if groups:
+  property_name = "hadoop.proxyuser.{0}.groups".format(user_name)
+else:
+  property_name = "hadoop.proxyuser.{0}.hosts".format(user_name)
 if property_name in coreSite:
   property_value = coreSite[property_name]
   if property_value == "*":
@@ -214,15 +225,40 @@ class HDP206StackAdvisor(DefaultStackAdvisor):
 return False, set(property_value.split(","))
 return False, set()
 
+  def put_proxyuser_value(self, user_name, value, is_groups=False, 
services=None, put_function=None):
+is_wildcard_value, current_value = self.get_data_for_proxyuser(user_name, 
services, is_groups)
+result_value = "*"
+result_values_set = self.merge_proxyusers_values(current_value, value)
+if len(result_values_set) > 0:
+  result_value = ",".join(sorted([val for val in result_values_set if 
val]))
+
+if is_groups:
+  property_name = "hadoop.proxyuser.{0}.groups".format(user_name)
+else:
+  property_name = "hadoop.proxyuser.{0}.hosts".format(user_name)
+
+put_function(property_name, result_value)
+
+  def merge_proxyusers_values(self, first, second):
+result = set()
+def append(data):
+  if isinstance(data, str) or isinstance(data, unicode):
+if data != "*":
+  result.update(data.split(","))
+  else:
+result.update(data)
+append(first)
+append(second)
+return result
+
   def recommendAmbariProxyUsersForHDFS(self, services, servicesList, 
putCoreSiteProperty, putCoreSitePropertyAttribute):
   if "HDFS" in servicesList:
   ambari_user = self.getAmbariUser(services)
   ambariHostName = socket.getfqdn()
-  is_wildcard_value, hosts = self.get_hosts_for_proxyuser(ambari_user, 
services)
-  if not is_wildcard_value:
-hosts.add(ambariHostName)
-
putCoreSiteProperty("hadoop.proxyuser.{0}.hosts".format(ambari_user), 
",".join(hosts))
-  
putCoreSiteProperty("hadoop.proxyuser.{0}.groups".format(ambari_user), "*")
+
+  
self.put_proxyuser_value(ambari_user,ambariHostName,services=services,put_function=putCoreSiteProperty)
+  self.put_proxyuser_value(ambari_user, "*", is_groups=True, 

ambari git commit: AMBARI-19307. UI should validate Ranger user password be more than 8 chars (onechiporenko)

2016-12-28 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/trunk e423a65e5 -> 1bfffc0c8


AMBARI-19307. UI should validate Ranger user password be more than 8 chars 
(onechiporenko)


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

Branch: refs/heads/trunk
Commit: 1bfffc0c8f231b583dc259c4d4e3fd91079aec0b
Parents: e423a65
Author: Oleg Nechiporenko 
Authored: Wed Dec 28 12:36:40 2016 +0200
Committer: Oleg Nechiporenko 
Committed: Wed Dec 28 12:36:40 2016 +0200

--
 ambari-web/app/messages.js  |  1 +
 ambari-web/app/utils/config.js  |  8 +--
 .../objects/service_config_property_test.js | 25 
 3 files changed, 32 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/1bfffc0c/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index e9d117a..a1b67e5 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -3206,6 +3206,7 @@ Em.I18n.translations = {
   'errorMessage.config.user': 'Value is not valid',
   'errorMessage.config.ldapUrl': 'Must be a valid LDAP url',
   'errorMessage.config.password': 'Passwords do not match',
+  'errorMessage.config.password.length': 'Password should contain at least {0} 
symbols',
   'errorMessage.config.directory.heterogeneous': 'dir format is wrong, can be 
"[{storage type}]/{dir name}"',
   'errorMessage.config.directory.default': 'Must be a slash or drive at the 
start, and must not contain white spaces',
   'errorMessage.config.directory.allowed': 'Can\'t start with "home(s)"',

http://git-wip-us.apache.org/repos/asf/ambari/blob/1bfffc0c/ambari-web/app/utils/config.js
--
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index cd09e14..d0dbb69 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -615,6 +615,11 @@ App.config = Em.Object.create({
 };
   case 'password':
 return function (value, name, retypedPassword) {
+  if (name === 'ranger_admin_password') {
+if (String(value).length < 9) {
+  return 
Em.I18n.t('errorMessage.config.password.length').format(9);
+}
+  }
   return value !== retypedPassword ? 
Em.I18n.t('errorMessage.config.password') : '';
 };
   case 'user':
@@ -632,9 +637,8 @@ App.config = Em.Object.create({
   if (['javax.jdo.option.ConnectionURL', 
'oozie.service.JPAService.jdbc.url'].contains(name)
 && !validator.isConfigValueLink(value) && 
validator.isConfigValueLink(value)) {
 return Em.I18n.t('errorMessage.config.spaces.trim');
-  } else {
-return validator.isNotTrimmedRight(value) ? 
Em.I18n.t('errorMessage.config.spaces.trailing') : '';
   }
+  return validator.isNotTrimmedRight(value) ? 
Em.I18n.t('errorMessage.config.spaces.trailing') : '';
 };
 }
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/1bfffc0c/ambari-web/test/models/configs/objects/service_config_property_test.js
--
diff --git 
a/ambari-web/test/models/configs/objects/service_config_property_test.js 
b/ambari-web/test/models/configs/objects/service_config_property_test.js
index ef0bd61..728141b 100644
--- a/ambari-web/test/models/configs/objects/service_config_property_test.js
+++ b/ambari-web/test/models/configs/objects/service_config_property_test.js
@@ -322,4 +322,29 @@ describe('App.ServiceConfigProperty', function () {
 });
   });
 
+  describe('custom validation for `ranger_admin_password`', function () {
+
+beforeEach(function () {
+  this.config = App.ServiceConfigProperty.create({
+name: 'ranger_admin_password',
+displayType: 'password'
+  });
+});
+
+it('value less than 9 symbols is invalid', function () {
+  this.config.set('value', 12345678);
+  this.config.set('retypedPassword', 12345678);
+  expect(this.config.get('isValid')).to.be.false;
+  
expect(this.config.get('errorMessage')).to.be.equal(Em.I18n.t('errorMessage.config.password.length').format(9));
+});
+
+it('value with 9 symbols is valid', function () {
+  this.config.set('value', 123456789);
+  this.config.set('retypedPassword', 123456789);
+  expect(this.config.get('isValid')).to.be.true;
+  expect(this.config.get('errorMessage')).to.be.equal('');
+});
+

ambari git commit: AMBARI-19307. UI should validate Ranger user password be more than 8 chars (onechiporenko)

2016-12-28 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 c0f9621f2 -> cf28b98aa


AMBARI-19307. UI should validate Ranger user password be more than 8 chars 
(onechiporenko)


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

Branch: refs/heads/branch-2.5
Commit: cf28b98aab7522796ecde08051533a8d38f28369
Parents: c0f9621
Author: Oleg Nechiporenko 
Authored: Wed Dec 28 12:36:40 2016 +0200
Committer: Oleg Nechiporenko 
Committed: Wed Dec 28 15:00:51 2016 +0200

--
 ambari-web/app/messages.js  |  1 +
 ambari-web/app/utils/config.js  |  8 +--
 .../objects/service_config_property_test.js | 25 
 3 files changed, 32 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/cf28b98a/ambari-web/app/messages.js
--
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index bb433a2..cd984c5 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -3172,6 +3172,7 @@ Em.I18n.translations = {
   'errorMessage.config.user': 'Value is not valid',
   'errorMessage.config.ldapUrl': 'Must be a valid LDAP url',
   'errorMessage.config.password': 'Passwords do not match',
+  'errorMessage.config.password.length': 'Password should contain at least {0} 
symbols',
   'errorMessage.config.directory.heterogeneous': 'dir format is wrong, can be 
"[{storage type}]/{dir name}"',
   'errorMessage.config.directory.default': 'Must be a slash or drive at the 
start, and must not contain white spaces',
   'errorMessage.config.directory.allowed': 'Can\'t start with "home(s)"',

http://git-wip-us.apache.org/repos/asf/ambari/blob/cf28b98a/ambari-web/app/utils/config.js
--
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index e9c9e24..ffd0e49 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -632,6 +632,11 @@ App.config = Em.Object.create({
 };
   case 'password':
 return function (value, name, retypedPassword) {
+  if (name === 'ranger_admin_password') {
+if (String(value).length < 9) {
+  return 
Em.I18n.t('errorMessage.config.password.length').format(9);
+}
+  }
   return value !== retypedPassword ? 
Em.I18n.t('errorMessage.config.password') : '';
 };
   case 'user':
@@ -649,9 +654,8 @@ App.config = Em.Object.create({
   if (['javax.jdo.option.ConnectionURL', 
'oozie.service.JPAService.jdbc.url'].contains(name)
 && !validator.isConfigValueLink(value) && 
validator.isConfigValueLink(value)) {
 return Em.I18n.t('errorMessage.config.spaces.trim');
-  } else {
-return validator.isNotTrimmedRight(value) ? 
Em.I18n.t('errorMessage.config.spaces.trailing') : '';
   }
+  return validator.isNotTrimmedRight(value) ? 
Em.I18n.t('errorMessage.config.spaces.trailing') : '';
 };
 }
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/cf28b98a/ambari-web/test/models/configs/objects/service_config_property_test.js
--
diff --git 
a/ambari-web/test/models/configs/objects/service_config_property_test.js 
b/ambari-web/test/models/configs/objects/service_config_property_test.js
index 49613a44..dab133d 100644
--- a/ambari-web/test/models/configs/objects/service_config_property_test.js
+++ b/ambari-web/test/models/configs/objects/service_config_property_test.js
@@ -331,4 +331,29 @@ describe('App.ServiceConfigProperty', function () {
 });
   });
 
+  describe('custom validation for `ranger_admin_password`', function () {
+
+beforeEach(function () {
+  this.config = App.ServiceConfigProperty.create({
+name: 'ranger_admin_password',
+displayType: 'password'
+  });
+});
+
+it('value less than 9 symbols is invalid', function () {
+  this.config.set('value', 12345678);
+  this.config.set('retypedPassword', 12345678);
+  expect(this.config.get('isValid')).to.be.false;
+  
expect(this.config.get('errorMessage')).to.be.equal(Em.I18n.t('errorMessage.config.password.length').format(9));
+});
+
+it('value with 9 symbols is valid', function () {
+  this.config.set('value', 123456789);
+  this.config.set('retypedPassword', 123456789);
+  expect(this.config.get('isValid')).to.be.true;
+  expect(this.config.get('errorMessage')).to.be.equal('');

[02/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/savedQueries/SavedQueryServiceTest.java
--
diff --git 
a/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/savedQueries/SavedQueryServiceTest.java
 
b/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/savedQueries/SavedQueryServiceTest.java
deleted file mode 100644
index 68cb0c8..000
--- 
a/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/savedQueries/SavedQueryServiceTest.java
+++ /dev/null
@@ -1,191 +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.
- */
-
-package org.apache.ambari.view.hive.resources.savedQueries;
-
-import org.apache.ambari.view.hive.HDFSTest;
-import org.apache.ambari.view.hive.utils.NotFoundFormattedException;
-import org.json.simple.JSONObject;
-import org.junit.*;
-import org.junit.rules.ExpectedException;
-
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriBuilder;
-import javax.ws.rs.core.UriInfo;
-import java.io.File;
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-
-import static org.easymock.EasyMock.*;
-
-public class SavedQueryServiceTest extends HDFSTest {
-  //TODO: run without HDFS cluster
-  private SavedQueryService savedQueryService;
-  @Rule public ExpectedException thrown = ExpectedException.none();
-
-  @BeforeClass
-  public static void startUp() throws Exception {
-HDFSTest.startUp(); // super
-  }
-
-  @AfterClass
-  public static void shutDown() throws Exception {
-HDFSTest.shutDown(); // super
-  }
-
-  @Override
-  @Before
-  public void setUp() throws Exception {
-super.setUp();
-savedQueryService = getService(SavedQueryService.class, handler, context);
-savedQueryService.getSharedObjectsFactory().clear();
-  }
-
-  @Override
-  @After
-  public void tearDown() throws Exception {
-super.tearDown();
-  }
-
-  @Override
-  protected void setupProperties(Map properties, File baseDir) 
throws Exception {
-super.setupProperties(properties, baseDir);
-properties.put("scripts.dir", "/tmp/.hiveQueries");
-  }
-
-  private Response doCreateSavedQuery() {
-  return doCreateSavedQuery("Luke", "/tmp/luke.hql", savedQueryService);
-  }
-
-  public static Response doCreateSavedQuery(String title, String path, 
SavedQueryService service) {
-SavedQueryService.SavedQueryRequest request = new 
SavedQueryService.SavedQueryRequest();
-request.savedQuery = new SavedQuery();
-request.savedQuery.setTitle(title);
-request.savedQuery.setQueryFile(path);
-
-UriInfo uriInfo = createNiceMock(UriInfo.class);
-URI uri = UriBuilder.fromUri("http://host/a/b;).build();
-expect(uriInfo.getAbsolutePath()).andReturn(uri);
-
-HttpServletResponse resp_obj = createNiceMock(HttpServletResponse.class);
-
-resp_obj.setHeader(eq("Location"), anyString());
-
-replay(uriInfo, resp_obj);
-return service.create(request, resp_obj, uriInfo);
-  }
-
-  private Response doCreateSavedQuery(String title, String path) {
-  return doCreateSavedQuery(title, path, savedQueryService);
-  }
-
-  @Test
-  public void createSavedQuery() {
-Response response = doCreateSavedQuery();
-Assert.assertEquals(201, response.getStatus());
-
-JSONObject obj = (JSONObject)response.getEntity();
-Assert.assertTrue(obj.containsKey("savedQuery"));
-Assert.assertNotNull(((SavedQuery) obj.get("savedQuery")).getId());
-Assert.assertTrue(((SavedQuery) obj.get("savedQuery")).getId() != null);
-  }
-
-  @Test
-  public void createSavedQueryAutoCreate() {
-Response response = doCreateSavedQuery("Test", null);
-Assert.assertEquals(201, response.getStatus());
-
-JSONObject obj = (JSONObject)response.getEntity();
-Assert.assertTrue(obj.containsKey("savedQuery"));
-Assert.assertNotNull(((SavedQuery) obj.get("savedQuery")).getId());
-Assert.assertFalse(((SavedQuery) obj.get("savedQuery")).getId() == null);
-Assert.assertFalse(((SavedQuery) 
obj.get("savedQuery")).getQueryFile().isEmpty());
- 

[07/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror-min.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror-min.js
 
b/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror-min.js
deleted file mode 100644
index 13d2b2b..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror-min.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/* CodeMirror - Minified & Bundled
-   Generated on 10/30/2014 with http://codemirror.net/doc/compress.html
-   Version: HEAD
-
-   CodeMirror Library:
-   - codemirror.js
-   Modes:
-   - sql.js
-   Add-ons:
-   - sql-hint.js
- */
-
-!function(a){if("object"==typeof exports&&"object"==typeof 
module)module.exports=a();else{if("function"==typeof define&)return 
define([],a);this.CodeMirror=a()}}(function(){"use strict";function 
w(a,b){if(!(this instanceof w))return new 
w(a,b);this.options=b=b?Pg(b):{},Pg(ie,b,!1),J(b);var 
c=b.value;"string"==typeof c&&(c=new Kf(c,b.mode)),this.doc=c;var 
f=this.display=new 
x(a,c);f.wrapper.CodeMirror=this,F(this),D(this),b.lineWrapping&&(this.display.wrapper.className+="
 
CodeMirror-wrap"),b.autofocus&&!o&&_c(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new
 
Fg,keySeq:null},d&&11>e&(Qg($c,this,!0),20),cd(this),hh(),Ac(this),this.curOp.forceUpdate=!0,Of(this,c),b.autofocus&&!o||ah()==f.input?setTimeout(Qg(Hd,this),20):Id(this);for(var
 g in je)je.hasOwnProperty(g)&[g](this,b[g],le);P(this);for(var 
h=0;he&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight=0),n&&(g.style.width="0px"),f||(c.scroller.draggable=!0),k&&(c.inputDiv.style.height="1px",c.inputDiv.style.position="absolute"),d&&8>e&&(c.scrollbarH.style.minHeight=c.scrollbarV.style.minWidth="18px"),a&&(a.appendChild?a.appendChild(c.wrapper):a(c.wrapper)),c.viewFrom=c.viewTo=b.first,c.view=[],c.external
 
Measured=null,c.viewOffset=0,c.lastWrapHeight=c.lastWrapWidth=0,c.updateLineNumbers=null,c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null,c.prevInput="",c.alignWidgets=!1,c.pollingFast=!1,c.poll=new
 
Fg,c.cachedCharWidth=c.cachedTextHeight=c.cachedPaddingH=null,c.inaccurateSelection=!1,c.maxLine=null,c.maxLineLength=0,c.maxLineChanged=!1,c.wheelDX=c.wheelDY=c.wheelStartX=c.wheelStartY=null,c.shift=!1,c.selForContextMenu=null}function
 y(a){a.doc.mode=w.getMode(a.options,a.doc.modeOption),z(a)}function 
z(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,Tb(a,100),a.state.modeGen++,a.curOp&(a)}function
 
A(a){a.options.lineWrapping?(dh(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth=""):(ch(a.display.wrapper,"CodeMirror-wrap"),I(a)),C(a),Pc(a),kc(a),setTimeout(function(){M(a)},100)}function
 B(a){var 
b=wc(a.display),c=a.options.lineWrapping,d=c&(5,a.display.scroller.clientWidth/xc(a.displ
 ay)-3);return function(e){if(ef(a.doc,e))return 0;var f=0;if(e.widgets)for(var 
g=0;g

[22/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Connection.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Connection.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Connection.java
deleted file mode 100644
index d69a1a5..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Connection.java
+++ /dev/null
@@ -1,740 +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.
- */
-
-package org.apache.ambari.view.hive.client;
-
-import org.apache.commons.codec.binary.Hex;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hive.shims.ShimLoader;
-import org.apache.hadoop.security.UserGroupInformation;
-import org.apache.hive.service.auth.HiveAuthFactory;
-import org.apache.hive.service.auth.KerberosSaslHelper;
-import org.apache.hive.service.auth.PlainSaslHelper;
-import org.apache.hive.service.auth.SaslQOP;
-import org.apache.hive.service.cli.thrift.*;
-import org.apache.http.HttpRequestInterceptor;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.CookieStore;
-import org.apache.http.client.ServiceUnavailableRetryStrategy;
-import org.apache.http.config.Registry;
-import org.apache.http.config.RegistryBuilder;
-import org.apache.http.conn.socket.ConnectionSocketFactory;
-import org.apache.http.conn.ssl.SSLSocketFactory;
-import org.apache.http.impl.client.BasicCookieStore;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.impl.conn.BasicHttpClientConnectionManager;
-import org.apache.http.protocol.HttpContext;
-import org.apache.thrift.TException;
-import org.apache.thrift.protocol.TBinaryProtocol;
-import org.apache.thrift.transport.THttpClient;
-import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManagerFactory;
-import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslException;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.security.KeyStore;
-import java.security.SecureRandom;
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Holds sessions
- */
-public class Connection {
-  private final static Logger LOG =
-  LoggerFactory.getLogger(Connection.class);
-  private String host;
-  private int port;
-  private Map authParams;
-
-  private TCLIService.Client client = null;
-  private Map sessHandles = null;
-  private TProtocolVersion protocol = null;
-  private TTransport transport;
-
-  private DDLDelegator ddl;
-  private String username;
-  private String password;
-
-  public Connection(String host, int port, Map authParams, 
String username, String password)
-  throws HiveClientException, HiveAuthRequiredException {
-this.host = host;
-this.port = port;
-this.authParams = authParams;
-this.username = username;
-this.password = password;
-
-this.sessHandles = new HashMap();
-
-openConnection();
-ddl = new DDLDelegator(this);
-  }
-
-  public DDLDelegator ddl() {
-return ddl;
-  }
-
-  public synchronized void openConnection() throws HiveClientException, 
HiveAuthRequiredException {
-try {
-  transport = isHttpTransportMode() ? createHttpTransport() : 
createBinaryTransport();
-  transport.open();
-  client = new TCLIService.Client(new TBinaryProtocol(transport));
-} catch (TTransportException e) {
-  throw new HiveClientException("H020 Could not establish connection to "
-  + host + ":" + port + ": " + e.toString(), e);
-} catch (SQLException e) {
-  throw new HiveClientException(e.getMessage(), e);
-}
-LOG.info("Hive 

[13/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/tez-ui.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/tez-ui.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/tez-ui.js
deleted file mode 100644
index 43835e0..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/tez-ui.js
+++ /dev/null
@@ -1,106 +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.
- */
-
-import Ember from 'ember';
-import constants from 'hive/utils/constants';
-
-export default Ember.Controller.extend({
-  needs: [ constants.namingConventions.index ],
-
-  index: Ember.computed.alias('controllers.' + 
constants.namingConventions.index),
-
-  tezViewURL: null,
-  tezApiURL: '/api/v1/views/TEZ',
-  tezURLPrefix: '/views/TEZ',
-  tezDagPath: '?viewPath=/#/dag/',
-
-  isTezViewAvailable: Ember.computed.bool('tezViewURL'),
-
-  dagId: function () {
-if (this.get('isTezViewAvailable')) {
-  return this.get('index.model.dagId');
-}
-
-return false;
-  }.property('index.model.dagId', 'isTezViewAvailable'),
-
-  dagURL: function () {
-if (this.get('dagId')) {
-  return "%@%@%@".fmt(this.get('tezViewURL'), this.get('tezDagPath'), 
this.get('dagId'));
-}
-
-return false;
-  }.property('dagId'),
-
-  getTezView: function () {
-if (this.get('isTezViewAvailable')) {
-  return;
-}
-
-var self = this;
-Ember.$.getJSON(this.get('tezApiURL'))
-  .then(function (response) {
-self.getTezViewInstance(response);
-  })
-  .fail(function (response) {
-self.setTezViewError(response);
-  });
-  }.on('init'),
-
-  getTezViewInstance: function (data) {
-var self = this;
-var url = this.get('tezApiURL') + '/versions/' + 
data.versions[0].ViewVersionInfo.version;
-
-Ember.$.getJSON(url)
-  .then(function (response) {
-if (!response.instances.length) {
-  self.setTezViewError(response);
-  return;
-}
-
-self.set('isTezViewAvailable', true);
-
-var instance = response.instances[0].ViewInstanceInfo;
-self.setTezViewURL(instance);
-  });
-  },
-
-  setTezViewURL: function (instance) {
-var url = "%@/%@/%@/".fmt(
-  this.get('tezURLPrefix'),
-  instance.version,
-  instance.instance_name
-);
-
-this.set('tezViewURL', url);
-  },
-
-  setTezViewError: function (data) {
-// status: 404 => Tev View isn't deployed
-if (data.status && data.status === 404) {
-  this.set('error', 'tez.errors.not.deployed');
-  return;
-}
-
-// no instance created
-if (data.instances && !data.instances.length) {
-  this.set('error', 'tez.errors.no.instance');
-  return;
-}
-  }
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/udfs.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/udfs.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/udfs.js
deleted file mode 100644
index 3aec378..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/udfs.js
+++ /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
- *
- * 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 

[18/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/viewJobs/JobImpl.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/viewJobs/JobImpl.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/viewJobs/JobImpl.java
deleted file mode 100644
index c099cae..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/viewJobs/JobImpl.java
+++ /dev/null
@@ -1,323 +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.
- */
-
-package org.apache.ambari.view.hive.resources.jobs.viewJobs;
-
-import org.apache.commons.beanutils.PropertyUtils;
-
-import java.beans.Transient;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
-
-/**
- * Bean to represent saved query
- */
-public class JobImpl implements Job {
-  private String title = null;
-  private String queryFile = null;
-  private String statusDir = null;
-  private Long dateSubmitted = 0L;
-  private Long duration = 0L;
-  private String forcedContent = null;
-  private String dataBase = null;
-  private String queryId = null;
-
-  private String status = JOB_STATE_UNKNOWN;
-  private String statusMessage = null;
-  private String sqlState = null;
-
-  private String applicationId;
-  private String dagId;
-  private String dagName;
-
-  private String sessionTag;
-  private String referrer;
-  private String globalSettings;
-
-  private String id = null;
-  private String owner = null;
-
-  private String logFile;
-  private String confFile;
-
-  private String hiveQueryId;
-
-  public JobImpl() {}
-  public JobImpl(Map stringObjectMap) throws 
InvocationTargetException, IllegalAccessException {
-for (Map.Entry entry : stringObjectMap.entrySet())  {
-  try {
-PropertyUtils.setProperty(this, entry.getKey(), entry.getValue());
-  } catch (NoSuchMethodException e) {
-//do nothing, skip
-  }
-}
-  }
-
-  @Override
-  public boolean equals(Object o) {
-if (this == o) return true;
-if (!(o instanceof Job)) return false;
-
-JobImpl job = (JobImpl) o;
-
-return id != null ? id.equals(job.id) : job.id == null;
-
-  }
-
-  @Override
-  public int hashCode() {
-return id != null ? id.hashCode() : 0;
-  }
-
-  @Override
-  @Transient
-  public String getHiveQueryId() {
-return hiveQueryId;
-  }
-
-  @Override
-  @Transient
-  public void setHiveQueryId(String hiveQueryId) {
-this.hiveQueryId = hiveQueryId;
-  }
-
-  @Override
-  public String getId() {
-return id;
-  }
-
-  @Override
-  public void setId(String id) {
-this.id = id;
-  }
-
-  @Override
-  public String getOwner() {
-return owner;
-  }
-
-  @Override
-  public void setOwner(String owner) {
-this.owner = owner;
-  }
-
-  @Override
-  public String getTitle() {
-return title;
-  }
-
-  @Override
-  public void setTitle(String title) {
-this.title = title;
-  }
-
-  @Override
-  public String getQueryFile() {
-return queryFile;
-  }
-
-  @Override
-  public void setQueryFile(String queryFile) {
-this.queryFile = queryFile;
-  }
-
-  @Override
-  public Long getDateSubmitted() {
-return dateSubmitted;
-  }
-
-  @Override
-  public void setDateSubmitted(Long dateSubmitted) {
-this.dateSubmitted = dateSubmitted;
-  }
-
-  @Override
-  public Long getDuration() {
-return duration;
-  }
-
-  @Override
-  public void setDuration(Long duration) {
-this.duration = duration;
-  }
-
-  @Override
-  public String getStatus() {
-return status;
-  }
-
-  @Override
-  public void setStatus(String status) {
-this.status = status;
-  }
-
-  @Override
-  @Transient
-  public String getForcedContent() {
-return forcedContent;
-  }
-
-  @Override
-  @Transient
-  public void setForcedContent(String forcedContent) {
-this.forcedContent = forcedContent;
-  }
-
-  @Override
-  public String getQueryId() {
-return queryId;
-  }
-
-  @Override
-  public void setQueryId(String queryId) {
-this.queryId = queryId;
-  }
-
-  @Override
- 

[12/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file-resource.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file-resource.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file-resource.js
deleted file mode 100644
index 47f4911..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file-resource.js
+++ /dev/null
@@ -1,25 +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.
- */
-
-import DS from 'ember-data';
-
-export default DS.Model.extend({
-  name: DS.attr(),
-  path: DS.attr(),
-  owner: DS.attr()
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file.js
deleted file mode 100644
index c13d4e1..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file.js
+++ /dev/null
@@ -1,26 +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.
- */
-
-import DS from 'ember-data';
-
-export default DS.Model.extend({
-  fileContent: DS.attr(),
-  hasNext: DS.attr(),
-  page: DS.attr('number'),
-  pageCount: DS.attr()
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/models/job.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/models/job.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/models/job.js
deleted file mode 100644
index 185f512..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/models/job.js
+++ /dev/null
@@ -1,55 +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.
- */
-
-import DS from 'ember-data';
-
-export default DS.Model.extend({
-  title: DS.attr('string'),
-  queryId: DS.attr(),
-  hiveQueryId: DS.attr('string'),
-  queryFile: DS.attr('string'),
-  owner: DS.attr('string'),
-  dataBase: DS.attr('string'),
-  duration: DS.attr(),
-  status: DS.attr('string'),
-  statusMessage: DS.attr('string'),
-  dateSubmitted: DS.attr('date'),
-  forcedContent: DS.attr('string'),
-  logFile: DS.attr('string'),
-  dagName:  DS.attr('string'),
-  dagId: DS.attr('string'),
-  sessionTag: DS.attr('string'),
-  page: DS.attr(),
-  statusDir: DS.attr('string'),
-  applicationId: DS.attr(),
-  referrer: DS.attr('string'),
-  

[08/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/query-editor-test.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/query-editor-test.js
 
b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/query-editor-test.js
deleted file mode 100644
index e70b5ee..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/query-editor-test.js
+++ /dev/null
@@ -1,52 +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.
- */
-
-import Ember from 'ember';
-import { moduleForComponent, test } from 'ember-qunit';
-
-moduleForComponent('query-editor', 'QueryEditorComponent', {
-  unit: true
-});
-
-test('initEditor sets the editor on didInsertElement', function () {
-  expect(2);
-
-  var component = this.subject();
-
-  equal(component.get('editor'), undefined, 'element not rendered. Editor not 
set.');
-
-  this.$();
-
-  ok(component.get('editor'), 'element rendered. Editor set.');
-});
-
-test('updateValue sets the query value on the editor.', function () {
-  expect(1);
-
-  var component = this.subject();
-
-  var query = 'select something';
-
-  this.$();
-
-  Ember.run(function () {
-component.set(('query'), query);
-  });
-
-  equal(component.get('editor').getValue(), query, 'set query property. 
Updated editor value property.');
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/select-widget-test.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/select-widget-test.js
 
b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/select-widget-test.js
deleted file mode 100644
index a186508..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/select-widget-test.js
+++ /dev/null
@@ -1,158 +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.
- */
-
-import Ember from 'ember';
-import { moduleForComponent, test } from 'ember-qunit';
-
-moduleForComponent('select-widget', 'SelectWidgetComponent', {
-  needs: ['helper:path-binding']
-});
-
-test('selectedLabel returns the selectedValue property indicated by labelPath 
if selectedValue and labelPath are set.', function () {
-  expect(1);
-
-  var component = this.subject();
-
-  var selectedValue = Ember.Object.extend({
-label: 'db'
-  }).create();
-
-  var labelPath = 'label';
-
-  Ember.run(function () {
-component.set('labelPath', labelPath);
-component.set('selectedValue', selectedValue);
-  });
-
-  equal(component.get('selectedLabel'), selectedValue.label, 'selectedValue 
and labelPath are set. selectedLabel returns selectedValue[labelPath].');
-});
-
-test('selectedLabel returns defaultLabel if selectedValue is falsy and 
defaultLabel is set.', function () {
-  expect(1);
-
-  var component = this.subject();
-
-  var defaultLabel = 'select...';
-
-  Ember.run(function () {
-component.set('defaultLabel', defaultLabel);
-  });
-
-  equal(component.get('selectedLabel'), defaultLabel, 'selectedValue falsy and 
defaultLabel set. selectedLabel returns defaultLabel.');
-});
-
-test('selectedLabel returns undefined if neither selectedValue nor 

[04/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/view.log4j.properties
--
diff --git a/contrib/views/hive/src/main/resources/view.log4j.properties 
b/contrib/views/hive/src/main/resources/view.log4j.properties
deleted file mode 100644
index 03c3e93..000
--- a/contrib/views/hive/src/main/resources/view.log4j.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2011 The Apache Software Foundation
-#
-# 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.
-
-log4j.appender.hiveView=org.apache.log4j.RollingFileAppender
-log4j.appender.hiveView.File=${ambari.log.dir}/hive-view/hive-view.log
-log4j.appender.hiveView.MaxFileSize=80MB
-log4j.appender.hiveView.MaxBackupIndex=60
-log4j.appender.hiveView.layout=org.apache.log4j.PatternLayout
-log4j.appender.hiveView.layout.ConversionPattern=%d{DATE} %5p [%t] 
[%X{viewName} %X{viewVersion} %X{viewInstanceName}] %c{1}:%L - %m%n
-
-log4j.logger.org.apache.ambari.view.hive=INFO,hiveView
-log4j.additivity.org.apache.ambari.view.hive = false

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/view.xml
--
diff --git a/contrib/views/hive/src/main/resources/view.xml 
b/contrib/views/hive/src/main/resources/view.xml
deleted file mode 100644
index 36b43d5..000
--- a/contrib/views/hive/src/main/resources/view.xml
+++ /dev/null
@@ -1,347 +0,0 @@
-
-
-HIVE
-Hive
-1.0.0
-${env.BUILD_NUMBER}
-
-2.0.*
-
-
org.apache.ambari.view.hive.PropertyValidator
-org.apache.ambari.view.hive.HiveViewImpl
-
-
-
-  hive.host
-  Enter the HiveServer2 host. Host must be accessible from 
Ambari Server.
-  HiveServer2 Host
-  127.0.0.1
-  fake
-  true
-
-
-
-  hive.port
-  HiveServer2 Thrift port (example: 1).
-  HiveServer2 Thrift port
-  1
-  1
-  hive-site/hive.server2.thrift.port
-  true
-
-
-
-hive.http.port
-HiveServer2 Http port (example: 10001).
-HiveServer2 Http port
-10001
-10001
-
hive-site/hive.server2.thrift.http.port
-true
-
-
-
-hive.http.path
-HiveServer2 Http path (example: cliservice).
-HiveServer2 Http path
-cliservice
-cliservice
-
hive-site/hive.server2.thrift.http.path
-true
-
-
-
-hive.transport.mode
-HiveServer2 Transport Mode (example: 
http/binary).
-HiveServer2 Transport Mode
-binary
-binary
-hive-site/hive.server2.transport.mode
-true
-
-
-
-  hive.auth
-  Semicolon-separated authentication configs.
-  Hive Authentication
-  auth=NONE
-  false
-
-
-
-hive.metastore.warehouse.dir
-Hive Metastore directory (example: 
/apps/hive/warehouse)
-Hive Metastore directory
-/apps/hive/warehouse
-/apps/hive/warehouse
-hive-site/hive.metastore.warehouse.dir
-false
-
-
-
-
-webhdfs.url
-Enter the WebHDFS FileSystem URI. Typically this is the 
dfs.namenode.http-address
-property in the hdfs-site.xml configuration. URL must be 
accessible from Ambari Server.
-WebHDFS FileSystem URI
-webhdfs://namenode:50070
-true
-core-site/fs.defaultFS
-
-
-webhdfs.nameservices
-Comma-separated list of nameservices. Value of 
hdfs-site/dfs.nameservices property
-Logical name of the NameNode cluster
-false
-hdfs-site/dfs.nameservices
-
-
-webhdfs.ha.namenodes.list
-Comma-separated list of namenodes for a given nameservice.
-  Value of hdfs-site/dfs.ha.namenodes.[nameservice] 
property
-List of NameNodes
-false
-fake
-
-
-webhdfs.ha.namenode.rpc-address.nn1
-RPC address for first name node.
-  Value of 
hdfs-site/dfs.namenode.rpc-address.[nameservice].[namenode1] 
property
-First NameNode RPC Address
-false
-fake
-
-
-

[14/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js
deleted file mode 100644
index e7beb77..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js
+++ /dev/null
@@ -1,767 +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.
- */
-
-import Ember from 'ember';
-import constants from 'hive/utils/constants';
-import utils from 'hive/utils/functions';
-
-export default Ember.Controller.extend({
-  jobService: Ember.inject.service(constants.namingConventions.job),
-  jobProgressService: 
Ember.inject.service(constants.namingConventions.jobProgress),
-  databaseService: Ember.inject.service(constants.namingConventions.database),
-  notifyService: Ember.inject.service(constants.namingConventions.notify),
-  session: Ember.inject.service(constants.namingConventions.session),
-  settingsService: Ember.inject.service(constants.namingConventions.settings),
-  ldapAuthenticationService: 
Ember.inject.service(constants.namingConventions.ldapAuthentication),
-
-  openQueries   : 
Ember.inject.controller(constants.namingConventions.openQueries),
-  udfs  : Ember.inject.controller(constants.namingConventions.udfs),
-  logs  : Ember.inject.controller(constants.namingConventions.jobLogs),
-  results   : 
Ember.inject.controller(constants.namingConventions.jobResults),
-  explain   : 
Ember.inject.controller(constants.namingConventions.jobExplain),
-  settings  : 
Ember.inject.controller(constants.namingConventions.settings),
-  visualExplain : 
Ember.inject.controller(constants.namingConventions.visualExplain),
-  tezUI : Ember.inject.controller(constants.namingConventions.tezUI),
-
-  selectedDatabase: Ember.computed.alias('databaseService.selectedDatabase'),
-  isDatabaseExplorerVisible: true,
-  canKillSession: Ember.computed.and('model.sessionTag', 
'model.sessionActive'),
-
-  queryProcessTabs: [
-Ember.Object.create({
-  name: Ember.I18n.t('menus.logs'),
-  path: constants.namingConventions.subroutes.jobLogs
-}),
-Ember.Object.create({
-  name: Ember.I18n.t('menus.results'),
-  path: constants.namingConventions.subroutes.jobResults
-}),
-Ember.Object.create({
-  name: Ember.I18n.t('menus.explain'),
-  path: constants.namingConventions.subroutes.jobExplain
-})
-  ],
-
-  queryPanelActions: [
-Ember.Object.create({
-  icon: 'fa-expand',
-  action: 'toggleDatabaseExplorerVisibility',
-  tooltip: Ember.I18n.t('tooltips.expand')
-})
-  ],
-
-  init: function () {
-this._super();
-
-// initialize queryParams with an empty array
-this.set('queryParams', Ember.ArrayProxy.create({ content: Ember.A([]) }));
-
-this.set('queryProcessTabs', Ember.ArrayProxy.create({ content: Ember.A([
-  Ember.Object.create({
-name: Ember.I18n.t('menus.logs'),
-path: constants.namingConventions.subroutes.jobLogs
-  }),
-  Ember.Object.create({
-name: Ember.I18n.t('menus.results'),
-path: constants.namingConventions.subroutes.jobResults
-  }),
-  Ember.Object.create({
-name: Ember.I18n.t('menus.explain'),
-path: constants.namingConventions.subroutes.jobExplain
-  })
-])}));
-
-this.set('queryPanelActions', Ember.ArrayProxy.create({ content: Ember.A([
-  Ember.Object.create({
-icon: 'fa-expand',
-action: 'toggleDatabaseExplorerVisibility',
-tooltip: Ember.I18n.t('tooltips.expand')
-  })
-])}));
-  },
-
-  canExecute: function () {
-var isModelRunning = this.get('model.isRunning');
-var hasParams = this.get('queryParams.length');
-
-if (isModelRunning) {
-  return false;
-}
-
-if (hasParams) {
-  // all param have values?
-  return this.get('queryParams').every(function (param) { return 
param.value; });
-}
-
-return true;
-  }.property('model.isRunning', 

[20/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/files/FileService.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/files/FileService.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/files/FileService.java
deleted file mode 100644
index 4e1d24f..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/files/FileService.java
+++ /dev/null
@@ -1,266 +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.
- */
-
-package org.apache.ambari.view.hive.resources.files;
-
-import com.jayway.jsonpath.JsonPath;
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.ViewResourceHandler;
-import org.apache.ambari.view.hive.BaseService;
-import org.apache.ambari.view.hive.utils.*;
-import org.apache.ambari.view.utils.hdfs.HdfsApi;
-import org.apache.ambari.view.utils.hdfs.HdfsUtil;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.io.IOUtils;
-import org.apache.hadoop.fs.FSDataOutputStream;
-import org.apache.hadoop.fs.FileAlreadyExistsException;
-import org.json.simple.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.inject.Inject;
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.HashMap;
-import org.apache.ambari.view.commons.hdfs.UserService;
-
-/**
- * File access resource
- * API:
- * GET /:path
- *  read entire file
- * POST /
- *  create new file
- *  Required: filePath
- *  file should not already exists
- * PUT /:path
- *  update file content
- */
-public class FileService extends BaseService {
-  public static final String FAKE_FILE = "fakefile://";
-  public static final String JSON_PATH_FILE = "jsonpath:";
-
-  @Inject
-  ViewResourceHandler handler;
-
-  protected final static Logger LOG =
-  LoggerFactory.getLogger(FileService.class);
-
-  /**
-   * Get single item
-   */
-  @GET
-  @Path("{filePath:.*}")
-  @Produces(MediaType.APPLICATION_JSON)
-  public Response getFilePage(@PathParam("filePath") String filePath, 
@QueryParam("page") Long page) throws IOException, InterruptedException {
-
-LOG.debug("Reading file " + filePath);
-try {
-  FileResource file = new FileResource();
-
-  if (page == null)
-page = 0L;
-
-  if (filePath.startsWith(FAKE_FILE)) {
-if (page > 1)
-  throw new IllegalArgumentException("There's only one page in fake 
files");
-
-String encodedContent = filePath.substring(FAKE_FILE.length());
-String content = new String(Base64.decodeBase64(encodedContent));
-
-fillFakeFileObject(filePath, file, content);
-  } else if (filePath.startsWith(JSON_PATH_FILE)) {
-if (page > 1)
-  throw new IllegalArgumentException("There's only one page in fake 
files");
-
-String content = getJsonPathContentByUrl(filePath);
-fillFakeFileObject(filePath, file, content);
-  } else  {
-
-filePath = sanitizeFilePath(filePath);
-FilePaginator paginator = new FilePaginator(filePath, 
getSharedObjectsFactory().getHdfsApi());
-
-fillRealFileObject(filePath, page, file, paginator);
-  }
-
-  JSONObject object = new JSONObject();
-  object.put("file", file);
-  return Response.ok(object).status(200).build();
-} catch (WebApplicationException ex) {
-  throw ex;
-} catch (FileNotFoundException ex) {
-  throw new NotFoundFormattedException(ex.getMessage(), ex);
-} catch (IllegalArgumentException ex) {
-  throw new BadRequestFormattedException(ex.getMessage(), ex);
-} catch (Exception ex) {
-  throw new ServiceFormattedException(ex.getMessage(), ex);
-}
-  }
-
-  protected String getJsonPathContentByUrl(String filePath) throws 

[09/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/config/environment.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/config/environment.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/config/environment.js
deleted file mode 100644
index 992d91c..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/config/environment.js
+++ /dev/null
@@ -1,70 +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.
- */
-
-/* jshint node: true */
-
-module.exports = function(environment) {
-  var ENV = {
-modulePrefix: 'hive',
-environment: environment,
-baseURL: '/',
-locationType: 'hash',
-EmberENV: {
-  FEATURES: {
-// Here you can enable experimental features on an ember canary build
-// e.g. 'with-controller': true
-  }
-},
-
-contentSecurityPolicy: {
-  'connect-src': "'self' ws://localhost:35729 ws://0.0.0.0:35729",
-  'style-src': "'self' 'unsafe-inline'"
-},
-
-APP: {
-  // Here you can pass flags/options to your application instance
-  // when it is created
-}
-  };
-
-  if (environment === 'development') {
-// ENV.APP.LOG_RESOLVER = true;
-ENV.APP.LOG_ACTIVE_GENERATION = true;
-// ENV.APP.LOG_TRANSITIONS = true;
-// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
-ENV.APP.LOG_VIEW_LOOKUPS = true;
-  }
-
-  if (environment === 'test') {
-// Testem prefers this...
-ENV.baseURL = '/';
-ENV.locationType = 'auto';
-
-// keep test console output quieter
-ENV.APP.LOG_ACTIVE_GENERATION = false;
-ENV.APP.LOG_VIEW_LOOKUPS = false;
-
-ENV.APP.rootElement = '#ember-testing';
-  }
-
-  if (environment === 'production') {
-
-  }
-
-  return ENV;
-};

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/package.json
--
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/package.json 
b/contrib/views/hive/src/main/resources/ui/hive-web/package.json
deleted file mode 100644
index 6fe68e2..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/package.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
-  "name": "hive",
-  "version": "0.0.0",
-  "private": true,
-  "directories": {
-"doc": "doc",
-"test": "tests"
-  },
-  "scripts": {
-"start": "ember server",
-"build": "ember build",
-"test": "ember test",
-"preinstall": "chmod +x node/npm/bin/node-gyp-bin/node-gyp",
-"postinstall": "bash node/with_new_path.sh node node_modules/.bin/bower 
--allow-root install"
-  },
-  "repository": "https://github.com/stefanpenner/ember-cli;,
-  "engines": {
-"node": ">= 0.10.32"
-  },
-  "author": "",
-  "license": "MIT",
-  "devDependencies": {
-"body-parser": "^1.2.0",
-"bower": ">= 1.3.12",
-"broccoli-asset-rev": "^2.0.0",
-"broccoli-sass": "^0.6.3",
-"ember-cli": "0.2.2",
-"ember-cli-autoprefixer": "0.4.1",
-"ember-cli-blanket": "^0.5.0",
-"ember-cli-content-security-policy": "0.3.0",
-"ember-cli-font-awesome": "0.0.4",
-"ember-cli-htmlbars": "0.7.4",
-"ember-cli-ic-ajax": "0.1.1",
-"ember-cli-inject-live-reload": "^1.3.0",
-"ember-cli-jquery-ui": "0.0.12",
-"ember-cli-moment": "0.0.1",
-"ember-cli-pretender": "^0.3.1",
-"ember-cli-qunit": "0.3.14",
-"ember-cli-selectize": "0.0.19",
-"ember-cli-uglify": "1.0.1",
-"ember-cli-uploader": "^0.3.9",
-"ember-data": "1.0.0-beta.16.1",
-"ember-dynamic-component": "0.0.1",
-"ember-export-application-global": "^1.0.0",
-"express": "^4.8.5"
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/testem.json
--
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/testem.json 
b/contrib/views/hive/src/main/resources/ui/hive-web/testem.json
deleted file mode 100644
index 78029a1..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/testem.json
+++ /dev/null
@@ 

[17/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadFromHdfsInput.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadFromHdfsInput.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadFromHdfsInput.java
deleted file mode 100644
index af20aff..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadFromHdfsInput.java
+++ /dev/null
@@ -1,130 +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.
- */
-
-package org.apache.ambari.view.hive.resources.uploads;
-
-import java.io.Serializable;
-import java.util.List;
-
-public class UploadFromHdfsInput implements Serializable{
-  private Boolean isFirstRowHeader = Boolean.FALSE;
-  private String inputFileType;
-  private String hdfsPath;
-  private String tableName;
-  private String databaseName;
-  private List header;
-  private boolean containsEndlines;
-
-  private String csvDelimiter;
-  private String csvEscape;
-  private String csvQuote;
-
-  public UploadFromHdfsInput() {
-  }
-
-  public String getCsvDelimiter() {
-return csvDelimiter;
-  }
-
-  public List getHeader() {
-return header;
-  }
-
-  public void setHeader(List header) {
-this.header = header;
-  }
-
-  public boolean isContainsEndlines() {
-return containsEndlines;
-  }
-
-  public void setContainsEndlines(boolean containsEndlines) {
-this.containsEndlines = containsEndlines;
-  }
-
-  public void setCsvDelimiter(String csvDelimiter) {
-this.csvDelimiter = csvDelimiter;
-  }
-
-  public String getCsvEscape() {
-return csvEscape;
-  }
-
-  public void setCsvEscape(String csvEscape) {
-this.csvEscape = csvEscape;
-  }
-
-  public String getCsvQuote() {
-return csvQuote;
-  }
-
-  public void setCsvQuote(String csvQuote) {
-this.csvQuote = csvQuote;
-  }
-
-  public Boolean getIsFirstRowHeader() {
-return isFirstRowHeader;
-  }
-
-  public void setIsFirstRowHeader(Boolean firstRowHeader) {
-isFirstRowHeader = firstRowHeader;
-  }
-
-  public String getInputFileType() {
-return inputFileType;
-  }
-
-  public void setInputFileType(String inputFileType) {
-this.inputFileType = inputFileType;
-  }
-
-  public String getHdfsPath() {
-return hdfsPath;
-  }
-
-  public void setHdfsPath(String hdfsPath) {
-this.hdfsPath = hdfsPath;
-  }
-
-  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;
-  }
-
-  @Override
-  public String toString() {
-return new StringBuilder("UploadFromHdfsInput{" )
-.append("isFirstRowHeader=").append( isFirstRowHeader )
-.append(", inputFileType='" ).append(inputFileType)
-.append(", hdfsPath='").append(hdfsPath)
-.append(", tableName='").append( tableName )
-.append(", databaseName='").append(databaseName )
-.append('}').toString();
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadService.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadService.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadService.java
deleted file mode 100644
index 2dceadf..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadService.java
+++ /dev/null
@@ -1,556 +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 

[21/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Utils.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Utils.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Utils.java
deleted file mode 100644
index 13f93c3..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Utils.java
+++ /dev/null
@@ -1,141 +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.
- */
-
-package org.apache.ambari.view.hive.client;
-
-import org.apache.hive.service.cli.thrift.TStatus;
-import org.apache.hive.service.cli.thrift.TStatusCode;
-import org.apache.http.client.CookieStore;
-import org.apache.http.cookie.Cookie;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class Utils {
-  // This value is set to true by the setServiceUnavailableRetryStrategy() 
when the server returns 401
-  static final String HIVE_SERVER2_RETRY_KEY = "hive.server2.retryserver";
-  static final String HIVE_SERVER2_RETRY_TRUE = "true";
-  static final String HIVE_SERVER2_RETRY_FALSE = "false";
-
-  static final String HIVE_COMPILE_ERROR_MSG = "Error while compiling 
statement:";
-
-  static void verifySuccess(TStatus status, String comment) throws 
HiveClientException {
-if (status.getStatusCode() != TStatusCode.SUCCESS_STATUS &&
-status.getStatusCode() != TStatusCode.SUCCESS_WITH_INFO_STATUS) {
-  String message = (status.getErrorMessage() != null) ? 
status.getErrorMessage() : "";
-
-  // For schemantic exception Error code is between 1-1
-  // https://issues.apache.org/jira/browse/HIVE-3001
-  // https://issues.apache.org/jira/browse/HIVE-12867
-  if((status.getErrorCode() >= 1 && status.getErrorCode() <= 1)|| 
message.contains(HIVE_COMPILE_ERROR_MSG)){
-throw new HiveInvalidQueryException(status.getStatusCode(),message);
-  }
-  throw new HiveErrorStatusException(status.getStatusCode(), comment + ". 
" + message);
-}
-  }
-
-  static boolean needToSendCredentials(CookieStore cookieStore, String 
cookieName, boolean isSSL) {
-if (cookieName == null || cookieStore == null) {
-  return true;
-}
-
-List cookies = cookieStore.getCookies();
-
-for (Cookie c : cookies) {
-  // If this is a secured cookie and the current connection is non-secured,
-  // then, skip this cookie. We need to skip this cookie because, the 
cookie
-  // replay will not be transmitted to the server.
-  if (c.isSecure() && !isSSL) {
-continue;
-  }
-  if (c.getName().equals(cookieName)) {
-return false;
-  }
-}
-return true;
-  }
-
-  /**
-   * Removes the empty strings and returns back only the strings with content
-   */
-  static String[] removeEmptyStrings(String[] strs) {
-List nonEmptyStrings = new ArrayList<>();
-for(String str : strs) {
-  if (!(str == null || str.trim().isEmpty())) {
-nonEmptyStrings.add(str.trim());
-  }
-}
-return nonEmptyStrings.toArray(new String[] {});
-  }
-
-  public static class HiveAuthenticationParams {
-public static final String AUTH_TYPE = "auth";
-// We're deprecating this variable's name.
-public static final String AUTH_QOP_DEPRECATED = "sasl.qop";
-public static final String AUTH_QOP = "saslQop";
-public static final String AUTH_SIMPLE = "noSasl";
-public static final String AUTH_TOKEN = "delegationToken";
-public static final String AUTH_USER = "user";
-public static final String HS2_PROXY_USER = "hive.server2.proxy.user";
-public static final String AUTH_PRINCIPAL = "principal";
-public static final String AUTH_PASSWD = "password";
-public static final String AUTH_KERBEROS_AUTH_TYPE = "kerberosAuthType";
-public static final String AUTH_KERBEROS_AUTH_TYPE_FROM_SUBJECT = 
"fromSubject";
-public static final String ANONYMOUS_USER = "anonymous";
-public static final String ANONYMOUS_PASSWD = "anonymous";
-public static final String USE_SSL = "ssl";
-public static final String SSL_TRUST_STORE = 

[19/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ProgressRetriever.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ProgressRetriever.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ProgressRetriever.java
deleted file mode 100644
index 6be8147..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ProgressRetriever.java
+++ /dev/null
@@ -1,67 +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.
- */
-
-package org.apache.ambari.view.hive.resources.jobs;
-
-import org.apache.ambari.view.hive.resources.jobs.atsJobs.TezVertexId;
-import org.apache.ambari.view.hive.resources.jobs.rm.RMParser;
-import org.apache.ambari.view.hive.resources.jobs.viewJobs.Job;
-import org.apache.ambari.view.hive.utils.ServiceFormattedException;
-import org.apache.ambari.view.hive.utils.SharedObjectsFactory;
-
-import java.util.List;
-import java.util.Map;
-
-public class ProgressRetriever {
-  private final Progress progress;
-  private final Job job;
-  private final SharedObjectsFactory sharedObjects;
-
-  public ProgressRetriever(Job job, SharedObjectsFactory sharedObjects) {
-this.job = job;
-this.sharedObjects = sharedObjects;
-
-this.progress = new Progress();
-  }
-
-  public Progress getProgress() {
-jobCheck();
-
-progress.dagProgress = sharedObjects.getRMParser().getDAGProgress(
-job.getApplicationId(), job.getDagId());
-
-List vertices = 
sharedObjects.getATSParser().getVerticesForDAGId(job.getDagId());
-progress.vertexProgresses = 
sharedObjects.getRMParser().getDAGVerticesProgress(job.getApplicationId(), 
job.getDagId(), vertices);
-
-return progress;
-  }
-
-  public void jobCheck() {
-if (job.getApplicationId() == null || job.getApplicationId().isEmpty()) {
-  throw new ServiceFormattedException("E070 ApplicationId is not defined 
yet");
-}
-if (job.getDagId() == null || job.getDagId().isEmpty()) {
-  throw new ServiceFormattedException("E080 DagID is not defined yet");
-}
-  }
-
-  public static class Progress {
-public Double dagProgress;
-public List vertexProgresses;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ResultsPaginationController.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ResultsPaginationController.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ResultsPaginationController.java
deleted file mode 100644
index cc2ff42..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ResultsPaginationController.java
+++ /dev/null
@@ -1,240 +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.
- */
-
-package org.apache.ambari.view.hive.resources.jobs;
-
-
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.hive.client.ColumnDescription;
-import org.apache.ambari.view.hive.client.HiveClientException;
-import org.apache.ambari.view.hive.client.Cursor;
-import org.apache.ambari.view.hive.utils.HiveClientFormattedException;
-import 

[06/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror.css
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror.css
 
b/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror.css
deleted file mode 100644
index 68c67b1..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror.css
+++ /dev/null
@@ -1,309 +0,0 @@
-/* BASICS */
-
-.CodeMirror {
-  /* Set height, width, borders, and global font properties here */
-  font-family: monospace;
-  height: 300px;
-}
-.CodeMirror-scroll {
-  /* Set scrolling behaviour here */
-  overflow: auto;
-}
-
-/* PADDING */
-
-.CodeMirror-lines {
-  padding: 4px 0; /* Vertical padding around content */
-}
-.CodeMirror pre {
-  padding: 0 4px; /* Horizontal padding of content */
-}
-
-.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
-  background-color: white; /* The little square between H and V scrollbars */
-}
-
-/* GUTTER */
-
-.CodeMirror-gutters {
-  border-right: 1px solid #ddd;
-  background-color: #f7f7f7;
-  white-space: nowrap;
-}
-.CodeMirror-linenumbers {}
-.CodeMirror-linenumber {
-  padding: 0 3px 0 5px;
-  min-width: 20px;
-  text-align: right;
-  color: #999;
-  -moz-box-sizing: content-box;
-  box-sizing: content-box;
-}
-
-.CodeMirror-guttermarker { color: black; }
-.CodeMirror-guttermarker-subtle { color: #999; }
-
-/* CURSOR */
-
-.CodeMirror div.CodeMirror-cursor {
-  border-left: 1px solid black;
-}
-/* Shown when moving in bi-directional text */
-.CodeMirror div.CodeMirror-secondarycursor {
-  border-left: 1px solid silver;
-}
-.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
-  width: auto;
-  border: 0;
-  background: #7e7;
-}
-.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursors {
-  z-index: 1;
-}
-
-.cm-animate-fat-cursor {
-  width: auto;
-  border: 0;
-  -webkit-animation: blink 1.06s steps(1) infinite;
-  -moz-animation: blink 1.06s steps(1) infinite;
-  animation: blink 1.06s steps(1) infinite;
-}
-@-moz-keyframes blink {
-  0% { background: #7e7; }
-  50% { background: none; }
-  100% { background: #7e7; }
-}
-@-webkit-keyframes blink {
-  0% { background: #7e7; }
-  50% { background: none; }
-  100% { background: #7e7; }
-}
-@keyframes blink {
-  0% { background: #7e7; }
-  50% { background: none; }
-  100% { background: #7e7; }
-}
-
-/* Can style cursor different in overwrite (non-insert) mode */
-div.CodeMirror-overwrite div.CodeMirror-cursor {}
-
-.cm-tab { display: inline-block; text-decoration: inherit; }
-
-.CodeMirror-ruler {
-  border-left: 1px solid #ccc;
-  position: absolute;
-}
-
-/* DEFAULT THEME */
-
-.cm-s-default .cm-keyword {color: #708;}
-.cm-s-default .cm-atom {color: #219;}
-.cm-s-default .cm-number {color: #164;}
-.cm-s-default .cm-def {color: #00f;}
-.cm-s-default .cm-variable,
-.cm-s-default .cm-punctuation,
-.cm-s-default .cm-property,
-.cm-s-default .cm-operator {}
-.cm-s-default .cm-variable-2 {color: #05a;}
-.cm-s-default .cm-variable-3 {color: #085;}
-.cm-s-default .cm-comment {color: #a50;}
-.cm-s-default .cm-string {color: #a11;}
-.cm-s-default .cm-string-2 {color: #f50;}
-.cm-s-default .cm-meta {color: #555;}
-.cm-s-default .cm-qualifier {color: #555;}
-.cm-s-default .cm-builtin {color: #30a;}
-.cm-s-default .cm-bracket {color: #997;}
-.cm-s-default .cm-tag {color: #170;}
-.cm-s-default .cm-attribute {color: #00c;}
-.cm-s-default .cm-header {color: blue;}
-.cm-s-default .cm-quote {color: #090;}
-.cm-s-default .cm-hr {color: #999;}
-.cm-s-default .cm-link {color: #00c;}
-
-.cm-negative {color: #d44;}
-.cm-positive {color: #292;}
-.cm-header, .cm-strong {font-weight: bold;}
-.cm-em {font-style: italic;}
-.cm-link {text-decoration: underline;}
-
-.cm-s-default .cm-error {color: #f00;}
-.cm-invalidchar {color: #f00;}
-
-/* Default styles for common addons */
-
-div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
-div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
-.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
-.CodeMirror-activeline-background {background: #e8f2ff;}
-
-/* STOP */
-
-/* The rest of this file contains styles related to the mechanics of
-   the editor. You probably shouldn't touch them. */
-
-.CodeMirror {
-  line-height: 1;
-  position: relative;
-  overflow: hidden;
-  background: white;
-  color: black;
-}
-
-.CodeMirror-scroll {
-  /* 30px is the magic margin used to hide the element's real scrollbars */
-  /* See overflow: hidden in .CodeMirror */
-  margin-bottom: -30px; margin-right: -30px;
-  padding-bottom: 30px;
-  height: 100%;
-  outline: none; /* Prevent dragging from highlighting the element */
-  position: relative;
-  -moz-box-sizing: content-box;
-  box-sizing: content-box;
-}
-.CodeMirror-sizer {
-  position: relative;
-  border-right: 30px solid transparent;
-  

[03/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/jobs/ATSParserTest.java
--
diff --git 
a/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/jobs/ATSParserTest.java
 
b/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/jobs/ATSParserTest.java
deleted file mode 100644
index 43b0b65..000
--- 
a/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/jobs/ATSParserTest.java
+++ /dev/null
@@ -1,512 +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.
- */
-
-package org.apache.ambari.view.hive.resources.jobs;
-
-import org.apache.ambari.view.hive.resources.jobs.atsJobs.ATSParser;
-import org.apache.ambari.view.hive.resources.jobs.atsJobs.ATSRequestsDelegate;
-import org.apache.ambari.view.hive.resources.jobs.atsJobs.HiveQueryId;
-import org.apache.ambari.view.hive.resources.jobs.atsJobs.IATSParser;
-import org.apache.ambari.view.hive.resources.jobs.atsJobs.TezDagId;
-import org.apache.commons.codec.binary.Base64;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.junit.Assert;
-import org.junit.Test;
-import sun.reflect.generics.reflectiveObjects.NotImplementedException;
-
-import java.util.Arrays;
-import java.util.List;
-
-public class ATSParserTest {
-  @Test
-  public void testBase64() throws Exception {
-
System.out.println(Arrays.toString(Base64.decodeBase64("HWvpjKiERZCy_le4s-odOQ")));
-  }
-
-  @Test
-  public void testGetHiveJobsList() throws Exception {
-IATSParser jobLoader = new ATSParser(new ATSRequestsDelegateStub());
-
-List jobs = jobLoader.getHiveQueryIdsForUser("hive");
-
-Assert.assertEquals(1, jobs.size());
-
-HiveQueryId job = jobs.get(0);
-
Assert.assertEquals("hive_20150209144848_c3a5a07b-c3b6-4f57-a6d5-3dadecdd6fd0", 
job.entity);
-Assert.assertEquals(1423493324355L, job.starttime);
-Assert.assertEquals("hive", job.user);
-Assert.assertEquals((1423493342843L - 1423493324355L) / 1000L, 
job.duration);
-Assert.assertEquals("select count(*) from z", job.query);
-
-Assert.assertEquals(1, job.dagNames.size());
-
Assert.assertEquals("hive_20150209144848_c3a5a07b-c3b6-4f57-a6d5-3dadecdd6fd0:4",
 job.dagNames.get(0));
-
-Assert.assertEquals(2, job.stages.size());
-Assert.assertTrue(HiveQueryId.ATS_15_RESPONSE_VERSION > job.version);
-
-jobLoader = new ATSParser(new ATSV15RequestsDelegateStub());
-List jobsv2 = jobLoader.getHiveQueryIdsForUser("hive");
-Assert.assertEquals(1, jobsv2.size());
-HiveQueryId jobv2 = jobsv2.get(0);
-Assert.assertTrue(HiveQueryId.ATS_15_RESPONSE_VERSION <= jobv2.version);
-  }
-
-  @Test
-  public void testGetTezDAGByName() throws Exception {
-IATSParser jobLoader = new ATSParser(new ATSRequestsDelegateStub());
-
-TezDagId tezDag = 
jobLoader.getTezDAGByName("hive_20150209144848_c3a5a07b-c3b6-4f57-a6d5-3dadecdd6fd0:4");
-
-Assert.assertEquals("dag_1423156117563_0005_2", tezDag.entity);
-Assert.assertEquals("application_1423156117563_0005", 
tezDag.applicationId);
-Assert.assertEquals("SUCCEEDED", tezDag.status);
-  }
-
-  @Test
-  public void testGetTezDagByEntity() throws Exception {
-IATSParser jobLoader = new ATSParser(new ATSV15RequestsDelegateStub());
-
-TezDagId tezDag = 
jobLoader.getTezDAGByEntity("hive_20150209144848_c3a5a07b-c3b6-4f57-a6d5-3dadecdd6fd0:4");
-
-Assert.assertEquals("dag_1423156117563_0005_2", tezDag.entity);
-Assert.assertEquals("application_1423156117563_0005", 
tezDag.applicationId);
-Assert.assertEquals("SUCCEEDED", tezDag.status);
-  }
-
-  protected static class ATSV15RequestsDelegateStub extends 
ATSRequestsDelegateStub {
-/**
- * This returns the version field that the ATS v1.5 returns.
- */
-@Override
-public JSONObject hiveQueryIdsForUser(String username) {
-  return (JSONObject) JSONValue.parse(
-"{ \"entities\" : [ { \"domain\" : \"DEFAULT\",\n" +
-  "\"entity\" : 
\"hive_20150209144848_c3a5a07b-c3b6-4f57-a6d5-3dadecdd6fd0\",\n" +
-  "\"entitytype\" : 

[10/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/modal-save.hbs
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/modal-save.hbs
 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/modal-save.hbs
deleted file mode 100644
index 8d83f2b..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/modal-save.hbs
+++ /dev/null
@@ -1,21 +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.
-}}
-
-{{#modal-widget heading=heading close="close" ok="save"}}
-  {{input type=type class="form-control"  value=text }}
-{{/modal-widget}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/notification.hbs
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/notification.hbs
 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/notification.hbs
deleted file mode 100644
index 35c2fe1..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/notification.hbs
+++ /dev/null
@@ -1,23 +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.
-}}
-
-
-  
-  
-  {{view.notification.message}}
-

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/open-queries.hbs
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/open-queries.hbs
 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/open-queries.hbs
deleted file mode 100644
index 6d6f0dc..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/open-queries.hbs
+++ /dev/null
@@ -1,23 +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.
-}}
-
-{{#tabs-widget tabs=queryTabs removeClicked="removeQueryTab" canRemove=true 
onActiveTitleClick="changeTabTitle"}}
-  {{outlet 'overlay'}}
-  {{query-editor tables=selectedTables query=currentQuery.fileContent 
editor=view.editor highlightedText=highlightedText
- columnsNeeded="getColumnsForAutocomplete"}}
-{{/tabs-widget}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/queries.hbs
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/templates/queries.hbs 

[23/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in 
pom.xml files (nitirajrathore)


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

Branch: refs/heads/trunk
Commit: e423a65e5deca78d8068216a273d9d89d37756c9
Parents: 0bade7c
Author: Nitiraj Rathore 
Authored: Wed Dec 28 00:02:36 2016 +0530
Committer: Nitiraj Rathore 
Committed: Wed Dec 28 15:01:52 2016 +0530

--
 contrib/views/hive/pom.xml  | 386 
 .../apache/ambari/view/hive/BaseService.java|  54 --
 .../apache/ambari/view/hive/HelpService.java| 132 ---
 .../apache/ambari/view/hive/HiveViewImpl.java   |  50 -
 .../ambari/view/hive/PropertyValidator.java | 113 ---
 .../org/apache/ambari/view/hive/TestBean.java   |  36 -
 .../backgroundjobs/BackgroundJobController.java |  90 --
 .../view/hive/client/ColumnDescription.java |  48 -
 .../hive/client/ColumnDescriptionExtended.java  | 103 --
 .../hive/client/ColumnDescriptionShort.java |  72 --
 .../ambari/view/hive/client/Connection.java | 740 --
 .../view/hive/client/ConnectionFactory.java | 166 
 .../apache/ambari/view/hive/client/Cursor.java  | 243 -
 .../ambari/view/hive/client/DDLDelegator.java   | 140 ---
 .../view/hive/client/HiveAuthCredentials.java   |  31 -
 .../hive/client/HiveAuthRequiredException.java  |  27 -
 .../ambari/view/hive/client/HiveCall.java   | 120 ---
 .../client/HiveClientAuthRequiredException.java |  25 -
 .../view/hive/client/HiveClientException.java   |  25 -
 .../hive/client/HiveClientRuntimeException.java |  25 -
 .../hive/client/HiveErrorStatusException.java   |  30 -
 .../hive/client/HiveInvalidQueryException.java  |  27 -
 .../hive/client/HttpBasicAuthInterceptor.java   |  55 --
 .../client/HttpKerberosRequestInterceptor.java  |  72 --
 .../hive/client/HttpRequestInterceptorBase.java |  88 --
 .../ambari/view/hive/client/LogsCursor.java |  36 -
 .../org/apache/ambari/view/hive/client/Row.java |  74 --
 .../view/hive/client/UserLocalConnection.java   |  48 -
 .../client/UserLocalHiveAuthCredentials.java|  33 -
 .../apache/ambari/view/hive/client/Utils.java   | 141 ---
 .../view/hive/client/ViewSessionState.java  |  32 -
 .../view/hive/persistence/DataStoreStorage.java | 142 ---
 .../view/hive/persistence/IStorageFactory.java  |  23 -
 .../persistence/InstanceKeyValueStorage.java| 135 ---
 .../view/hive/persistence/KeyValueStorage.java  | 163 
 .../hive/persistence/LocalKeyValueStorage.java  |  73 --
 .../persistence/PersistentConfiguration.java|  52 -
 .../ambari/view/hive/persistence/Storage.java   |  77 --
 .../utils/ContextConfigurationAdapter.java  | 260 -
 .../persistence/utils/FilteringStrategy.java|  32 -
 .../view/hive/persistence/utils/Indexed.java|  36 -
 .../hive/persistence/utils/ItemNotFound.java|  43 -
 .../utils/OnlyOwnersFilteringStrategy.java  |  38 -
 .../view/hive/persistence/utils/Owned.java  |  36 -
 .../persistence/utils/PersonalResource.java |  22 -
 .../hive/persistence/utils/StorageFactory.java  |  69 --
 .../hive/resources/CRUDResourceManager.java | 131 ---
 .../view/hive/resources/IResourceManager.java   |  37 -
 .../resources/PersonalCRUDResourceManager.java  |  99 --
 .../resources/SharedCRUDResourceManager.java|  44 -
 .../resources/browser/HiveBrowserService.java   | 276 --
 .../view/hive/resources/files/FileResource.java |  70 --
 .../view/hive/resources/files/FileService.java  | 266 -
 .../view/hive/resources/jobs/Aggregator.java| 417 
 .../resources/jobs/ConnectionController.java|  74 --
 .../hive/resources/jobs/FileResourceShort.java  |  55 --
 .../jobs/IOperationHandleResourceManager.java   |  40 -
 .../resources/jobs/JobResourceProvider.java | 113 ---
 .../view/hive/resources/jobs/JobService.java| 609 
 .../view/hive/resources/jobs/LogParser.java | 139 ---
 .../jobs/ModifyNotificationDelegate.java|  23 -
 .../ModifyNotificationInvocationHandler.java|  40 -
 .../jobs/NoOperationStatusSetException.java |  23 -
 .../jobs/OperationHandleController.java | 135 ---
 .../jobs/OperationHandleControllerFactory.java  |  43 -
 .../jobs/OperationHandleResourceManager.java| 120 ---
 .../hive/resources/jobs/ProgressRetriever.java  |  67 --
 .../jobs/ResultsPaginationController.java   | 240 -
 .../resources/jobs/StoredOperationHandle.java   | 146 ---
 .../hive/resources/jobs/atsJobs/ATSParser.java  | 248 -
 .../jobs/atsJobs/ATSParserFactory.java  |  45 -
 .../jobs/atsJobs/ATSRequestsDelegate.java   |  47 -
 .../jobs/atsJobs/ATSRequestsDelegateImpl.java   | 175 

[01/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
Repository: ambari
Updated Branches:
  refs/heads/trunk 0bade7ced -> e423a65e5


http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/upload/OpenCSVTest.java
--
diff --git 
a/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/upload/OpenCSVTest.java
 
b/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/upload/OpenCSVTest.java
deleted file mode 100644
index 0bdf5cf..000
--- 
a/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/upload/OpenCSVTest.java
+++ /dev/null
@@ -1,259 +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.
- */
-
-package org.apache.ambari.view.hive.resources.upload;
-
-import com.opencsv.CSVParser;
-import com.opencsv.CSVReader;
-import com.opencsv.CSVWriter;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.io.StringWriter;
-
-public class OpenCSVTest {
-
-  /**
-   * no exception in creating csvParser with emtpy stream
-   *
-   * @throws IOException
-   */
-  @Test
-  public void testEmptyStream() throws Exception {
-String csv = "";
-
-CSVParser jp = new CSVParser();
-String[] columns = jp.parseLine(csv);
-Assert.assertEquals("Should detect one column.", 1, columns.length);
-Assert.assertEquals("Should detect one column with empty value.", new 
String[]{""}, columns);
-  }
-
-  /**
-   * in case of csv an empty line is still considered as row
-   *
-   * @throws IOException
-   */
-  @Test
-  public void testEmptyRow() throws Exception {
-String csv = "   ";
-CSVParser jp = new CSVParser();
-
-String[] columns = jp.parseLine(csv);
-Assert.assertEquals("One column not detected.", 1, columns.length);
-Assert.assertArrayEquals("Row should not be empty", new String[]{"   
"}, columns);
-  }
-
-  @Test
-  public void testParse1Row() throws Exception {
-String csv = "value1,c,10,10.1";
-
-String[] cols = csv.split(",");
-CSVParser jp = new CSVParser();
-String[] columns = jp.parseLine(csv);
-Assert.assertEquals("4 columns not detect", 4, columns.length);
-Assert.assertArrayEquals("Row not equal!", cols, columns);
-  }
-
-  @Test
-  public void testParseMultipleRow() throws Exception {
-
-String csv = "value1,c,10,10.1\n" +
-  "value2,c2,102,true";
-
-try(
-  StringReader sr = new StringReader(csv);
-  CSVReader csvReader = new CSVReader(sr,',','"','\\');
-) {
-  String[] row1 = csvReader.readNext();
-  String[] row2 = csvReader.readNext();
-
-  Assert.assertArrayEquals("Failed to match 1st row!",new 
String[]{"value1", "c", "10", "10.1"}, row1);
-
-  Assert.assertArrayEquals("Failed to match 2nd row!",new 
String[]{"value2", "c2", "102", "true"}, row2);
-}
-  }
-
-  @Test
-  public void testParseCustomSeparator() throws Exception {
-
-String csv = "value1#c#10#10.1\n" +
-  "value2#c2#102#true";
-
-try(
-  StringReader sr = new StringReader(csv);
-  CSVReader csvReader = new CSVReader(sr,'#','"','\\');
-) {
-  String[] row1 = csvReader.readNext();
-  String[] row2 = csvReader.readNext();
-
-  Assert.assertArrayEquals("Failed to match 1st row!",new 
String[]{"value1", "c", "10", "10.1"}, row1);
-
-  Assert.assertArrayEquals("Failed to match 2nd row!",new 
String[]{"value2", "c2", "102", "true"}, row2);
-}
-  }
-
-
-  @Test
-  public void testParseCustomSeparatorAndQuote() throws Exception {
-
-String csv = "\"valu#e1\"#c#10#10.1\n" +
-  "value2#c2#102#true";
-
-try(
-  StringReader sr = new StringReader(csv);
-  CSVReader csvReader = new CSVReader(sr,'#','"','\\');
-) {
-  String[] row1 = csvReader.readNext();
-  String[] row2 = csvReader.readNext();
-
-  Assert.assertArrayEquals("Failed to match 1st row!",new 
String[]{"valu#e1", "c", "10", "10.1"}, row1);
-
-  Assert.assertArrayEquals("Failed to match 2nd row!",new 
String[]{"value2", "c2", "102", "true"}, row2);
-}
-  }
-
-  @Test
-  public void testMultipleEscape() throws Exception {
-
-String 

[05/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/vendor/dagre.min.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/vendor/dagre.min.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/vendor/dagre.min.js
deleted file mode 100644
index 10a0471..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/vendor/dagre.min.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * @license
- * Copyright (c) 2012-2014 Chris Pettitt
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof 
require=="function"&if(!u&)return a(o,!0);if(i)return i(o,!0);var 
f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var 
l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return 
s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof 
require=="function"&for(var o=0;o

[15/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/components/input-header.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/input-header.js
 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/input-header.js
deleted file mode 100644
index 7ff5bf7..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/input-header.js
+++ /dev/null
@@ -1,61 +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.
- */
-
-import Ember from 'ember';
-
-export default Ember.Component.extend({
-  tagName: '',
-  dataTypes: null,
-  column: null,
-  precisionChanged: Ember.observer('column.precision', function () {
-var col = this.get('column');
-if( typeof col.precision !== 'number') {
-Ember.set(col, 'precision', Number(col.precision));
-  }
-  }),
-
-  scaleChanged: Ember.observer('column.scale', function () {
-var col = this.get('column');
-if( typeof col.scale !== 'number'){
-  Ember.set(col,'scale',Number(col.scale));
-}
-  }),
-
-  typeChanged: Ember.observer('column.type', function () {
-var col = this.get('column');
-
-var type = col.type;
-if( type != "DECIMAL" ){
-  Ember.set(col,'scale');
-}
-
-if(type != "VARCHAR" && type != "CHAR" && type != "DECIMAL" ){
-  Ember.set(col,'precision');
-}
-  }),
-
-  noPrecision: Ember.computed('column.type', function () {
-var type = this.get('column').type;
-return (type == "VARCHAR" || type == "CHAR" || type == "DECIMAL" ) ? false 
: true;
-  }),
-
-  noScale: Ember.computed('column.type', function () {
-return this.get('column').type == "DECIMAL" ? false : true;
-  })
-
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/components/job-tr-view.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/job-tr-view.js
 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/job-tr-view.js
deleted file mode 100644
index f439ca2..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/job-tr-view.js
+++ /dev/null
@@ -1,41 +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.
- */
-
-import Ember from 'ember';
-import constants from 'hive/utils/constants';
-import utils from 'hive/utils/functions';
-
-export default Ember.Component.extend({
-  tagName: '',
-
-  canStop: function () {
-return utils.insensitiveCompare(this.get('job.status'), 
constants.statuses.running, constants.statuses.initialized, 
constants.statuses.pending);
-  }.property('job.status'),
-
-  actions: {
-requestFile: function () {
-  this.toggleProperty('expanded');
-
-  this.sendAction('onFileRequested', this.get('job'));
-},
-
-stopJob: function () {
-  this.sendAction('onStopJob', this.get('job'));
-}
-  }
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/components/modal-widget.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/modal-widget.js
 

[16/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java
deleted file mode 100644
index 4edc82c..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java
+++ /dev/null
@@ -1,100 +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.
- */
-
-package org.apache.ambari.view.hive.resources.uploads.parsers.xml;
-
-import org.apache.ambari.view.hive.client.Row;
-import org.apache.ambari.view.hive.resources.uploads.parsers.ParseOptions;
-import org.apache.ambari.view.hive.resources.uploads.parsers.Parser;
-import org.apache.ambari.view.hive.resources.uploads.parsers.RowIterator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * assumes XML of following format
- * 
- * 
- * row1-col1-Data
- * row1-col2-Data
- * row1-col3-Data
- * row1-col4-Data
- * 
- * 
- * row2-col1-Data
- * row2-col2-Data
- * row2-col3-Data
- * row2-col4-Data
- * 
- * 
- */
-public class XMLParser extends Parser {
-
-  protected final static Logger LOG =
-  LoggerFactory.getLogger(XMLParser.class);
-
-  private RowIterator iterator;
-  private XMLEventReader xmlReader;
-  private XMLIterator xmlIterator;
-
-  public XMLParser(Reader reader, ParseOptions parseOptions) throws 
IOException {
-super(reader, parseOptions);
-XMLInputFactory factory = XMLInputFactory.newInstance();
-try {
-  this.xmlReader = factory.createXMLEventReader(reader);
-} catch (XMLStreamException e) {
-  LOG.error("error occurred while creating xml reader : ", e);
-  throw new IOException("error occurred while creating xml reader : ", e);
-}
-xmlIterator = new XMLIterator(this.xmlReader);
-iterator = new RowIterator(xmlIterator);
-  }
-
-  @Override
-  public Row extractHeader() {
-Collection headers = this.iterator.extractHeaders();
-Object[] objs = new Object[headers.size()];
-Iterator iterator = headers.iterator();
-for (int i = 0; i < headers.size(); i++) {
-  objs[i] = iterator.next();
-}
-
-return new Row(objs);
-  }
-
-  @Override
-  public void close() throws Exception {
-try {
-  this.xmlReader.close();
-} catch (XMLStreamException e) {
-  throw new IOException(e);
-}
-  }
-
-  @Override
-  public Iterator iterator() {
-return iterator;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java
deleted file mode 100644
index 1fe30fd..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java
+++ /dev/null
@@ -1,48 +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 

[11/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/dropdown-submenu.scss
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/dropdown-submenu.scss
 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/dropdown-submenu.scss
deleted file mode 100644
index bab2216..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/dropdown-submenu.scss
+++ /dev/null
@@ -1,65 +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.
- */
-
-.dropdown-submenu {
-position:relative;
-}
-
-.dropdown-submenu>.dropdown-menu {
-top:0;
-left:100%;
-margin-top:-6px;
-margin-left:-1px;
--webkit-border-radius:0 6px 6px 6px;
--moz-border-radius:0 6px 6px 6px;
-border-radius:0 6px 6px 6px;
-}
-
-.dropdown-submenu:hover>.dropdown-menu {
-display:block;
-}
-
-.dropdown-submenu>a:after {
-display:block;
-content:" ";
-float:right;
-width:0;
-height:0;
-border-color:transparent;
-border-style:solid;
-border-width:5px 0 5px 5px;
-border-left-color:#cc;
-margin-top:5px;
-margin-right:-10px;
-}
-
-.dropdown-submenu:hover>a:after {
-border-left-color:#ff;
-}
-
-.dropdown-submenu.pull-left {
-float:none;
-}
-
-.dropdown-submenu.pull-left>.dropdown-menu {
-left:-100%;
-margin-left:10px;
--webkit-border-radius:6px 0 6px 6px;
--moz-border-radius:6px 0 6px 6px;
-border-radius:6px 0 6px 6px;
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/mixins.scss
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/mixins.scss 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/mixins.scss
deleted file mode 100644
index acaa386..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/mixins.scss
+++ /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.
-*/
-
-@mixin box-shadow($horizontal, $vertical, $blur, $color) {
-  -webkit-box-shadow: $horizontal $vertical $blur $color;
- -moz-box-shadow: $horizontal $vertical $blur $color;
-  box-shadow: $horizontal $vertical $blur $color;
-}
-
-@mixin animate-width($time) {
-  -webkit-transition: $time;
-  transition: width $time;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/notifications.scss
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/notifications.scss
 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/notifications.scss
deleted file mode 100644
index 166056b..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/notifications.scss
+++ /dev/null
@@ -1,37 +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 

[12/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file-resource.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file-resource.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file-resource.js
deleted file mode 100644
index 47f4911..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file-resource.js
+++ /dev/null
@@ -1,25 +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.
- */
-
-import DS from 'ember-data';
-
-export default DS.Model.extend({
-  name: DS.attr(),
-  path: DS.attr(),
-  owner: DS.attr()
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file.js
deleted file mode 100644
index c13d4e1..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/models/file.js
+++ /dev/null
@@ -1,26 +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.
- */
-
-import DS from 'ember-data';
-
-export default DS.Model.extend({
-  fileContent: DS.attr(),
-  hasNext: DS.attr(),
-  page: DS.attr('number'),
-  pageCount: DS.attr()
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/app/models/job.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/models/job.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/models/job.js
deleted file mode 100644
index 185f512..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/models/job.js
+++ /dev/null
@@ -1,55 +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.
- */
-
-import DS from 'ember-data';
-
-export default DS.Model.extend({
-  title: DS.attr('string'),
-  queryId: DS.attr(),
-  hiveQueryId: DS.attr('string'),
-  queryFile: DS.attr('string'),
-  owner: DS.attr('string'),
-  dataBase: DS.attr('string'),
-  duration: DS.attr(),
-  status: DS.attr('string'),
-  statusMessage: DS.attr('string'),
-  dateSubmitted: DS.attr('date'),
-  forcedContent: DS.attr('string'),
-  logFile: DS.attr('string'),
-  dagName:  DS.attr('string'),
-  dagId: DS.attr('string'),
-  sessionTag: DS.attr('string'),
-  page: DS.attr(),
-  statusDir: DS.attr('string'),
-  applicationId: DS.attr(),
-  referrer: DS.attr('string'),
-  

[18/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/viewJobs/JobImpl.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/viewJobs/JobImpl.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/viewJobs/JobImpl.java
deleted file mode 100644
index c099cae..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/viewJobs/JobImpl.java
+++ /dev/null
@@ -1,323 +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.
- */
-
-package org.apache.ambari.view.hive.resources.jobs.viewJobs;
-
-import org.apache.commons.beanutils.PropertyUtils;
-
-import java.beans.Transient;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
-
-/**
- * Bean to represent saved query
- */
-public class JobImpl implements Job {
-  private String title = null;
-  private String queryFile = null;
-  private String statusDir = null;
-  private Long dateSubmitted = 0L;
-  private Long duration = 0L;
-  private String forcedContent = null;
-  private String dataBase = null;
-  private String queryId = null;
-
-  private String status = JOB_STATE_UNKNOWN;
-  private String statusMessage = null;
-  private String sqlState = null;
-
-  private String applicationId;
-  private String dagId;
-  private String dagName;
-
-  private String sessionTag;
-  private String referrer;
-  private String globalSettings;
-
-  private String id = null;
-  private String owner = null;
-
-  private String logFile;
-  private String confFile;
-
-  private String hiveQueryId;
-
-  public JobImpl() {}
-  public JobImpl(Map stringObjectMap) throws 
InvocationTargetException, IllegalAccessException {
-for (Map.Entry entry : stringObjectMap.entrySet())  {
-  try {
-PropertyUtils.setProperty(this, entry.getKey(), entry.getValue());
-  } catch (NoSuchMethodException e) {
-//do nothing, skip
-  }
-}
-  }
-
-  @Override
-  public boolean equals(Object o) {
-if (this == o) return true;
-if (!(o instanceof Job)) return false;
-
-JobImpl job = (JobImpl) o;
-
-return id != null ? id.equals(job.id) : job.id == null;
-
-  }
-
-  @Override
-  public int hashCode() {
-return id != null ? id.hashCode() : 0;
-  }
-
-  @Override
-  @Transient
-  public String getHiveQueryId() {
-return hiveQueryId;
-  }
-
-  @Override
-  @Transient
-  public void setHiveQueryId(String hiveQueryId) {
-this.hiveQueryId = hiveQueryId;
-  }
-
-  @Override
-  public String getId() {
-return id;
-  }
-
-  @Override
-  public void setId(String id) {
-this.id = id;
-  }
-
-  @Override
-  public String getOwner() {
-return owner;
-  }
-
-  @Override
-  public void setOwner(String owner) {
-this.owner = owner;
-  }
-
-  @Override
-  public String getTitle() {
-return title;
-  }
-
-  @Override
-  public void setTitle(String title) {
-this.title = title;
-  }
-
-  @Override
-  public String getQueryFile() {
-return queryFile;
-  }
-
-  @Override
-  public void setQueryFile(String queryFile) {
-this.queryFile = queryFile;
-  }
-
-  @Override
-  public Long getDateSubmitted() {
-return dateSubmitted;
-  }
-
-  @Override
-  public void setDateSubmitted(Long dateSubmitted) {
-this.dateSubmitted = dateSubmitted;
-  }
-
-  @Override
-  public Long getDuration() {
-return duration;
-  }
-
-  @Override
-  public void setDuration(Long duration) {
-this.duration = duration;
-  }
-
-  @Override
-  public String getStatus() {
-return status;
-  }
-
-  @Override
-  public void setStatus(String status) {
-this.status = status;
-  }
-
-  @Override
-  @Transient
-  public String getForcedContent() {
-return forcedContent;
-  }
-
-  @Override
-  @Transient
-  public void setForcedContent(String forcedContent) {
-this.forcedContent = forcedContent;
-  }
-
-  @Override
-  public String getQueryId() {
-return queryId;
-  }
-
-  @Override
-  public void setQueryId(String queryId) {
-this.queryId = queryId;
-  }
-
-  @Override
- 

[03/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/jobs/ATSParserTest.java
--
diff --git 
a/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/jobs/ATSParserTest.java
 
b/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/jobs/ATSParserTest.java
deleted file mode 100644
index 43b0b65..000
--- 
a/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/jobs/ATSParserTest.java
+++ /dev/null
@@ -1,512 +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.
- */
-
-package org.apache.ambari.view.hive.resources.jobs;
-
-import org.apache.ambari.view.hive.resources.jobs.atsJobs.ATSParser;
-import org.apache.ambari.view.hive.resources.jobs.atsJobs.ATSRequestsDelegate;
-import org.apache.ambari.view.hive.resources.jobs.atsJobs.HiveQueryId;
-import org.apache.ambari.view.hive.resources.jobs.atsJobs.IATSParser;
-import org.apache.ambari.view.hive.resources.jobs.atsJobs.TezDagId;
-import org.apache.commons.codec.binary.Base64;
-import org.json.simple.JSONObject;
-import org.json.simple.JSONValue;
-import org.junit.Assert;
-import org.junit.Test;
-import sun.reflect.generics.reflectiveObjects.NotImplementedException;
-
-import java.util.Arrays;
-import java.util.List;
-
-public class ATSParserTest {
-  @Test
-  public void testBase64() throws Exception {
-
System.out.println(Arrays.toString(Base64.decodeBase64("HWvpjKiERZCy_le4s-odOQ")));
-  }
-
-  @Test
-  public void testGetHiveJobsList() throws Exception {
-IATSParser jobLoader = new ATSParser(new ATSRequestsDelegateStub());
-
-List jobs = jobLoader.getHiveQueryIdsForUser("hive");
-
-Assert.assertEquals(1, jobs.size());
-
-HiveQueryId job = jobs.get(0);
-
Assert.assertEquals("hive_20150209144848_c3a5a07b-c3b6-4f57-a6d5-3dadecdd6fd0", 
job.entity);
-Assert.assertEquals(1423493324355L, job.starttime);
-Assert.assertEquals("hive", job.user);
-Assert.assertEquals((1423493342843L - 1423493324355L) / 1000L, 
job.duration);
-Assert.assertEquals("select count(*) from z", job.query);
-
-Assert.assertEquals(1, job.dagNames.size());
-
Assert.assertEquals("hive_20150209144848_c3a5a07b-c3b6-4f57-a6d5-3dadecdd6fd0:4",
 job.dagNames.get(0));
-
-Assert.assertEquals(2, job.stages.size());
-Assert.assertTrue(HiveQueryId.ATS_15_RESPONSE_VERSION > job.version);
-
-jobLoader = new ATSParser(new ATSV15RequestsDelegateStub());
-List jobsv2 = jobLoader.getHiveQueryIdsForUser("hive");
-Assert.assertEquals(1, jobsv2.size());
-HiveQueryId jobv2 = jobsv2.get(0);
-Assert.assertTrue(HiveQueryId.ATS_15_RESPONSE_VERSION <= jobv2.version);
-  }
-
-  @Test
-  public void testGetTezDAGByName() throws Exception {
-IATSParser jobLoader = new ATSParser(new ATSRequestsDelegateStub());
-
-TezDagId tezDag = 
jobLoader.getTezDAGByName("hive_20150209144848_c3a5a07b-c3b6-4f57-a6d5-3dadecdd6fd0:4");
-
-Assert.assertEquals("dag_1423156117563_0005_2", tezDag.entity);
-Assert.assertEquals("application_1423156117563_0005", 
tezDag.applicationId);
-Assert.assertEquals("SUCCEEDED", tezDag.status);
-  }
-
-  @Test
-  public void testGetTezDagByEntity() throws Exception {
-IATSParser jobLoader = new ATSParser(new ATSV15RequestsDelegateStub());
-
-TezDagId tezDag = 
jobLoader.getTezDAGByEntity("hive_20150209144848_c3a5a07b-c3b6-4f57-a6d5-3dadecdd6fd0:4");
-
-Assert.assertEquals("dag_1423156117563_0005_2", tezDag.entity);
-Assert.assertEquals("application_1423156117563_0005", 
tezDag.applicationId);
-Assert.assertEquals("SUCCEEDED", tezDag.status);
-  }
-
-  protected static class ATSV15RequestsDelegateStub extends 
ATSRequestsDelegateStub {
-/**
- * This returns the version field that the ATS v1.5 returns.
- */
-@Override
-public JSONObject hiveQueryIdsForUser(String username) {
-  return (JSONObject) JSONValue.parse(
-"{ \"entities\" : [ { \"domain\" : \"DEFAULT\",\n" +
-  "\"entity\" : 
\"hive_20150209144848_c3a5a07b-c3b6-4f57-a6d5-3dadecdd6fd0\",\n" +
-  "\"entitytype\" : 

[17/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadFromHdfsInput.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadFromHdfsInput.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadFromHdfsInput.java
deleted file mode 100644
index af20aff..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadFromHdfsInput.java
+++ /dev/null
@@ -1,130 +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.
- */
-
-package org.apache.ambari.view.hive.resources.uploads;
-
-import java.io.Serializable;
-import java.util.List;
-
-public class UploadFromHdfsInput implements Serializable{
-  private Boolean isFirstRowHeader = Boolean.FALSE;
-  private String inputFileType;
-  private String hdfsPath;
-  private String tableName;
-  private String databaseName;
-  private List header;
-  private boolean containsEndlines;
-
-  private String csvDelimiter;
-  private String csvEscape;
-  private String csvQuote;
-
-  public UploadFromHdfsInput() {
-  }
-
-  public String getCsvDelimiter() {
-return csvDelimiter;
-  }
-
-  public List getHeader() {
-return header;
-  }
-
-  public void setHeader(List header) {
-this.header = header;
-  }
-
-  public boolean isContainsEndlines() {
-return containsEndlines;
-  }
-
-  public void setContainsEndlines(boolean containsEndlines) {
-this.containsEndlines = containsEndlines;
-  }
-
-  public void setCsvDelimiter(String csvDelimiter) {
-this.csvDelimiter = csvDelimiter;
-  }
-
-  public String getCsvEscape() {
-return csvEscape;
-  }
-
-  public void setCsvEscape(String csvEscape) {
-this.csvEscape = csvEscape;
-  }
-
-  public String getCsvQuote() {
-return csvQuote;
-  }
-
-  public void setCsvQuote(String csvQuote) {
-this.csvQuote = csvQuote;
-  }
-
-  public Boolean getIsFirstRowHeader() {
-return isFirstRowHeader;
-  }
-
-  public void setIsFirstRowHeader(Boolean firstRowHeader) {
-isFirstRowHeader = firstRowHeader;
-  }
-
-  public String getInputFileType() {
-return inputFileType;
-  }
-
-  public void setInputFileType(String inputFileType) {
-this.inputFileType = inputFileType;
-  }
-
-  public String getHdfsPath() {
-return hdfsPath;
-  }
-
-  public void setHdfsPath(String hdfsPath) {
-this.hdfsPath = hdfsPath;
-  }
-
-  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;
-  }
-
-  @Override
-  public String toString() {
-return new StringBuilder("UploadFromHdfsInput{" )
-.append("isFirstRowHeader=").append( isFirstRowHeader )
-.append(", inputFileType='" ).append(inputFileType)
-.append(", hdfsPath='").append(hdfsPath)
-.append(", tableName='").append( tableName )
-.append(", databaseName='").append(databaseName )
-.append('}').toString();
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadService.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadService.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadService.java
deleted file mode 100644
index 2dceadf..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/UploadService.java
+++ /dev/null
@@ -1,556 +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 

[21/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Utils.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Utils.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Utils.java
deleted file mode 100644
index 13f93c3..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Utils.java
+++ /dev/null
@@ -1,141 +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.
- */
-
-package org.apache.ambari.view.hive.client;
-
-import org.apache.hive.service.cli.thrift.TStatus;
-import org.apache.hive.service.cli.thrift.TStatusCode;
-import org.apache.http.client.CookieStore;
-import org.apache.http.cookie.Cookie;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class Utils {
-  // This value is set to true by the setServiceUnavailableRetryStrategy() 
when the server returns 401
-  static final String HIVE_SERVER2_RETRY_KEY = "hive.server2.retryserver";
-  static final String HIVE_SERVER2_RETRY_TRUE = "true";
-  static final String HIVE_SERVER2_RETRY_FALSE = "false";
-
-  static final String HIVE_COMPILE_ERROR_MSG = "Error while compiling 
statement:";
-
-  static void verifySuccess(TStatus status, String comment) throws 
HiveClientException {
-if (status.getStatusCode() != TStatusCode.SUCCESS_STATUS &&
-status.getStatusCode() != TStatusCode.SUCCESS_WITH_INFO_STATUS) {
-  String message = (status.getErrorMessage() != null) ? 
status.getErrorMessage() : "";
-
-  // For schemantic exception Error code is between 1-1
-  // https://issues.apache.org/jira/browse/HIVE-3001
-  // https://issues.apache.org/jira/browse/HIVE-12867
-  if((status.getErrorCode() >= 1 && status.getErrorCode() <= 1)|| 
message.contains(HIVE_COMPILE_ERROR_MSG)){
-throw new HiveInvalidQueryException(status.getStatusCode(),message);
-  }
-  throw new HiveErrorStatusException(status.getStatusCode(), comment + ". 
" + message);
-}
-  }
-
-  static boolean needToSendCredentials(CookieStore cookieStore, String 
cookieName, boolean isSSL) {
-if (cookieName == null || cookieStore == null) {
-  return true;
-}
-
-List cookies = cookieStore.getCookies();
-
-for (Cookie c : cookies) {
-  // If this is a secured cookie and the current connection is non-secured,
-  // then, skip this cookie. We need to skip this cookie because, the 
cookie
-  // replay will not be transmitted to the server.
-  if (c.isSecure() && !isSSL) {
-continue;
-  }
-  if (c.getName().equals(cookieName)) {
-return false;
-  }
-}
-return true;
-  }
-
-  /**
-   * Removes the empty strings and returns back only the strings with content
-   */
-  static String[] removeEmptyStrings(String[] strs) {
-List nonEmptyStrings = new ArrayList<>();
-for(String str : strs) {
-  if (!(str == null || str.trim().isEmpty())) {
-nonEmptyStrings.add(str.trim());
-  }
-}
-return nonEmptyStrings.toArray(new String[] {});
-  }
-
-  public static class HiveAuthenticationParams {
-public static final String AUTH_TYPE = "auth";
-// We're deprecating this variable's name.
-public static final String AUTH_QOP_DEPRECATED = "sasl.qop";
-public static final String AUTH_QOP = "saslQop";
-public static final String AUTH_SIMPLE = "noSasl";
-public static final String AUTH_TOKEN = "delegationToken";
-public static final String AUTH_USER = "user";
-public static final String HS2_PROXY_USER = "hive.server2.proxy.user";
-public static final String AUTH_PRINCIPAL = "principal";
-public static final String AUTH_PASSWD = "password";
-public static final String AUTH_KERBEROS_AUTH_TYPE = "kerberosAuthType";
-public static final String AUTH_KERBEROS_AUTH_TYPE_FROM_SUBJECT = 
"fromSubject";
-public static final String ANONYMOUS_USER = "anonymous";
-public static final String ANONYMOUS_PASSWD = "anonymous";
-public static final String USE_SSL = "ssl";
-public static final String SSL_TRUST_STORE = 

[08/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/query-editor-test.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/query-editor-test.js
 
b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/query-editor-test.js
deleted file mode 100644
index e70b5ee..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/query-editor-test.js
+++ /dev/null
@@ -1,52 +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.
- */
-
-import Ember from 'ember';
-import { moduleForComponent, test } from 'ember-qunit';
-
-moduleForComponent('query-editor', 'QueryEditorComponent', {
-  unit: true
-});
-
-test('initEditor sets the editor on didInsertElement', function () {
-  expect(2);
-
-  var component = this.subject();
-
-  equal(component.get('editor'), undefined, 'element not rendered. Editor not 
set.');
-
-  this.$();
-
-  ok(component.get('editor'), 'element rendered. Editor set.');
-});
-
-test('updateValue sets the query value on the editor.', function () {
-  expect(1);
-
-  var component = this.subject();
-
-  var query = 'select something';
-
-  this.$();
-
-  Ember.run(function () {
-component.set(('query'), query);
-  });
-
-  equal(component.get('editor').getValue(), query, 'set query property. 
Updated editor value property.');
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/select-widget-test.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/select-widget-test.js
 
b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/select-widget-test.js
deleted file mode 100644
index a186508..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/select-widget-test.js
+++ /dev/null
@@ -1,158 +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.
- */
-
-import Ember from 'ember';
-import { moduleForComponent, test } from 'ember-qunit';
-
-moduleForComponent('select-widget', 'SelectWidgetComponent', {
-  needs: ['helper:path-binding']
-});
-
-test('selectedLabel returns the selectedValue property indicated by labelPath 
if selectedValue and labelPath are set.', function () {
-  expect(1);
-
-  var component = this.subject();
-
-  var selectedValue = Ember.Object.extend({
-label: 'db'
-  }).create();
-
-  var labelPath = 'label';
-
-  Ember.run(function () {
-component.set('labelPath', labelPath);
-component.set('selectedValue', selectedValue);
-  });
-
-  equal(component.get('selectedLabel'), selectedValue.label, 'selectedValue 
and labelPath are set. selectedLabel returns selectedValue[labelPath].');
-});
-
-test('selectedLabel returns defaultLabel if selectedValue is falsy and 
defaultLabel is set.', function () {
-  expect(1);
-
-  var component = this.subject();
-
-  var defaultLabel = 'select...';
-
-  Ember.run(function () {
-component.set('defaultLabel', defaultLabel);
-  });
-
-  equal(component.get('selectedLabel'), defaultLabel, 'selectedValue falsy and 
defaultLabel set. selectedLabel returns defaultLabel.');
-});
-
-test('selectedLabel returns undefined if neither selectedValue nor 

[01/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 ff9eb72a9 -> c0f9621f2


http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/upload/OpenCSVTest.java
--
diff --git 
a/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/upload/OpenCSVTest.java
 
b/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/upload/OpenCSVTest.java
deleted file mode 100644
index 0bdf5cf..000
--- 
a/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/upload/OpenCSVTest.java
+++ /dev/null
@@ -1,259 +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.
- */
-
-package org.apache.ambari.view.hive.resources.upload;
-
-import com.opencsv.CSVParser;
-import com.opencsv.CSVReader;
-import com.opencsv.CSVWriter;
-import org.junit.Assert;
-import org.junit.Test;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.io.StringWriter;
-
-public class OpenCSVTest {
-
-  /**
-   * no exception in creating csvParser with emtpy stream
-   *
-   * @throws IOException
-   */
-  @Test
-  public void testEmptyStream() throws Exception {
-String csv = "";
-
-CSVParser jp = new CSVParser();
-String[] columns = jp.parseLine(csv);
-Assert.assertEquals("Should detect one column.", 1, columns.length);
-Assert.assertEquals("Should detect one column with empty value.", new 
String[]{""}, columns);
-  }
-
-  /**
-   * in case of csv an empty line is still considered as row
-   *
-   * @throws IOException
-   */
-  @Test
-  public void testEmptyRow() throws Exception {
-String csv = "   ";
-CSVParser jp = new CSVParser();
-
-String[] columns = jp.parseLine(csv);
-Assert.assertEquals("One column not detected.", 1, columns.length);
-Assert.assertArrayEquals("Row should not be empty", new String[]{"   
"}, columns);
-  }
-
-  @Test
-  public void testParse1Row() throws Exception {
-String csv = "value1,c,10,10.1";
-
-String[] cols = csv.split(",");
-CSVParser jp = new CSVParser();
-String[] columns = jp.parseLine(csv);
-Assert.assertEquals("4 columns not detect", 4, columns.length);
-Assert.assertArrayEquals("Row not equal!", cols, columns);
-  }
-
-  @Test
-  public void testParseMultipleRow() throws Exception {
-
-String csv = "value1,c,10,10.1\n" +
-  "value2,c2,102,true";
-
-try(
-  StringReader sr = new StringReader(csv);
-  CSVReader csvReader = new CSVReader(sr,',','"','\\');
-) {
-  String[] row1 = csvReader.readNext();
-  String[] row2 = csvReader.readNext();
-
-  Assert.assertArrayEquals("Failed to match 1st row!",new 
String[]{"value1", "c", "10", "10.1"}, row1);
-
-  Assert.assertArrayEquals("Failed to match 2nd row!",new 
String[]{"value2", "c2", "102", "true"}, row2);
-}
-  }
-
-  @Test
-  public void testParseCustomSeparator() throws Exception {
-
-String csv = "value1#c#10#10.1\n" +
-  "value2#c2#102#true";
-
-try(
-  StringReader sr = new StringReader(csv);
-  CSVReader csvReader = new CSVReader(sr,'#','"','\\');
-) {
-  String[] row1 = csvReader.readNext();
-  String[] row2 = csvReader.readNext();
-
-  Assert.assertArrayEquals("Failed to match 1st row!",new 
String[]{"value1", "c", "10", "10.1"}, row1);
-
-  Assert.assertArrayEquals("Failed to match 2nd row!",new 
String[]{"value2", "c2", "102", "true"}, row2);
-}
-  }
-
-
-  @Test
-  public void testParseCustomSeparatorAndQuote() throws Exception {
-
-String csv = "\"valu#e1\"#c#10#10.1\n" +
-  "value2#c2#102#true";
-
-try(
-  StringReader sr = new StringReader(csv);
-  CSVReader csvReader = new CSVReader(sr,'#','"','\\');
-) {
-  String[] row1 = csvReader.readNext();
-  String[] row2 = csvReader.readNext();
-
-  Assert.assertArrayEquals("Failed to match 1st row!",new 
String[]{"valu#e1", "c", "10", "10.1"}, row1);
-
-  Assert.assertArrayEquals("Failed to match 2nd row!",new 
String[]{"value2", "c2", "102", "true"}, row2);
-}
-  }
-
-  @Test
-  public void testMultipleEscape() throws Exception {
-
-

[23/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in 
pom.xml files (nitirajrathore)


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

Branch: refs/heads/branch-2.5
Commit: c0f9621f2008aff2b71a7e7075c8e13cea05db87
Parents: ff9eb72
Author: Nitiraj Rathore 
Authored: Wed Dec 28 00:02:36 2016 +0530
Committer: Nitiraj Rathore 
Committed: Wed Dec 28 15:02:31 2016 +0530

--
 contrib/views/hive/pom.xml  | 386 
 .../apache/ambari/view/hive/BaseService.java|  54 --
 .../apache/ambari/view/hive/HelpService.java| 132 ---
 .../apache/ambari/view/hive/HiveViewImpl.java   |  50 -
 .../ambari/view/hive/PropertyValidator.java | 113 ---
 .../org/apache/ambari/view/hive/TestBean.java   |  36 -
 .../backgroundjobs/BackgroundJobController.java |  90 --
 .../view/hive/client/ColumnDescription.java |  48 -
 .../hive/client/ColumnDescriptionExtended.java  | 103 --
 .../hive/client/ColumnDescriptionShort.java |  72 --
 .../ambari/view/hive/client/Connection.java | 740 --
 .../view/hive/client/ConnectionFactory.java | 166 
 .../apache/ambari/view/hive/client/Cursor.java  | 243 -
 .../ambari/view/hive/client/DDLDelegator.java   | 140 ---
 .../view/hive/client/HiveAuthCredentials.java   |  31 -
 .../hive/client/HiveAuthRequiredException.java  |  27 -
 .../ambari/view/hive/client/HiveCall.java   | 120 ---
 .../client/HiveClientAuthRequiredException.java |  25 -
 .../view/hive/client/HiveClientException.java   |  25 -
 .../hive/client/HiveClientRuntimeException.java |  25 -
 .../hive/client/HiveErrorStatusException.java   |  30 -
 .../hive/client/HiveInvalidQueryException.java  |  27 -
 .../hive/client/HttpBasicAuthInterceptor.java   |  55 --
 .../client/HttpKerberosRequestInterceptor.java  |  72 --
 .../hive/client/HttpRequestInterceptorBase.java |  88 --
 .../ambari/view/hive/client/LogsCursor.java |  36 -
 .../org/apache/ambari/view/hive/client/Row.java |  74 --
 .../view/hive/client/UserLocalConnection.java   |  48 -
 .../client/UserLocalHiveAuthCredentials.java|  33 -
 .../apache/ambari/view/hive/client/Utils.java   | 141 ---
 .../view/hive/client/ViewSessionState.java  |  32 -
 .../view/hive/persistence/DataStoreStorage.java | 142 ---
 .../view/hive/persistence/IStorageFactory.java  |  23 -
 .../persistence/InstanceKeyValueStorage.java| 135 ---
 .../view/hive/persistence/KeyValueStorage.java  | 163 
 .../hive/persistence/LocalKeyValueStorage.java  |  73 --
 .../persistence/PersistentConfiguration.java|  52 -
 .../ambari/view/hive/persistence/Storage.java   |  77 --
 .../utils/ContextConfigurationAdapter.java  | 260 -
 .../persistence/utils/FilteringStrategy.java|  32 -
 .../view/hive/persistence/utils/Indexed.java|  36 -
 .../hive/persistence/utils/ItemNotFound.java|  43 -
 .../utils/OnlyOwnersFilteringStrategy.java  |  38 -
 .../view/hive/persistence/utils/Owned.java  |  36 -
 .../persistence/utils/PersonalResource.java |  22 -
 .../hive/persistence/utils/StorageFactory.java  |  69 --
 .../hive/resources/CRUDResourceManager.java | 131 ---
 .../view/hive/resources/IResourceManager.java   |  37 -
 .../resources/PersonalCRUDResourceManager.java  |  99 --
 .../resources/SharedCRUDResourceManager.java|  44 -
 .../resources/browser/HiveBrowserService.java   | 276 --
 .../view/hive/resources/files/FileResource.java |  70 --
 .../view/hive/resources/files/FileService.java  | 266 -
 .../view/hive/resources/jobs/Aggregator.java| 417 
 .../resources/jobs/ConnectionController.java|  74 --
 .../hive/resources/jobs/FileResourceShort.java  |  55 --
 .../jobs/IOperationHandleResourceManager.java   |  40 -
 .../resources/jobs/JobResourceProvider.java | 113 ---
 .../view/hive/resources/jobs/JobService.java| 609 
 .../view/hive/resources/jobs/LogParser.java | 139 ---
 .../jobs/ModifyNotificationDelegate.java|  23 -
 .../ModifyNotificationInvocationHandler.java|  40 -
 .../jobs/NoOperationStatusSetException.java |  23 -
 .../jobs/OperationHandleController.java | 135 ---
 .../jobs/OperationHandleControllerFactory.java  |  43 -
 .../jobs/OperationHandleResourceManager.java| 120 ---
 .../hive/resources/jobs/ProgressRetriever.java  |  67 --
 .../jobs/ResultsPaginationController.java   | 240 -
 .../resources/jobs/StoredOperationHandle.java   | 146 ---
 .../hive/resources/jobs/atsJobs/ATSParser.java  | 248 -
 .../jobs/atsJobs/ATSParserFactory.java  |  45 -
 .../jobs/atsJobs/ATSRequestsDelegate.java   |  47 -
 .../jobs/atsJobs/ATSRequestsDelegateImpl.java   

[04/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/view.log4j.properties
--
diff --git a/contrib/views/hive/src/main/resources/view.log4j.properties 
b/contrib/views/hive/src/main/resources/view.log4j.properties
deleted file mode 100644
index 03c3e93..000
--- a/contrib/views/hive/src/main/resources/view.log4j.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2011 The Apache Software Foundation
-#
-# 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.
-
-log4j.appender.hiveView=org.apache.log4j.RollingFileAppender
-log4j.appender.hiveView.File=${ambari.log.dir}/hive-view/hive-view.log
-log4j.appender.hiveView.MaxFileSize=80MB
-log4j.appender.hiveView.MaxBackupIndex=60
-log4j.appender.hiveView.layout=org.apache.log4j.PatternLayout
-log4j.appender.hiveView.layout.ConversionPattern=%d{DATE} %5p [%t] 
[%X{viewName} %X{viewVersion} %X{viewInstanceName}] %c{1}:%L - %m%n
-
-log4j.logger.org.apache.ambari.view.hive=INFO,hiveView
-log4j.additivity.org.apache.ambari.view.hive = false

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/view.xml
--
diff --git a/contrib/views/hive/src/main/resources/view.xml 
b/contrib/views/hive/src/main/resources/view.xml
deleted file mode 100644
index 36b43d5..000
--- a/contrib/views/hive/src/main/resources/view.xml
+++ /dev/null
@@ -1,347 +0,0 @@
-
-
-HIVE
-Hive
-1.0.0
-${env.BUILD_NUMBER}
-
-2.0.*
-
-
org.apache.ambari.view.hive.PropertyValidator
-org.apache.ambari.view.hive.HiveViewImpl
-
-
-
-  hive.host
-  Enter the HiveServer2 host. Host must be accessible from 
Ambari Server.
-  HiveServer2 Host
-  127.0.0.1
-  fake
-  true
-
-
-
-  hive.port
-  HiveServer2 Thrift port (example: 1).
-  HiveServer2 Thrift port
-  1
-  1
-  hive-site/hive.server2.thrift.port
-  true
-
-
-
-hive.http.port
-HiveServer2 Http port (example: 10001).
-HiveServer2 Http port
-10001
-10001
-
hive-site/hive.server2.thrift.http.port
-true
-
-
-
-hive.http.path
-HiveServer2 Http path (example: cliservice).
-HiveServer2 Http path
-cliservice
-cliservice
-
hive-site/hive.server2.thrift.http.path
-true
-
-
-
-hive.transport.mode
-HiveServer2 Transport Mode (example: 
http/binary).
-HiveServer2 Transport Mode
-binary
-binary
-hive-site/hive.server2.transport.mode
-true
-
-
-
-  hive.auth
-  Semicolon-separated authentication configs.
-  Hive Authentication
-  auth=NONE
-  false
-
-
-
-hive.metastore.warehouse.dir
-Hive Metastore directory (example: 
/apps/hive/warehouse)
-Hive Metastore directory
-/apps/hive/warehouse
-/apps/hive/warehouse
-hive-site/hive.metastore.warehouse.dir
-false
-
-
-
-
-webhdfs.url
-Enter the WebHDFS FileSystem URI. Typically this is the 
dfs.namenode.http-address
-property in the hdfs-site.xml configuration. URL must be 
accessible from Ambari Server.
-WebHDFS FileSystem URI
-webhdfs://namenode:50070
-true
-core-site/fs.defaultFS
-
-
-webhdfs.nameservices
-Comma-separated list of nameservices. Value of 
hdfs-site/dfs.nameservices property
-Logical name of the NameNode cluster
-false
-hdfs-site/dfs.nameservices
-
-
-webhdfs.ha.namenodes.list
-Comma-separated list of namenodes for a given nameservice.
-  Value of hdfs-site/dfs.ha.namenodes.[nameservice] 
property
-List of NameNodes
-false
-fake
-
-
-webhdfs.ha.namenode.rpc-address.nn1
-RPC address for first name node.
-  Value of 
hdfs-site/dfs.namenode.rpc-address.[nameservice].[namenode1] 
property
-First NameNode RPC Address
-false
-fake
-
-
-

[13/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/tez-ui.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/tez-ui.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/tez-ui.js
deleted file mode 100644
index 43835e0..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/tez-ui.js
+++ /dev/null
@@ -1,106 +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.
- */
-
-import Ember from 'ember';
-import constants from 'hive/utils/constants';
-
-export default Ember.Controller.extend({
-  needs: [ constants.namingConventions.index ],
-
-  index: Ember.computed.alias('controllers.' + 
constants.namingConventions.index),
-
-  tezViewURL: null,
-  tezApiURL: '/api/v1/views/TEZ',
-  tezURLPrefix: '/views/TEZ',
-  tezDagPath: '?viewPath=/#/dag/',
-
-  isTezViewAvailable: Ember.computed.bool('tezViewURL'),
-
-  dagId: function () {
-if (this.get('isTezViewAvailable')) {
-  return this.get('index.model.dagId');
-}
-
-return false;
-  }.property('index.model.dagId', 'isTezViewAvailable'),
-
-  dagURL: function () {
-if (this.get('dagId')) {
-  return "%@%@%@".fmt(this.get('tezViewURL'), this.get('tezDagPath'), 
this.get('dagId'));
-}
-
-return false;
-  }.property('dagId'),
-
-  getTezView: function () {
-if (this.get('isTezViewAvailable')) {
-  return;
-}
-
-var self = this;
-Ember.$.getJSON(this.get('tezApiURL'))
-  .then(function (response) {
-self.getTezViewInstance(response);
-  })
-  .fail(function (response) {
-self.setTezViewError(response);
-  });
-  }.on('init'),
-
-  getTezViewInstance: function (data) {
-var self = this;
-var url = this.get('tezApiURL') + '/versions/' + 
data.versions[0].ViewVersionInfo.version;
-
-Ember.$.getJSON(url)
-  .then(function (response) {
-if (!response.instances.length) {
-  self.setTezViewError(response);
-  return;
-}
-
-self.set('isTezViewAvailable', true);
-
-var instance = response.instances[0].ViewInstanceInfo;
-self.setTezViewURL(instance);
-  });
-  },
-
-  setTezViewURL: function (instance) {
-var url = "%@/%@/%@/".fmt(
-  this.get('tezURLPrefix'),
-  instance.version,
-  instance.instance_name
-);
-
-this.set('tezViewURL', url);
-  },
-
-  setTezViewError: function (data) {
-// status: 404 => Tev View isn't deployed
-if (data.status && data.status === 404) {
-  this.set('error', 'tez.errors.not.deployed');
-  return;
-}
-
-// no instance created
-if (data.instances && !data.instances.length) {
-  this.set('error', 'tez.errors.no.instance');
-  return;
-}
-  }
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/udfs.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/udfs.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/udfs.js
deleted file mode 100644
index 3aec378..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/udfs.js
+++ /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
- *
- * 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 

[05/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/vendor/dagre.min.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/vendor/dagre.min.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/vendor/dagre.min.js
deleted file mode 100644
index 10a0471..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/vendor/dagre.min.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * @license
- * Copyright (c) 2012-2014 Chris Pettitt
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to 
deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof 
require=="function"&if(!u&)return a(o,!0);if(i)return i(o,!0);var 
f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var 
l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return 
s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof 
require=="function"&for(var o=0;o

[11/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/dropdown-submenu.scss
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/dropdown-submenu.scss
 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/dropdown-submenu.scss
deleted file mode 100644
index bab2216..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/dropdown-submenu.scss
+++ /dev/null
@@ -1,65 +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.
- */
-
-.dropdown-submenu {
-position:relative;
-}
-
-.dropdown-submenu>.dropdown-menu {
-top:0;
-left:100%;
-margin-top:-6px;
-margin-left:-1px;
--webkit-border-radius:0 6px 6px 6px;
--moz-border-radius:0 6px 6px 6px;
-border-radius:0 6px 6px 6px;
-}
-
-.dropdown-submenu:hover>.dropdown-menu {
-display:block;
-}
-
-.dropdown-submenu>a:after {
-display:block;
-content:" ";
-float:right;
-width:0;
-height:0;
-border-color:transparent;
-border-style:solid;
-border-width:5px 0 5px 5px;
-border-left-color:#cc;
-margin-top:5px;
-margin-right:-10px;
-}
-
-.dropdown-submenu:hover>a:after {
-border-left-color:#ff;
-}
-
-.dropdown-submenu.pull-left {
-float:none;
-}
-
-.dropdown-submenu.pull-left>.dropdown-menu {
-left:-100%;
-margin-left:10px;
--webkit-border-radius:6px 0 6px 6px;
--moz-border-radius:6px 0 6px 6px;
-border-radius:6px 0 6px 6px;
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/mixins.scss
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/mixins.scss 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/mixins.scss
deleted file mode 100644
index acaa386..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/mixins.scss
+++ /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.
-*/
-
-@mixin box-shadow($horizontal, $vertical, $blur, $color) {
-  -webkit-box-shadow: $horizontal $vertical $blur $color;
- -moz-box-shadow: $horizontal $vertical $blur $color;
-  box-shadow: $horizontal $vertical $blur $color;
-}
-
-@mixin animate-width($time) {
-  -webkit-transition: $time;
-  transition: width $time;
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/notifications.scss
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/notifications.scss
 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/notifications.scss
deleted file mode 100644
index 166056b..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/styles/notifications.scss
+++ /dev/null
@@ -1,37 +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 

[19/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ProgressRetriever.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ProgressRetriever.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ProgressRetriever.java
deleted file mode 100644
index 6be8147..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ProgressRetriever.java
+++ /dev/null
@@ -1,67 +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.
- */
-
-package org.apache.ambari.view.hive.resources.jobs;
-
-import org.apache.ambari.view.hive.resources.jobs.atsJobs.TezVertexId;
-import org.apache.ambari.view.hive.resources.jobs.rm.RMParser;
-import org.apache.ambari.view.hive.resources.jobs.viewJobs.Job;
-import org.apache.ambari.view.hive.utils.ServiceFormattedException;
-import org.apache.ambari.view.hive.utils.SharedObjectsFactory;
-
-import java.util.List;
-import java.util.Map;
-
-public class ProgressRetriever {
-  private final Progress progress;
-  private final Job job;
-  private final SharedObjectsFactory sharedObjects;
-
-  public ProgressRetriever(Job job, SharedObjectsFactory sharedObjects) {
-this.job = job;
-this.sharedObjects = sharedObjects;
-
-this.progress = new Progress();
-  }
-
-  public Progress getProgress() {
-jobCheck();
-
-progress.dagProgress = sharedObjects.getRMParser().getDAGProgress(
-job.getApplicationId(), job.getDagId());
-
-List vertices = 
sharedObjects.getATSParser().getVerticesForDAGId(job.getDagId());
-progress.vertexProgresses = 
sharedObjects.getRMParser().getDAGVerticesProgress(job.getApplicationId(), 
job.getDagId(), vertices);
-
-return progress;
-  }
-
-  public void jobCheck() {
-if (job.getApplicationId() == null || job.getApplicationId().isEmpty()) {
-  throw new ServiceFormattedException("E070 ApplicationId is not defined 
yet");
-}
-if (job.getDagId() == null || job.getDagId().isEmpty()) {
-  throw new ServiceFormattedException("E080 DagID is not defined yet");
-}
-  }
-
-  public static class Progress {
-public Double dagProgress;
-public List vertexProgresses;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ResultsPaginationController.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ResultsPaginationController.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ResultsPaginationController.java
deleted file mode 100644
index cc2ff42..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/jobs/ResultsPaginationController.java
+++ /dev/null
@@ -1,240 +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.
- */
-
-package org.apache.ambari.view.hive.resources.jobs;
-
-
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.hive.client.ColumnDescription;
-import org.apache.ambari.view.hive.client.HiveClientException;
-import org.apache.ambari.view.hive.client.Cursor;
-import org.apache.ambari.view.hive.utils.HiveClientFormattedException;
-import 

[16/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java
deleted file mode 100644
index 4edc82c..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/parsers/xml/XMLParser.java
+++ /dev/null
@@ -1,100 +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.
- */
-
-package org.apache.ambari.view.hive.resources.uploads.parsers.xml;
-
-import org.apache.ambari.view.hive.client.Row;
-import org.apache.ambari.view.hive.resources.uploads.parsers.ParseOptions;
-import org.apache.ambari.view.hive.resources.uploads.parsers.Parser;
-import org.apache.ambari.view.hive.resources.uploads.parsers.RowIterator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.Collection;
-import java.util.Iterator;
-
-/**
- * assumes XML of following format
- * 
- * 
- * row1-col1-Data
- * row1-col2-Data
- * row1-col3-Data
- * row1-col4-Data
- * 
- * 
- * row2-col1-Data
- * row2-col2-Data
- * row2-col3-Data
- * row2-col4-Data
- * 
- * 
- */
-public class XMLParser extends Parser {
-
-  protected final static Logger LOG =
-  LoggerFactory.getLogger(XMLParser.class);
-
-  private RowIterator iterator;
-  private XMLEventReader xmlReader;
-  private XMLIterator xmlIterator;
-
-  public XMLParser(Reader reader, ParseOptions parseOptions) throws 
IOException {
-super(reader, parseOptions);
-XMLInputFactory factory = XMLInputFactory.newInstance();
-try {
-  this.xmlReader = factory.createXMLEventReader(reader);
-} catch (XMLStreamException e) {
-  LOG.error("error occurred while creating xml reader : ", e);
-  throw new IOException("error occurred while creating xml reader : ", e);
-}
-xmlIterator = new XMLIterator(this.xmlReader);
-iterator = new RowIterator(xmlIterator);
-  }
-
-  @Override
-  public Row extractHeader() {
-Collection headers = this.iterator.extractHeaders();
-Object[] objs = new Object[headers.size()];
-Iterator iterator = headers.iterator();
-for (int i = 0; i < headers.size(); i++) {
-  objs[i] = iterator.next();
-}
-
-return new Row(objs);
-  }
-
-  @Override
-  public void close() throws Exception {
-try {
-  this.xmlReader.close();
-} catch (XMLStreamException e) {
-  throw new IOException(e);
-}
-  }
-
-  @Override
-  public Iterator iterator() {
-return iterator;
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java
deleted file mode 100644
index 1fe30fd..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/uploads/query/DeleteQueryInput.java
+++ /dev/null
@@ -1,48 +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 

[02/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/savedQueries/SavedQueryServiceTest.java
--
diff --git 
a/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/savedQueries/SavedQueryServiceTest.java
 
b/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/savedQueries/SavedQueryServiceTest.java
deleted file mode 100644
index 68cb0c8..000
--- 
a/contrib/views/hive/src/test/java/org/apache/ambari/view/hive/resources/savedQueries/SavedQueryServiceTest.java
+++ /dev/null
@@ -1,191 +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.
- */
-
-package org.apache.ambari.view.hive.resources.savedQueries;
-
-import org.apache.ambari.view.hive.HDFSTest;
-import org.apache.ambari.view.hive.utils.NotFoundFormattedException;
-import org.json.simple.JSONObject;
-import org.junit.*;
-import org.junit.rules.ExpectedException;
-
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriBuilder;
-import javax.ws.rs.core.UriInfo;
-import java.io.File;
-import java.net.URI;
-import java.util.List;
-import java.util.Map;
-
-import static org.easymock.EasyMock.*;
-
-public class SavedQueryServiceTest extends HDFSTest {
-  //TODO: run without HDFS cluster
-  private SavedQueryService savedQueryService;
-  @Rule public ExpectedException thrown = ExpectedException.none();
-
-  @BeforeClass
-  public static void startUp() throws Exception {
-HDFSTest.startUp(); // super
-  }
-
-  @AfterClass
-  public static void shutDown() throws Exception {
-HDFSTest.shutDown(); // super
-  }
-
-  @Override
-  @Before
-  public void setUp() throws Exception {
-super.setUp();
-savedQueryService = getService(SavedQueryService.class, handler, context);
-savedQueryService.getSharedObjectsFactory().clear();
-  }
-
-  @Override
-  @After
-  public void tearDown() throws Exception {
-super.tearDown();
-  }
-
-  @Override
-  protected void setupProperties(Map properties, File baseDir) 
throws Exception {
-super.setupProperties(properties, baseDir);
-properties.put("scripts.dir", "/tmp/.hiveQueries");
-  }
-
-  private Response doCreateSavedQuery() {
-  return doCreateSavedQuery("Luke", "/tmp/luke.hql", savedQueryService);
-  }
-
-  public static Response doCreateSavedQuery(String title, String path, 
SavedQueryService service) {
-SavedQueryService.SavedQueryRequest request = new 
SavedQueryService.SavedQueryRequest();
-request.savedQuery = new SavedQuery();
-request.savedQuery.setTitle(title);
-request.savedQuery.setQueryFile(path);
-
-UriInfo uriInfo = createNiceMock(UriInfo.class);
-URI uri = UriBuilder.fromUri("http://host/a/b;).build();
-expect(uriInfo.getAbsolutePath()).andReturn(uri);
-
-HttpServletResponse resp_obj = createNiceMock(HttpServletResponse.class);
-
-resp_obj.setHeader(eq("Location"), anyString());
-
-replay(uriInfo, resp_obj);
-return service.create(request, resp_obj, uriInfo);
-  }
-
-  private Response doCreateSavedQuery(String title, String path) {
-  return doCreateSavedQuery(title, path, savedQueryService);
-  }
-
-  @Test
-  public void createSavedQuery() {
-Response response = doCreateSavedQuery();
-Assert.assertEquals(201, response.getStatus());
-
-JSONObject obj = (JSONObject)response.getEntity();
-Assert.assertTrue(obj.containsKey("savedQuery"));
-Assert.assertNotNull(((SavedQuery) obj.get("savedQuery")).getId());
-Assert.assertTrue(((SavedQuery) obj.get("savedQuery")).getId() != null);
-  }
-
-  @Test
-  public void createSavedQueryAutoCreate() {
-Response response = doCreateSavedQuery("Test", null);
-Assert.assertEquals(201, response.getStatus());
-
-JSONObject obj = (JSONObject)response.getEntity();
-Assert.assertTrue(obj.containsKey("savedQuery"));
-Assert.assertNotNull(((SavedQuery) obj.get("savedQuery")).getId());
-Assert.assertFalse(((SavedQuery) obj.get("savedQuery")).getId() == null);
-Assert.assertFalse(((SavedQuery) 
obj.get("savedQuery")).getQueryFile().isEmpty());
- 

[07/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror-min.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror-min.js
 
b/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror-min.js
deleted file mode 100644
index 13d2b2b..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror-min.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/* CodeMirror - Minified & Bundled
-   Generated on 10/30/2014 with http://codemirror.net/doc/compress.html
-   Version: HEAD
-
-   CodeMirror Library:
-   - codemirror.js
-   Modes:
-   - sql.js
-   Add-ons:
-   - sql-hint.js
- */
-
-!function(a){if("object"==typeof exports&&"object"==typeof 
module)module.exports=a();else{if("function"==typeof define&)return 
define([],a);this.CodeMirror=a()}}(function(){"use strict";function 
w(a,b){if(!(this instanceof w))return new 
w(a,b);this.options=b=b?Pg(b):{},Pg(ie,b,!1),J(b);var 
c=b.value;"string"==typeof c&&(c=new Kf(c,b.mode)),this.doc=c;var 
f=this.display=new 
x(a,c);f.wrapper.CodeMirror=this,F(this),D(this),b.lineWrapping&&(this.display.wrapper.className+="
 
CodeMirror-wrap"),b.autofocus&&!o&&_c(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,draggingText:!1,highlight:new
 
Fg,keySeq:null},d&&11>e&(Qg($c,this,!0),20),cd(this),hh(),Ac(this),this.curOp.forceUpdate=!0,Of(this,c),b.autofocus&&!o||ah()==f.input?setTimeout(Qg(Hd,this),20):Id(this);for(var
 g in je)je.hasOwnProperty(g)&[g](this,b[g],le);P(this);for(var 
h=0;he&&(c.gutters.style.zIndex=-1,c.scroller.style.paddingRight=0),n&&(g.style.width="0px"),f||(c.scroller.draggable=!0),k&&(c.inputDiv.style.height="1px",c.inputDiv.style.position="absolute"),d&&8>e&&(c.scrollbarH.style.minHeight=c.scrollbarV.style.minWidth="18px"),a&&(a.appendChild?a.appendChild(c.wrapper):a(c.wrapper)),c.viewFrom=c.viewTo=b.first,c.view=[],c.external
 
Measured=null,c.viewOffset=0,c.lastWrapHeight=c.lastWrapWidth=0,c.updateLineNumbers=null,c.lineNumWidth=c.lineNumInnerWidth=c.lineNumChars=null,c.prevInput="",c.alignWidgets=!1,c.pollingFast=!1,c.poll=new
 
Fg,c.cachedCharWidth=c.cachedTextHeight=c.cachedPaddingH=null,c.inaccurateSelection=!1,c.maxLine=null,c.maxLineLength=0,c.maxLineChanged=!1,c.wheelDX=c.wheelDY=c.wheelStartX=c.wheelStartY=null,c.shift=!1,c.selForContextMenu=null}function
 y(a){a.doc.mode=w.getMode(a.options,a.doc.modeOption),z(a)}function 
z(a){a.doc.iter(function(a){a.stateAfter&&(a.stateAfter=null),a.styles&&(a.styles=null)}),a.doc.frontier=a.doc.first,Tb(a,100),a.state.modeGen++,a.curOp&(a)}function
 
A(a){a.options.lineWrapping?(dh(a.display.wrapper,"CodeMirror-wrap"),a.display.sizer.style.minWidth=""):(ch(a.display.wrapper,"CodeMirror-wrap"),I(a)),C(a),Pc(a),kc(a),setTimeout(function(){M(a)},100)}function
 B(a){var 
b=wc(a.display),c=a.options.lineWrapping,d=c&(5,a.display.scroller.clientWidth/xc(a.displ
 ay)-3);return function(e){if(ef(a.doc,e))return 0;var f=0;if(e.widgets)for(var 
g=0;g

[22/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Connection.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Connection.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Connection.java
deleted file mode 100644
index d69a1a5..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/client/Connection.java
+++ /dev/null
@@ -1,740 +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.
- */
-
-package org.apache.ambari.view.hive.client;
-
-import org.apache.commons.codec.binary.Hex;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hive.shims.ShimLoader;
-import org.apache.hadoop.security.UserGroupInformation;
-import org.apache.hive.service.auth.HiveAuthFactory;
-import org.apache.hive.service.auth.KerberosSaslHelper;
-import org.apache.hive.service.auth.PlainSaslHelper;
-import org.apache.hive.service.auth.SaslQOP;
-import org.apache.hive.service.cli.thrift.*;
-import org.apache.http.HttpRequestInterceptor;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.CookieStore;
-import org.apache.http.client.ServiceUnavailableRetryStrategy;
-import org.apache.http.config.Registry;
-import org.apache.http.config.RegistryBuilder;
-import org.apache.http.conn.socket.ConnectionSocketFactory;
-import org.apache.http.conn.ssl.SSLSocketFactory;
-import org.apache.http.impl.client.BasicCookieStore;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.http.impl.client.HttpClients;
-import org.apache.http.impl.conn.BasicHttpClientConnectionManager;
-import org.apache.http.protocol.HttpContext;
-import org.apache.thrift.TException;
-import org.apache.thrift.protocol.TBinaryProtocol;
-import org.apache.thrift.transport.THttpClient;
-import org.apache.thrift.transport.TTransport;
-import org.apache.thrift.transport.TTransportException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.TrustManagerFactory;
-import javax.security.sasl.Sasl;
-import javax.security.sasl.SaslException;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.security.KeyStore;
-import java.security.SecureRandom;
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Holds sessions
- */
-public class Connection {
-  private final static Logger LOG =
-  LoggerFactory.getLogger(Connection.class);
-  private String host;
-  private int port;
-  private Map authParams;
-
-  private TCLIService.Client client = null;
-  private Map sessHandles = null;
-  private TProtocolVersion protocol = null;
-  private TTransport transport;
-
-  private DDLDelegator ddl;
-  private String username;
-  private String password;
-
-  public Connection(String host, int port, Map authParams, 
String username, String password)
-  throws HiveClientException, HiveAuthRequiredException {
-this.host = host;
-this.port = port;
-this.authParams = authParams;
-this.username = username;
-this.password = password;
-
-this.sessHandles = new HashMap();
-
-openConnection();
-ddl = new DDLDelegator(this);
-  }
-
-  public DDLDelegator ddl() {
-return ddl;
-  }
-
-  public synchronized void openConnection() throws HiveClientException, 
HiveAuthRequiredException {
-try {
-  transport = isHttpTransportMode() ? createHttpTransport() : 
createBinaryTransport();
-  transport.open();
-  client = new TCLIService.Client(new TBinaryProtocol(transport));
-} catch (TTransportException e) {
-  throw new HiveClientException("H020 Could not establish connection to "
-  + host + ":" + port + ": " + e.toString(), e);
-} catch (SQLException e) {
-  throw new HiveClientException(e.getMessage(), e);
-}
-LOG.info("Hive 

[09/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/config/environment.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/config/environment.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/config/environment.js
deleted file mode 100644
index 992d91c..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/config/environment.js
+++ /dev/null
@@ -1,70 +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.
- */
-
-/* jshint node: true */
-
-module.exports = function(environment) {
-  var ENV = {
-modulePrefix: 'hive',
-environment: environment,
-baseURL: '/',
-locationType: 'hash',
-EmberENV: {
-  FEATURES: {
-// Here you can enable experimental features on an ember canary build
-// e.g. 'with-controller': true
-  }
-},
-
-contentSecurityPolicy: {
-  'connect-src': "'self' ws://localhost:35729 ws://0.0.0.0:35729",
-  'style-src': "'self' 'unsafe-inline'"
-},
-
-APP: {
-  // Here you can pass flags/options to your application instance
-  // when it is created
-}
-  };
-
-  if (environment === 'development') {
-// ENV.APP.LOG_RESOLVER = true;
-ENV.APP.LOG_ACTIVE_GENERATION = true;
-// ENV.APP.LOG_TRANSITIONS = true;
-// ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
-ENV.APP.LOG_VIEW_LOOKUPS = true;
-  }
-
-  if (environment === 'test') {
-// Testem prefers this...
-ENV.baseURL = '/';
-ENV.locationType = 'auto';
-
-// keep test console output quieter
-ENV.APP.LOG_ACTIVE_GENERATION = false;
-ENV.APP.LOG_VIEW_LOOKUPS = false;
-
-ENV.APP.rootElement = '#ember-testing';
-  }
-
-  if (environment === 'production') {
-
-  }
-
-  return ENV;
-};

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/package.json
--
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/package.json 
b/contrib/views/hive/src/main/resources/ui/hive-web/package.json
deleted file mode 100644
index 6fe68e2..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/package.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
-  "name": "hive",
-  "version": "0.0.0",
-  "private": true,
-  "directories": {
-"doc": "doc",
-"test": "tests"
-  },
-  "scripts": {
-"start": "ember server",
-"build": "ember build",
-"test": "ember test",
-"preinstall": "chmod +x node/npm/bin/node-gyp-bin/node-gyp",
-"postinstall": "bash node/with_new_path.sh node node_modules/.bin/bower 
--allow-root install"
-  },
-  "repository": "https://github.com/stefanpenner/ember-cli;,
-  "engines": {
-"node": ">= 0.10.32"
-  },
-  "author": "",
-  "license": "MIT",
-  "devDependencies": {
-"body-parser": "^1.2.0",
-"bower": ">= 1.3.12",
-"broccoli-asset-rev": "^2.0.0",
-"broccoli-sass": "^0.6.3",
-"ember-cli": "0.2.2",
-"ember-cli-autoprefixer": "0.4.1",
-"ember-cli-blanket": "^0.5.0",
-"ember-cli-content-security-policy": "0.3.0",
-"ember-cli-font-awesome": "0.0.4",
-"ember-cli-htmlbars": "0.7.4",
-"ember-cli-ic-ajax": "0.1.1",
-"ember-cli-inject-live-reload": "^1.3.0",
-"ember-cli-jquery-ui": "0.0.12",
-"ember-cli-moment": "0.0.1",
-"ember-cli-pretender": "^0.3.1",
-"ember-cli-qunit": "0.3.14",
-"ember-cli-selectize": "0.0.19",
-"ember-cli-uglify": "1.0.1",
-"ember-cli-uploader": "^0.3.9",
-"ember-data": "1.0.0-beta.16.1",
-"ember-dynamic-component": "0.0.1",
-"ember-export-application-global": "^1.0.0",
-"express": "^4.8.5"
-  }
-}

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/testem.json
--
diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/testem.json 
b/contrib/views/hive/src/main/resources/ui/hive-web/testem.json
deleted file mode 100644
index 78029a1..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/testem.json
+++ /dev/null
@@ 

[20/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/files/FileService.java
--
diff --git 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/files/FileService.java
 
b/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/files/FileService.java
deleted file mode 100644
index 4e1d24f..000
--- 
a/contrib/views/hive/src/main/java/org/apache/ambari/view/hive/resources/files/FileService.java
+++ /dev/null
@@ -1,266 +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.
- */
-
-package org.apache.ambari.view.hive.resources.files;
-
-import com.jayway.jsonpath.JsonPath;
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.ViewResourceHandler;
-import org.apache.ambari.view.hive.BaseService;
-import org.apache.ambari.view.hive.utils.*;
-import org.apache.ambari.view.utils.hdfs.HdfsApi;
-import org.apache.ambari.view.utils.hdfs.HdfsUtil;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.io.IOUtils;
-import org.apache.hadoop.fs.FSDataOutputStream;
-import org.apache.hadoop.fs.FileAlreadyExistsException;
-import org.json.simple.JSONObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.inject.Inject;
-import javax.servlet.http.HttpServletResponse;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriInfo;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.HashMap;
-import org.apache.ambari.view.commons.hdfs.UserService;
-
-/**
- * File access resource
- * API:
- * GET /:path
- *  read entire file
- * POST /
- *  create new file
- *  Required: filePath
- *  file should not already exists
- * PUT /:path
- *  update file content
- */
-public class FileService extends BaseService {
-  public static final String FAKE_FILE = "fakefile://";
-  public static final String JSON_PATH_FILE = "jsonpath:";
-
-  @Inject
-  ViewResourceHandler handler;
-
-  protected final static Logger LOG =
-  LoggerFactory.getLogger(FileService.class);
-
-  /**
-   * Get single item
-   */
-  @GET
-  @Path("{filePath:.*}")
-  @Produces(MediaType.APPLICATION_JSON)
-  public Response getFilePage(@PathParam("filePath") String filePath, 
@QueryParam("page") Long page) throws IOException, InterruptedException {
-
-LOG.debug("Reading file " + filePath);
-try {
-  FileResource file = new FileResource();
-
-  if (page == null)
-page = 0L;
-
-  if (filePath.startsWith(FAKE_FILE)) {
-if (page > 1)
-  throw new IllegalArgumentException("There's only one page in fake 
files");
-
-String encodedContent = filePath.substring(FAKE_FILE.length());
-String content = new String(Base64.decodeBase64(encodedContent));
-
-fillFakeFileObject(filePath, file, content);
-  } else if (filePath.startsWith(JSON_PATH_FILE)) {
-if (page > 1)
-  throw new IllegalArgumentException("There's only one page in fake 
files");
-
-String content = getJsonPathContentByUrl(filePath);
-fillFakeFileObject(filePath, file, content);
-  } else  {
-
-filePath = sanitizeFilePath(filePath);
-FilePaginator paginator = new FilePaginator(filePath, 
getSharedObjectsFactory().getHdfsApi());
-
-fillRealFileObject(filePath, page, file, paginator);
-  }
-
-  JSONObject object = new JSONObject();
-  object.put("file", file);
-  return Response.ok(object).status(200).build();
-} catch (WebApplicationException ex) {
-  throw ex;
-} catch (FileNotFoundException ex) {
-  throw new NotFoundFormattedException(ex.getMessage(), ex);
-} catch (IllegalArgumentException ex) {
-  throw new BadRequestFormattedException(ex.getMessage(), ex);
-} catch (Exception ex) {
-  throw new ServiceFormattedException(ex.getMessage(), ex);
-}
-  }
-
-  protected String getJsonPathContentByUrl(String filePath) throws 

[06/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror.css
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror.css
 
b/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror.css
deleted file mode 100644
index 68c67b1..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/vendor/codemirror/codemirror.css
+++ /dev/null
@@ -1,309 +0,0 @@
-/* BASICS */
-
-.CodeMirror {
-  /* Set height, width, borders, and global font properties here */
-  font-family: monospace;
-  height: 300px;
-}
-.CodeMirror-scroll {
-  /* Set scrolling behaviour here */
-  overflow: auto;
-}
-
-/* PADDING */
-
-.CodeMirror-lines {
-  padding: 4px 0; /* Vertical padding around content */
-}
-.CodeMirror pre {
-  padding: 0 4px; /* Horizontal padding of content */
-}
-
-.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler {
-  background-color: white; /* The little square between H and V scrollbars */
-}
-
-/* GUTTER */
-
-.CodeMirror-gutters {
-  border-right: 1px solid #ddd;
-  background-color: #f7f7f7;
-  white-space: nowrap;
-}
-.CodeMirror-linenumbers {}
-.CodeMirror-linenumber {
-  padding: 0 3px 0 5px;
-  min-width: 20px;
-  text-align: right;
-  color: #999;
-  -moz-box-sizing: content-box;
-  box-sizing: content-box;
-}
-
-.CodeMirror-guttermarker { color: black; }
-.CodeMirror-guttermarker-subtle { color: #999; }
-
-/* CURSOR */
-
-.CodeMirror div.CodeMirror-cursor {
-  border-left: 1px solid black;
-}
-/* Shown when moving in bi-directional text */
-.CodeMirror div.CodeMirror-secondarycursor {
-  border-left: 1px solid silver;
-}
-.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor {
-  width: auto;
-  border: 0;
-  background: #7e7;
-}
-.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursors {
-  z-index: 1;
-}
-
-.cm-animate-fat-cursor {
-  width: auto;
-  border: 0;
-  -webkit-animation: blink 1.06s steps(1) infinite;
-  -moz-animation: blink 1.06s steps(1) infinite;
-  animation: blink 1.06s steps(1) infinite;
-}
-@-moz-keyframes blink {
-  0% { background: #7e7; }
-  50% { background: none; }
-  100% { background: #7e7; }
-}
-@-webkit-keyframes blink {
-  0% { background: #7e7; }
-  50% { background: none; }
-  100% { background: #7e7; }
-}
-@keyframes blink {
-  0% { background: #7e7; }
-  50% { background: none; }
-  100% { background: #7e7; }
-}
-
-/* Can style cursor different in overwrite (non-insert) mode */
-div.CodeMirror-overwrite div.CodeMirror-cursor {}
-
-.cm-tab { display: inline-block; text-decoration: inherit; }
-
-.CodeMirror-ruler {
-  border-left: 1px solid #ccc;
-  position: absolute;
-}
-
-/* DEFAULT THEME */
-
-.cm-s-default .cm-keyword {color: #708;}
-.cm-s-default .cm-atom {color: #219;}
-.cm-s-default .cm-number {color: #164;}
-.cm-s-default .cm-def {color: #00f;}
-.cm-s-default .cm-variable,
-.cm-s-default .cm-punctuation,
-.cm-s-default .cm-property,
-.cm-s-default .cm-operator {}
-.cm-s-default .cm-variable-2 {color: #05a;}
-.cm-s-default .cm-variable-3 {color: #085;}
-.cm-s-default .cm-comment {color: #a50;}
-.cm-s-default .cm-string {color: #a11;}
-.cm-s-default .cm-string-2 {color: #f50;}
-.cm-s-default .cm-meta {color: #555;}
-.cm-s-default .cm-qualifier {color: #555;}
-.cm-s-default .cm-builtin {color: #30a;}
-.cm-s-default .cm-bracket {color: #997;}
-.cm-s-default .cm-tag {color: #170;}
-.cm-s-default .cm-attribute {color: #00c;}
-.cm-s-default .cm-header {color: blue;}
-.cm-s-default .cm-quote {color: #090;}
-.cm-s-default .cm-hr {color: #999;}
-.cm-s-default .cm-link {color: #00c;}
-
-.cm-negative {color: #d44;}
-.cm-positive {color: #292;}
-.cm-header, .cm-strong {font-weight: bold;}
-.cm-em {font-style: italic;}
-.cm-link {text-decoration: underline;}
-
-.cm-s-default .cm-error {color: #f00;}
-.cm-invalidchar {color: #f00;}
-
-/* Default styles for common addons */
-
-div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;}
-div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;}
-.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); }
-.CodeMirror-activeline-background {background: #e8f2ff;}
-
-/* STOP */
-
-/* The rest of this file contains styles related to the mechanics of
-   the editor. You probably shouldn't touch them. */
-
-.CodeMirror {
-  line-height: 1;
-  position: relative;
-  overflow: hidden;
-  background: white;
-  color: black;
-}
-
-.CodeMirror-scroll {
-  /* 30px is the magic margin used to hide the element's real scrollbars */
-  /* See overflow: hidden in .CodeMirror */
-  margin-bottom: -30px; margin-right: -30px;
-  padding-bottom: 30px;
-  height: 100%;
-  outline: none; /* Prevent dragging from highlighting the element */
-  position: relative;
-  -moz-box-sizing: content-box;
-  box-sizing: content-box;
-}
-.CodeMirror-sizer {
-  position: relative;
-  border-right: 30px solid transparent;
-  

[14/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js
deleted file mode 100644
index e7beb77..000
--- a/contrib/views/hive/src/main/resources/ui/hive-web/app/controllers/index.js
+++ /dev/null
@@ -1,767 +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.
- */
-
-import Ember from 'ember';
-import constants from 'hive/utils/constants';
-import utils from 'hive/utils/functions';
-
-export default Ember.Controller.extend({
-  jobService: Ember.inject.service(constants.namingConventions.job),
-  jobProgressService: 
Ember.inject.service(constants.namingConventions.jobProgress),
-  databaseService: Ember.inject.service(constants.namingConventions.database),
-  notifyService: Ember.inject.service(constants.namingConventions.notify),
-  session: Ember.inject.service(constants.namingConventions.session),
-  settingsService: Ember.inject.service(constants.namingConventions.settings),
-  ldapAuthenticationService: 
Ember.inject.service(constants.namingConventions.ldapAuthentication),
-
-  openQueries   : 
Ember.inject.controller(constants.namingConventions.openQueries),
-  udfs  : Ember.inject.controller(constants.namingConventions.udfs),
-  logs  : Ember.inject.controller(constants.namingConventions.jobLogs),
-  results   : 
Ember.inject.controller(constants.namingConventions.jobResults),
-  explain   : 
Ember.inject.controller(constants.namingConventions.jobExplain),
-  settings  : 
Ember.inject.controller(constants.namingConventions.settings),
-  visualExplain : 
Ember.inject.controller(constants.namingConventions.visualExplain),
-  tezUI : Ember.inject.controller(constants.namingConventions.tezUI),
-
-  selectedDatabase: Ember.computed.alias('databaseService.selectedDatabase'),
-  isDatabaseExplorerVisible: true,
-  canKillSession: Ember.computed.and('model.sessionTag', 
'model.sessionActive'),
-
-  queryProcessTabs: [
-Ember.Object.create({
-  name: Ember.I18n.t('menus.logs'),
-  path: constants.namingConventions.subroutes.jobLogs
-}),
-Ember.Object.create({
-  name: Ember.I18n.t('menus.results'),
-  path: constants.namingConventions.subroutes.jobResults
-}),
-Ember.Object.create({
-  name: Ember.I18n.t('menus.explain'),
-  path: constants.namingConventions.subroutes.jobExplain
-})
-  ],
-
-  queryPanelActions: [
-Ember.Object.create({
-  icon: 'fa-expand',
-  action: 'toggleDatabaseExplorerVisibility',
-  tooltip: Ember.I18n.t('tooltips.expand')
-})
-  ],
-
-  init: function () {
-this._super();
-
-// initialize queryParams with an empty array
-this.set('queryParams', Ember.ArrayProxy.create({ content: Ember.A([]) }));
-
-this.set('queryProcessTabs', Ember.ArrayProxy.create({ content: Ember.A([
-  Ember.Object.create({
-name: Ember.I18n.t('menus.logs'),
-path: constants.namingConventions.subroutes.jobLogs
-  }),
-  Ember.Object.create({
-name: Ember.I18n.t('menus.results'),
-path: constants.namingConventions.subroutes.jobResults
-  }),
-  Ember.Object.create({
-name: Ember.I18n.t('menus.explain'),
-path: constants.namingConventions.subroutes.jobExplain
-  })
-])}));
-
-this.set('queryPanelActions', Ember.ArrayProxy.create({ content: Ember.A([
-  Ember.Object.create({
-icon: 'fa-expand',
-action: 'toggleDatabaseExplorerVisibility',
-tooltip: Ember.I18n.t('tooltips.expand')
-  })
-])}));
-  },
-
-  canExecute: function () {
-var isModelRunning = this.get('model.isRunning');
-var hasParams = this.get('queryParams.length');
-
-if (isModelRunning) {
-  return false;
-}
-
-if (hasParams) {
-  // all param have values?
-  return this.get('queryParams').every(function (param) { return 
param.value; });
-}
-
-return true;
-  }.property('model.isRunning', 

[15/23] ambari git commit: AMBARI-19302 : removed contrib/views/hive folder and made necessary changes in pom.xml files (nitirajrathore)

2016-12-28 Thread nitiraj
http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/app/components/input-header.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/input-header.js
 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/input-header.js
deleted file mode 100644
index 7ff5bf7..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/input-header.js
+++ /dev/null
@@ -1,61 +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.
- */
-
-import Ember from 'ember';
-
-export default Ember.Component.extend({
-  tagName: '',
-  dataTypes: null,
-  column: null,
-  precisionChanged: Ember.observer('column.precision', function () {
-var col = this.get('column');
-if( typeof col.precision !== 'number') {
-Ember.set(col, 'precision', Number(col.precision));
-  }
-  }),
-
-  scaleChanged: Ember.observer('column.scale', function () {
-var col = this.get('column');
-if( typeof col.scale !== 'number'){
-  Ember.set(col,'scale',Number(col.scale));
-}
-  }),
-
-  typeChanged: Ember.observer('column.type', function () {
-var col = this.get('column');
-
-var type = col.type;
-if( type != "DECIMAL" ){
-  Ember.set(col,'scale');
-}
-
-if(type != "VARCHAR" && type != "CHAR" && type != "DECIMAL" ){
-  Ember.set(col,'precision');
-}
-  }),
-
-  noPrecision: Ember.computed('column.type', function () {
-var type = this.get('column').type;
-return (type == "VARCHAR" || type == "CHAR" || type == "DECIMAL" ) ? false 
: true;
-  }),
-
-  noScale: Ember.computed('column.type', function () {
-return this.get('column').type == "DECIMAL" ? false : true;
-  })
-
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/app/components/job-tr-view.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/job-tr-view.js
 
b/contrib/views/hive/src/main/resources/ui/hive-web/app/components/job-tr-view.js
deleted file mode 100644
index f439ca2..000
--- 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/job-tr-view.js
+++ /dev/null
@@ -1,41 +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.
- */
-
-import Ember from 'ember';
-import constants from 'hive/utils/constants';
-import utils from 'hive/utils/functions';
-
-export default Ember.Component.extend({
-  tagName: '',
-
-  canStop: function () {
-return utils.insensitiveCompare(this.get('job.status'), 
constants.statuses.running, constants.statuses.initialized, 
constants.statuses.pending);
-  }.property('job.status'),
-
-  actions: {
-requestFile: function () {
-  this.toggleProperty('expanded');
-
-  this.sendAction('onFileRequested', this.get('job'));
-},
-
-stopJob: function () {
-  this.sendAction('onStopJob', this.get('job'));
-}
-  }
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/c0f9621f/contrib/views/hive/src/main/resources/ui/hive-web/app/components/modal-widget.js
--
diff --git 
a/contrib/views/hive/src/main/resources/ui/hive-web/app/components/modal-widget.js