You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by mi...@apache.org on 2016/09/03 00:58:25 UTC

[1/2] ambari git commit: AMBARI-18297: Add View for Apache HAWQ (Stuart Pollock via mithmatt)

Repository: ambari
Updated Branches:
  refs/heads/trunk 58b48a17e -> a6b96f835


http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/tests/integration/components/query-table-test.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/tests/integration/components/query-table-test.js b/contrib/views/hawq/src/main/resources/ui/tests/integration/components/query-table-test.js
new file mode 100644
index 0000000..e02f8fd
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/tests/integration/components/query-table-test.js
@@ -0,0 +1,112 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+import { moduleForComponent, test } from 'ember-qunit';
+import hbs from 'htmlbars-inline-precompile';
+import { makeQueryObjects } from 'hawq-view/tests/helpers/test-helper';
+
+/*jshint node:true*/
+
+moduleForComponent('query-table', 'Integration | Component | query table', {
+  integration: true
+});
+
+test('it renders a table with mock data', function (assert) {
+  let model = makeQueryObjects();
+  this.set('model', model);
+
+  this.render(hbs`{{query-table queries=model}}`);
+
+  // Test Column Titles
+  assert.equal(this.$('table#query-table').length, 1);
+  assert.equal(this.$('thead#query-table-header').length, 1);
+  assert.equal(this.$('tr#query-table-header-row').length, 1);
+  assert.equal(this.$('th#query-table-header-pid').text(), 'PID');
+  assert.equal(this.$('th#query-table-header-status').text(), 'Status');
+  assert.equal(this.$('th#query-table-header-username').text(), 'User');
+  assert.equal(this.$('th#query-table-header-databasename').text(), 'Database');
+  assert.equal(this.$('th#query-table-header-submittime').text(), 'Submit Time');
+  assert.equal(this.$('th#query-table-header-duration').text(), 'Duration');
+  assert.equal(this.$('th#query-table-header-clientaddress').text(), 'Client');
+
+  // Test Rows
+  assert.equal(this.$('tbody#query-table-body').length, 1);
+  assert.equal(this.$('tr#query-table-row0').length, 1);
+  assert.equal(this.$('td#query-table-row0-pid').text(), model[0].get('pid'));
+  let statusDOM = this.$('td#query-table-row0-status');
+  assert.equal(statusDOM.text(), model[0].get('status'));
+  assert.ok(statusDOM.attr('class').match(model[0].get('statusClass')));
+  assert.equal(this.$('td#query-table-row0-username').text(), model[0].get('userName'));
+  assert.equal(this.$('td#query-table-row0-databasename').text(), model[0].get('databaseName'));
+  assert.equal(this.$('td#query-table-row0-submittime').text(), model[0].get('formattedQueryStartTime'));
+  assert.equal(this.$('td#query-table-row0-duration').text(), model[0].get('duration'));
+  assert.equal(this.$('td#query-table-row0-clientaddress').text(), model[0].get('clientAddress'));
+
+  assert.equal(this.$('tr#query-table-row1').length, 1);
+  assert.ok(this.$('td#query-table-row1-status').attr('class').match(model[1].get('statusClass')));
+
+  assert.equal(this.$('tr#query-table-row2').length, 1);
+  assert.ok(this.$('td#query-table-row2-status').attr('class').match(model[2].get('statusClass')));
+
+  assert.equal(this.$('tr#query-table-row3').length, 0);
+});
+
+function testColumnSort(_this, assert, columnHeaderSelector, expectedRows) {
+  let model = makeQueryObjects();
+  _this.set('model', model);
+
+  _this.render(hbs`{{query-table queries=model}}`);
+  Ember.$.bootstrapSortable(false);
+
+  // Ascending order
+  _this.$(columnHeaderSelector).click();
+  let ascendingRows = this.$('tbody').find('tr');
+
+  assert.equal(expectedRows.length, ascendingRows.length);
+
+  for (let i = 0, ii = expectedRows.length; i < ii; ++i) {
+    assert.equal(ascendingRows[i].getAttribute('id'), expectedRows[i]);
+  }
+
+  // Descending order
+  _this.$(columnHeaderSelector).click();
+  let descendingRows = this.$('tbody').find('tr');
+
+  assert.equal(expectedRows.length, ascendingRows.length);
+
+  for (let i = 0, ii = expectedRows.length; i < ii; ++i) {
+    assert.equal(descendingRows[i].getAttribute('id'), expectedRows[ii - i - 1]);
+  }
+}
+
+test('Clicking on the "Duration" column header toggles the sorting order of the elements of the column', function (assert) {
+  let expectedRows = [
+    'query-table-row2',
+    'query-table-row1',
+    'query-table-row0'
+  ];
+
+  testColumnSort(this, assert, 'th#query-table-header-duration', expectedRows);
+});
+
+test('Display text if there are no queries', function (assert) {
+  this.render(hbs`{{query-table}}`);
+
+  assert.equal(this.$('tr#no-queries').length, 1);
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/tests/test-helper.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/tests/test-helper.js b/contrib/views/hawq/src/main/resources/ui/tests/test-helper.js
new file mode 100644
index 0000000..96975ee
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/tests/test-helper.js
@@ -0,0 +1,24 @@
+/**
+ * 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 resolver from './helpers/resolver';
+import {
+  setResolver
+} from 'ember-qunit';
+
+setResolver(resolver);

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/tests/unit/adapters/query-test.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/tests/unit/adapters/query-test.js b/contrib/views/hawq/src/main/resources/ui/tests/unit/adapters/query-test.js
new file mode 100644
index 0000000..bab0260
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/tests/unit/adapters/query-test.js
@@ -0,0 +1,38 @@
+/**
+ * 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*/
+/* global sinon */
+
+import { moduleFor, test } from 'ember-qunit';
+import Utils from 'hawq-view/utils/utils';
+
+moduleFor('adapter:query', 'Unit | Adapter | query', {
+  // Specify the other units that are required for this test.
+  // needs: ['serializer:foo']
+});
+
+test('has the right namespace for testing', function(assert) {
+  assert.expect(0);
+  let spy = sinon.spy(Utils, 'getNamespace');
+  let adapter = this.subject();
+  adapter.get('namespace');
+
+  sinon.assert.calledOnce(spy);
+  Utils.getNamespace.restore();
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/tests/unit/models/query-test.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/tests/unit/models/query-test.js b/contrib/views/hawq/src/main/resources/ui/tests/unit/models/query-test.js
new file mode 100644
index 0000000..b83130e
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/tests/unit/models/query-test.js
@@ -0,0 +1,58 @@
+/**
+ * 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*/
+/* global sinon */
+
+import { moduleForModel, test } from 'ember-qunit';
+import Utils from 'hawq-view/utils/utils';
+
+moduleForModel('query', 'Unit | Model | query', {
+  // Specify the other units that are required for this test.
+  needs: []
+});
+
+test('#computeClientAddress called ', function(assert) {
+  assert.expect(0);
+  let options = {
+    clientHost: 'host',
+    clientPort: 7777
+  };
+  let model = this.subject(options);
+  var spy = sinon.spy(Utils, 'computeClientAddress');
+
+  model.get('clientAddress');
+  sinon.assert.calledOnce(spy);
+  sinon.assert.calledWith(spy, options.clientHost, options.clientPort);
+  Utils.computeClientAddress.restore();
+});
+
+test('#generateStatusString called', function(assert) {
+  assert.expect(0);
+  let options = {
+    waiting: false,
+    waitingResource: false
+  };
+  let model = this.subject(options);
+  var spy = sinon.spy(Utils, 'generateStatusString');
+
+  model.get('status');
+  sinon.assert.calledOnce(spy);
+  sinon.assert.calledWith(spy, options.waiting, options.waitingResource);
+  Utils.generateStatusString.restore();
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/tests/unit/routes/main-test.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/tests/unit/routes/main-test.js b/contrib/views/hawq/src/main/resources/ui/tests/unit/routes/main-test.js
new file mode 100644
index 0000000..7ad0b79
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/tests/unit/routes/main-test.js
@@ -0,0 +1,29 @@
+/**
+ * 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 { moduleFor, test } from 'ember-qunit';
+
+moduleFor('route:main', 'Unit | Route | main', {
+  // Specify the other units that are required for this test.
+  // needs: ['controller:foo']
+});
+
+test('it exists', function(assert) {
+  let route = this.subject();
+  assert.ok(route);
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/tests/unit/serializers/query-test.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/tests/unit/serializers/query-test.js b/contrib/views/hawq/src/main/resources/ui/tests/unit/serializers/query-test.js
new file mode 100644
index 0000000..6cd5f88
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/tests/unit/serializers/query-test.js
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { moduleForModel, test } from 'ember-qunit';
+import Pretender from 'pretender';
+import { getMockPayload } from 'hawq-view/tests/helpers/test-helper';
+
+var mockPayload = getMockPayload();
+let server;
+
+moduleForModel('query', 'Unit | Serializer | query', {
+  // Specify the other units that are required for this test.
+  needs: ['serializer:query'],
+  beforeEach() {
+    server = new Pretender(function() {
+      this.get('/queries', function() {
+        return [200, {'Content-Type': 'application/json'}, JSON.stringify(mockPayload)];
+      });
+    });
+  },
+
+  afterEach() {
+    server.shutdown();
+  }
+});
+
+// Replace this with your real tests.
+test('it serializes records', function(assert) {
+  let record = this.subject();
+  let serializedRecord = record.serialize();
+  assert.ok(serializedRecord);
+});
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/tests/unit/utils/utils-test.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/tests/unit/utils/utils-test.js b/contrib/views/hawq/src/main/resources/ui/tests/unit/utils/utils-test.js
new file mode 100644
index 0000000..969ee6d
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/tests/unit/utils/utils-test.js
@@ -0,0 +1,105 @@
+/**
+ * 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*/
+/* global sinon */
+
+import Utils from 'hawq-view/utils/utils';
+import { module, test } from 'qunit';
+import ENV from 'hawq-view/config/environment';
+
+module('Unit | Utility | utils');
+
+test('#formatTimeOfDay: extracts time of day from a string', function(assert) {
+  assert.equal(Utils.formatTimeOfDay('2016-02-16T16:41:13'), '16:41:13');
+});
+
+// TODO:  make this TZ-independent for testing purposes
+//test('#formatTimeOfDay: extracts time of day from a string, in the local time zone', function(assert) {
+//  assert.equal(Utils.formatTimeOfDay('2016-02-17T00:41:13+00:00'), '16:41:13');
+//});
+
+test('#formatTimeDelta: extracts time difference between two date strings', function(assert) {
+  var spy = sinon.spy(Utils, 'calculateTimeDelta');
+  let backendStartTime = '2016-02-17T00:41:13-08:00';
+  let queryStartTime = '2016-02-17T01:43:43-08:00';
+  assert.equal(Utils.formatTimeDelta(backendStartTime, queryStartTime).text, '1h 2m 30s');
+  sinon.assert.calledOnce(spy);
+  sinon.assert.calledWith(spy, backendStartTime, queryStartTime);
+  Utils.calculateTimeDelta.restore();
+});
+
+test('#formatTimeDelta: shows "0m 0s" for two identical times', function(assert) {
+  var response = Utils.formatTimeDelta('2016-02-17T00:41:13-08:00', '2016-02-17T00:41:13-08:00');
+  assert.equal(response.text, '0s');
+  assert.equal(response.value, 0);
+});
+
+test('#formatTimeDelta: shows "0m 0s" for the second time being earlier than the first', function(assert) {
+  var response = Utils.formatTimeDelta('2016-02-17T00:45:13-08:00', '2016-02-17T00:41:13-08:00');
+  assert.equal(response.text, '0s');
+  assert.equal(response.value, 0);
+});
+
+test('#computeClientAddress: compute clientAddress', function(assert) {
+  assert.equal(Utils.computeClientAddress('host', '9999'), 'host:9999');
+});
+
+test('#computeClientAddress: computed host address', function(assert) {
+  assert.equal(Utils.computeClientAddress('host', 7777), 'host:7777', 'invalid computed client address');
+});
+
+test('#computeClientAddress: computed host address, -1 port', function(assert) {
+  assert.equal(Utils.computeClientAddress('host', -1), 'local', 'invalid computed client address');
+});
+
+test('#computeClientAddress: computed host address, Undefined/Null/Empty Host', function(assert) {
+  assert.equal(Utils.computeClientAddress(undefined, 7777), 'local', 'Invalid hostname: Undefined clientHost');
+  assert.equal(Utils.computeClientAddress( null, 7777), 'local', 'Invalid hostname: Null clientHost');
+  assert.equal(Utils.computeClientAddress('', 7777), 'local', 'Invalid hostname: Empty clientHost');
+});
+
+test('#getNamespace returns namespace for testing', function(assert) {
+  assert.equal(Utils.getNamespace(), ENV.apiURL);
+});
+
+test('#getNamespace returns namespace for production', function(assert) {
+  var baseNamespace = 'foo/';
+  var oldEnvironment = ENV.environment;
+  ENV.environment = 'production';
+  sinon.stub(Utils, 'getWindowPathname').returns(baseNamespace);
+  assert.equal(Utils.getNamespace(), baseNamespace + ENV.apiURL);
+  Utils.getWindowPathname.restore();
+  ENV.environment = oldEnvironment;
+});
+
+test('#generateStatusString returns "Running" when waiting and waitingResource are both false', function(assert) {
+  assert.equal(Utils.generateStatusString(false, false), 'Running');
+});
+
+test('#generateStatusString returns "Waiting on Lock" when waiting is true', function(assert) {
+  assert.equal(Utils.generateStatusString(true, false), 'Waiting on Lock');
+});
+
+test('#generateStatusString returns "Queued" when waitingResource is true', function(assert) {
+  assert.equal(Utils.generateStatusString(true, true), 'Queued');
+});
+
+test('#calculateTimeDelta returns difference between two time objects', function(assert) {
+  assert.equal(Utils.calculateTimeDelta('2016-02-17T00:41:13-08:00', '2016-02-17T11:52:24-08:00'), 40271000);
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/vendor/.gitkeep
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/vendor/.gitkeep b/contrib/views/hawq/src/main/resources/ui/vendor/.gitkeep
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/view.xml
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/view.xml b/contrib/views/hawq/src/main/resources/view.xml
new file mode 100644
index 0000000..1421c27
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/view.xml
@@ -0,0 +1,25 @@
+<!--
+   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>
+    <name>HAWQ</name>
+    <label>HAWQ</label>
+    <version>1.0.0</version>
+    <build>${env.BUILD_NUMBER}</build>
+
+    <min-ambari-version>2.2.*</min-ambari-version>
+
+</view>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/views/pom.xml b/contrib/views/pom.xml
index 2370d35..39560b5 100644
--- a/contrib/views/pom.xml
+++ b/contrib/views/pom.xml
@@ -42,6 +42,7 @@
     <module>slider</module>
     <module>capacity-scheduler</module>
     <module>tez</module>
+    <module>hawq</module>
     <module>storm</module>
     <module>zeppelin</module>
     <module>hueambarimigration</module>


[2/2] ambari git commit: AMBARI-18297: Add View for Apache HAWQ (Stuart Pollock via mithmatt)

Posted by mi...@apache.org.
AMBARI-18297: Add View for Apache HAWQ (Stuart Pollock via mithmatt)


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

Branch: refs/heads/trunk
Commit: a6b96f835db0326cb448f4b215074055ba93bfa5
Parents: 58b48a1
Author: Matt <mm...@pivotal.io>
Authored: Fri Sep 2 17:58:13 2016 -0700
Committer: Matt <mm...@pivotal.io>
Committed: Fri Sep 2 17:58:13 2016 -0700

----------------------------------------------------------------------
 contrib/views/hawq/.gitignore                   |  19 ++
 contrib/views/hawq/README.md                    | 100 +++++++++++
 contrib/views/hawq/pom.xml                      | 176 +++++++++++++++++++
 .../ambari/view/hawq/HAWQViewServlet.java       | 109 ++++++++++++
 .../hawq/src/main/resources/WEB-INF/web.xml     |  37 ++++
 .../views/hawq/src/main/resources/ui/.bowerrc   |   4 +
 .../hawq/src/main/resources/ui/.editorconfig    |  34 ++++
 .../views/hawq/src/main/resources/ui/.ember-cli |  27 +++
 .../views/hawq/src/main/resources/ui/.gitignore |  19 ++
 .../views/hawq/src/main/resources/ui/.jshintrc  |  32 ++++
 .../src/main/resources/ui/app/adapters/query.js |  27 +++
 .../views/hawq/src/main/resources/ui/app/app.js |  36 ++++
 .../resources/ui/app/components/query-table.js  |  28 +++
 .../main/resources/ui/app/controllers/.gitkeep  |   0
 .../src/main/resources/ui/app/helpers/.gitkeep  |   0
 .../hawq/src/main/resources/ui/app/index.html   |  42 +++++
 .../src/main/resources/ui/app/models/query.js   |  47 +++++
 .../hawq/src/main/resources/ui/app/resolver.js  |  21 +++
 .../hawq/src/main/resources/ui/app/router.js    |  30 ++++
 .../main/resources/ui/app/routes/application.js |  23 +++
 .../src/main/resources/ui/app/routes/main.js    |  49 ++++++
 .../main/resources/ui/app/serializers/query.js  |  25 +++
 .../src/main/resources/ui/app/styles/app.scss   |  57 ++++++
 .../resources/ui/app/templates/application.hbs  |  22 +++
 .../ui/app/templates/components/query-table.hbs |  59 +++++++
 .../main/resources/ui/app/templates/main.hbs    |  20 +++
 .../src/main/resources/ui/app/utils/utils.js    |  78 ++++++++
 .../views/hawq/src/main/resources/ui/bower.json |  14 ++
 .../src/main/resources/ui/config/environment.js |  69 ++++++++
 .../src/main/resources/ui/ember-cli-build.js    |  51 ++++++
 .../hawq/src/main/resources/ui/package.json     |  49 ++++++
 .../resources/ui/public/assets/logo-hawq.png    | Bin 0 -> 1897 bytes
 .../views/hawq/src/main/resources/ui/testem.js  |  33 ++++
 .../hawq/src/main/resources/ui/tests/.jshintrc  |  52 ++++++
 .../ui/tests/acceptance/application-test.js     |  55 ++++++
 .../resources/ui/tests/helpers/destroy-app.js   |  23 +++
 .../ui/tests/helpers/module-for-acceptance.js   |  52 ++++++
 .../main/resources/ui/tests/helpers/resolver.js |  29 +++
 .../resources/ui/tests/helpers/start-app.js     |  36 ++++
 .../resources/ui/tests/helpers/test-helper.js   | 118 +++++++++++++
 .../hawq/src/main/resources/ui/tests/index.html |  51 ++++++
 .../integration/components/query-table-test.js  | 112 ++++++++++++
 .../src/main/resources/ui/tests/test-helper.js  |  24 +++
 .../ui/tests/unit/adapters/query-test.js        |  38 ++++
 .../ui/tests/unit/models/query-test.js          |  58 ++++++
 .../resources/ui/tests/unit/routes/main-test.js |  29 +++
 .../ui/tests/unit/serializers/query-test.js     |  48 +++++
 .../resources/ui/tests/unit/utils/utils-test.js | 105 +++++++++++
 .../hawq/src/main/resources/ui/vendor/.gitkeep  |   0
 contrib/views/hawq/src/main/resources/view.xml  |  25 +++
 contrib/views/pom.xml                           |   1 +
 51 files changed, 2193 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/.gitignore
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/.gitignore b/contrib/views/hawq/.gitignore
new file mode 100644
index 0000000..f70c208
--- /dev/null
+++ b/contrib/views/hawq/.gitignore
@@ -0,0 +1,19 @@
+# Numerous always-ignore extensions
+*.swp
+*.bak
+*.log
+
+# OS or Editor folders
+.DS_Store
+
+# Installation and build tools
+node/
+node_modules/
+bower_components/
+_generators/
+
+# Output directory
+dist/
+
+# Brunch folder for temporary files.
+tmp/

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/README.md
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/README.md b/contrib/views/hawq/README.md
new file mode 100644
index 0000000..b8b51ba
--- /dev/null
+++ b/contrib/views/hawq/README.md
@@ -0,0 +1,100 @@
+[](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.)
+# HAWQ Monitoring View for Ambari
+This view provides a UI to monitor HAWQ queries.
+
+### Overview and Examples
+You may find instructive the [Ambari Views Overview], which demonstrates how Ambari uses third-party views and how to create your own view. [Here][view example] you may find a view example.
+
+### Build All Views (must be done at least once)
+```sh
+cd $AMBARI_DIR/contrib/views
+mvn install -DskipTests
+```
+
+### Build HAWQ View
+```sh
+cd $AMBARI_DIR/contrib/views/hawq
+mvn install [-DskipTests]
+```
+
+### Setting-Up The Enviornment
+In order to prepare a vagrant environment, firstly follow the instructions in the [Ambari Dev Quick Start Guide].
+
+### Deploy JAR file
+```sh
+vagrant ssh <Ambari Server Host>
+sudo -i
+ln -s /vagrant/ambari/contrib/views/hawq/target/hawq-view-X.Y.Z.Q-SNAPSHOT.jar /var/lib/ambari-server/resources/views/hawq-view-X.Y.Z.Q-SNAPSHOT.jar
+ambari-server restart
+```
+- Create an instance of view from \u201cManage Ambari\u201d category in Ambari.
+
+If you wish to overwrite an installation of a view, then enter the vagrant box as root and
+```sh
+rm -rf /var/lib/ambari-server/resources/views/work/HAWQ\{X.Y.Z\}
+```
+(note that there is no trailing `/`) before restarting the Ambari server.  If you have made changes to the view, and those changes have not been reflected in the UI, then create a temporary throwaway view.  This may prompt Ambari to remove any stale references to the old view JAR in place of what you have just uploaded.
+
+### Ember Development
+The Hawq Monitoring View has been implemented using Ember 2.4.2; the tooling framework relies on Node 4.3.2.  There are a number of tools which you may need to install locally, starting with `nvm` (Node Version Manager).  You may wish to install the following tools while located in `$AMBARI_DIR`:
+
+```sh
+nvm install 4.3.2
+nvm use 4.3.2
+npm install ember-cli
+```
+
+This set of tools should allow you to use the Ember CLI tools for creating stub-files for controllers, routes, models, etc., in addition to `ember` for compiling and testing.  At the moment, `npm build`, `npm start`, and `npm test` all invoke the `ember` CLI tool.
+
+### Local Javascript testing without the overhead of Maven
+To do iterative unit testing while coding, firstly make a build using maven.  Afterward,
+```sh
+cd $AMBARI_DIR/contrib/views/hawq/src/main/resources/ui/
+npm start # To continuously test that your code compiles
+```
+and, when you want to test the code, open another terminal and
+```sh
+npm test
+```
+
+### Ambari Versions
+Be careful when moving this code from branch to branch:  the Ambari version referenced in pom.xml must match the branch.  You may have to reference other views (e.g. hive or pig) in the destination branch to get some idea of what you must change.
+
+### Debug Setup
+On the machine hosting vagrant:
+```sh
+vagrant ssh <Ambari Server Host>
+sudo -i
+cd /var/lib/ambari-server/resources/views/work  # if this directory does not exist, you have not started ambari-server; run "ambari-server start" to start it
+rm -rf HAWQ\{X.Y.Z\}
+ln -s /vagrant/ambari/contrib/views/hawq/src/main/resources/ui/dist HAWQ\{X.Y.Z\}
+ln -s /vagrant/ambari/contrib/views/hawq/target/classes/org/ HAWQ\{X.Y.Z\}/org
+ln -s /vagrant/ambari/contrib/views/hawq/target/classes/WEB-INF/ HAWQ\{X.Y.Z\}/WEB-INF
+ln -s /vagrant/ambari/contrib/views/hawq/src/main/resources/view.xml HAWQ\{X.Y.Z\}/view.xml
+ambari-server restart
+```
+
+Note:  if you want to remove the symbolic link `/var/lib/ambari-server/resources/views/work/HAWQ\{X.Y.Z\}`, use `rm` and not `rm -rf`.
+
+### Incremental Builds For Java Proxy
+The symbolic links generated in the Debug Setup section allow for the incremental updating of the Java proxy.  Each build with `mvn` deletes the symlinks from Debug Setup.  They must be recreated, and then the Ambari server must be restarted.  Additionally, each invocation of `npm start` or `ember serve` will destroy the links and require them to be recreated using the instructions in Debug Setup.  However, while the local Ember server is runnig, the links will not be removed by the server.
+
+[//]: #
+
+[ambari views overview]: <http://www.slideshare.net/hortonworks/ambari-views-overview>
+[view example]: <https://github.com/apache/ambari/blob/trunk/ambari-views/examples/helloworld-view/docs/index.md>
+[ambari dev quick start guide]: <https://cwiki.apache.org/confluence/display/AMBARI/Quick+Start+Guide>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/pom.xml b/contrib/views/hawq/pom.xml
new file mode 100644
index 0000000..9a563f6
--- /dev/null
+++ b/contrib/views/hawq/pom.xml
@@ -0,0 +1,176 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.ambari.contrib.views</groupId>
+  <artifactId>hawq-view</artifactId>
+  <version>1.0.0.0-SNAPSHOT</version>
+  <name>HAWQ</name>
+  <parent>
+    <groupId>org.apache.ambari.contrib.views</groupId>
+    <artifactId>ambari-contrib-views</artifactId>
+    <version>2.0.0.0-SNAPSHOT</version>
+  </parent>
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>servlet-api</artifactId>
+      <version>2.5</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+
+  <properties>
+    <ambari.dir>${project.parent.parent.parent.basedir}</ambari.dir>
+    <ui.dir>${basedir}/src/main/resources/ui</ui.dir>
+    <hawq-version>1.0.0</hawq-version>
+    <ambari.version>2.0.0.0-SNAPSHOT</ambari.version>
+    <envClassifier>linux</envClassifier>
+    <dirsep>/</dirsep>
+    <executable.node>node</executable.node>
+    <executable.npm>npm</executable.npm>
+    <args.npm></args.npm>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <!-- Cleanup ui files -->
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-clean-plugin</artifactId>
+        <version>2.5</version>
+        <configuration>
+          <filesets>
+            <fileset>
+              <directory>${ui.dir}</directory>
+              <followSymlinks>false</followSymlinks>
+              <includes>
+                <include>dist/**</include>
+                <include>tmp/**</include>
+                <include>node/**</include>
+                <include>node_modules/**</include>
+                <include>bower_components/**</include>
+              </includes>
+              <excludes>
+                <exclude>dist/view.xml</exclude>
+                <exclude>dist/WEB-INF</exclude>
+                <exclude>dist/org</exclude>
+              </excludes>
+            </fileset>
+          </filesets>
+        </configuration>
+      </plugin>
+  <!-- Building frontend -->
+      <plugin>
+        <groupId>com.github.eirslett</groupId>
+        <artifactId>frontend-maven-plugin</artifactId>
+        <configuration>
+          <nodeVersion>v0.10.44</nodeVersion>
+          <npmVersion>2.15.0</npmVersion>
+          <workingDirectory>${ui.dir}</workingDirectory>
+        </configuration>
+        <executions>
+          <execution>
+            <id>install node and npm</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>install-node-and-npm</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>npm install</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>npm</goal>
+            </goals>
+            <configuration>
+              <arguments>install --unsafe-perm</arguments>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>exec-maven-plugin</artifactId>
+        <version>1.3.2</version>
+        <executions>
+          <execution>
+            <id>HAWQ View build</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>exec</goal>
+            </goals>
+            <configuration>
+              <workingDirectory>${ui.dir}</workingDirectory>
+              <executable>node/node</executable>
+              <arguments>
+                <argument>node_modules/.bin/ember</argument>
+                <argument>build</argument>
+                <argument>--environment=production</argument>
+              </arguments>
+            </configuration>
+          </execution>
+          <execution>
+            <id>HAWQ View Javascript Tests</id>
+            <phase>test</phase>
+            <goals>
+              <goal>exec</goal>
+            </goals>
+            <configuration>
+              <skip>${skipTests}</skip>
+              <executable>${executable.npm}</executable>
+              <workingDirectory>${ui.dir}</workingDirectory>
+              <commandlineArgs>${args.npm} test</commandlineArgs>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+    <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+        <filtering>false</filtering>
+        <includes>
+          <include>view.xml</include>
+          <include>WEB-INF/**</include>
+        </includes>
+      </resource>
+      <resource>
+        <directory>${ui.dir}/dist</directory>
+        <filtering>false</filtering>
+        <includes>
+          <include>index.html</include>
+          <include>crossdomain.xml</include>
+          <include>robots.txt</include>
+          <include>assets/**/*</include>
+        </includes>
+        <excludes>
+          <exclude>assets/**/test*.*</exclude>
+          <exclude>assets/*.map</exclude>
+          <exclude>assets/passed.png</exclude>
+          <exclude>assets/failed.png</exclude>
+        </excludes>
+      </resource>
+    </resources>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/java/org/apache/ambari/view/hawq/HAWQViewServlet.java
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/java/org/apache/ambari/view/hawq/HAWQViewServlet.java b/contrib/views/hawq/src/main/java/org/apache/ambari/view/hawq/HAWQViewServlet.java
new file mode 100644
index 0000000..4202eef
--- /dev/null
+++ b/contrib/views/hawq/src/main/java/org/apache/ambari/view/hawq/HAWQViewServlet.java
@@ -0,0 +1,109 @@
+/**
+ * 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.hawq;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.TimeZone;
+import java.util.Random;
+
+/**
+ * Servlet for HAWQ Queries list view.
+ */
+public class HAWQViewServlet extends HttpServlet {
+
+  @Override
+  protected void doGet(HttpServletRequest request, HttpServletResponse response)
+      throws ServletException, IOException {
+    // TODO use constant
+    response.setContentType("application/json");
+    response.setStatus(HttpServletResponse.SC_OK);
+
+    Random randNo = new Random();
+
+    TimeZone timeZone = TimeZone.getTimeZone("PST");
+    DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
+    df.setTimeZone(timeZone);
+
+    StringBuilder responseString = new StringBuilder("{ \"data\": [");
+
+    String[] databaseNames = {"gpadmin", "postgres", "template1", "template2", "employee", "users", "payroll", "taxes", "benefits", "projects"};
+    String[] userNames = {"newton aLex", "alex DeniSSov", "v", "jun", "bhuvNeshChaudhary", "laVjAiN", "m@tt", "5Z", "gt"};
+    String[] clientHosts = {"c6401.ambari.apache.org", "c6402.ambari.apache.org", "c6403.ambari.apache.org", "c6404.ambari.apache.org", "c6405.ambari.apache.org"};
+    String[] applicationNames = {"hawq", "psql", "tableau", "excel", "hbase", "hive"};
+    String[] duration = {"00:00:00", "02:01:00", "03:04:00"};
+
+    int distribution = randNo.nextInt(3);
+    int maxNoOfQUeries = 100;
+    int noOfQueries = 0;
+
+    switch(distribution) {
+        case 0:
+            noOfQueries = 0;
+            break;
+        case 2:
+            noOfQueries = maxNoOfQUeries;
+            break;
+        case 1:
+        default:
+            noOfQueries = randNo.nextInt(maxNoOfQUeries);
+    }
+
+    int index = 1;
+    long currTime = System.currentTimeMillis() / 1000;
+
+    while(index <= noOfQueries) {
+        long queryStartTime = currTime - (randNo.nextInt(55000) + 1) * 1000;
+        long transactionStartTime = queryStartTime - (randNo.nextInt(40000) + 1) * 1000;
+        long backendStartTime = transactionStartTime - (randNo.nextInt(100000) + 1) * 1000;
+
+        String query = "{"+
+            "    \"id\": " + (index++) + ","+
+            "    \"type\": \"query\","+
+            "    \"attributes\": {"+
+            "      \"database-name\": \"" + databaseNames[randNo.nextInt(databaseNames.length)] + "\","+
+            "      \"pid\": " + (randNo.nextInt(99999) + 1) + ","+
+            "      \"user-name\": \"" + userNames[randNo.nextInt(userNames.length)] + "\","+
+            "      \"waiting\": " + randNo.nextBoolean() + ","+
+            "      \"waiting-resource\": " + randNo.nextBoolean() + ","+
+            "      \"duration\": \"" + duration[randNo.nextInt(duration.length)] + "\","+
+            "      \"query-start-time\": \"" + df.format(queryStartTime) + "\","+
+            "      \"transaction-start-time\": \"" + df.format(transactionStartTime) + "\","+
+            "      \"client-host\": \"" + clientHosts[randNo.nextInt(clientHosts.length)] + "\","+
+            "      \"client-port\": \"" + (randNo.nextInt(99999) + 1) + "\","+
+            "      \"application-name\": \"" + applicationNames[randNo.nextInt(applicationNames.length)] + "\""+
+            "    }"+
+            "  }";
+
+        responseString.append(query).append(index <= noOfQueries ? "," : "");
+    }
+
+    responseString.append("]}");
+
+    PrintWriter writer = response.getWriter();
+    writer.print(responseString.toString());
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/WEB-INF/web.xml b/contrib/views/hawq/src/main/resources/WEB-INF/web.xml
new file mode 100644
index 0000000..e12f314
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/WEB-INF/web.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+
+<!--
+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. Kerberos, LDAP, Custom. Binary/Htt
+-->
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+         version="2.4">
+
+    <display-name>HAWQ View</display-name>
+    <description>
+        This is the HAWQ View application.
+    </description>
+    <servlet>
+        <servlet-name>HAWQViewServlet</servlet-name>
+        <servlet-class>org.apache.ambari.view.hawq.HAWQViewServlet</servlet-class>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>HAWQViewServlet</servlet-name>
+        <url-pattern>/api/v1/*</url-pattern><!-- TODO let's be specific like /queries, or specify PATH in HAWQViewServlet.java -->
+    </servlet-mapping>
+</web-app>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/.bowerrc
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/.bowerrc b/contrib/views/hawq/src/main/resources/ui/.bowerrc
new file mode 100644
index 0000000..959e169
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/.bowerrc
@@ -0,0 +1,4 @@
+{
+  "directory": "bower_components",
+  "analytics": false
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/.editorconfig
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/.editorconfig b/contrib/views/hawq/src/main/resources/ui/.editorconfig
new file mode 100644
index 0000000..47c5438
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/.editorconfig
@@ -0,0 +1,34 @@
+# EditorConfig helps developers define and maintain consistent
+# coding styles between different editors and IDEs
+# editorconfig.org
+
+root = true
+
+
+[*]
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+indent_style = space
+indent_size = 2
+
+[*.js]
+indent_style = space
+indent_size = 2
+
+[*.hbs]
+insert_final_newline = false
+indent_style = space
+indent_size = 2
+
+[*.css]
+indent_style = space
+indent_size = 2
+
+[*.html]
+indent_style = space
+indent_size = 2
+
+[*.{diff,md}]
+trim_trailing_whitespace = false

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/.ember-cli
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/.ember-cli b/contrib/views/hawq/src/main/resources/ui/.ember-cli
new file mode 100644
index 0000000..5a339b9
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/.ember-cli
@@ -0,0 +1,27 @@
+/**
+ * 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.
+ */
+
+{
+  /**
+    Ember CLI sends analytics information by default. The data is completely
+    anonymous, but there are times when you might want to disable this behavior.
+
+    Setting `disableAnalytics` to true will prevent any data from being sent.
+  */
+  "disableAnalytics": false
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/.gitignore
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/.gitignore b/contrib/views/hawq/src/main/resources/ui/.gitignore
new file mode 100644
index 0000000..96783f5
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/.gitignore
@@ -0,0 +1,19 @@
+# See http://help.github.com/ignore-files/ for more about ignoring files.
+
+# compiled output
+/dist
+/tmp
+
+# dependencies
+/node_modules
+/bower_components
+
+# misc
+/.sass-cache
+/connect.lock
+/coverage/*
+/libpeerconnection.log
+npm-debug.log
+testem.log
+
+.watchmanconfig

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/.jshintrc
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/.jshintrc b/contrib/views/hawq/src/main/resources/ui/.jshintrc
new file mode 100644
index 0000000..08096ef
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/.jshintrc
@@ -0,0 +1,32 @@
+{
+  "predef": [
+    "document",
+    "window",
+    "-Promise"
+  ],
+  "browser": true,
+  "boss": true,
+  "curly": true,
+  "debug": false,
+  "devel": true,
+  "eqeqeq": true,
+  "evil": true,
+  "forin": false,
+  "immed": false,
+  "laxbreak": false,
+  "newcap": true,
+  "noarg": true,
+  "noempty": false,
+  "nonew": false,
+  "nomen": false,
+  "onevar": false,
+  "plusplus": false,
+  "regexp": false,
+  "undef": true,
+  "sub": true,
+  "strict": false,
+  "white": false,
+  "eqnull": true,
+  "esnext": true,
+  "unused": true
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/adapters/query.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/adapters/query.js b/contrib/views/hawq/src/main/resources/ui/app/adapters/query.js
new file mode 100644
index 0000000..f82c00d
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/app/adapters/query.js
@@ -0,0 +1,27 @@
+/**
+ * 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 DS from 'ember-data';
+import Utils from 'hawq-view/utils/utils';
+
+export default DS.JSONAPIAdapter.extend({
+  namespace: Ember.computed(function() {
+    return Utils.getNamespace();
+  })
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/app.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/app.js b/contrib/views/hawq/src/main/resources/ui/app/app.js
new file mode 100644
index 0000000..af4fdc4
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/app/app.js
@@ -0,0 +1,36 @@
+/**
+ * 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 Resolver from './resolver';
+import loadInitializers from 'ember-load-initializers';
+import config from './config/environment';
+
+let App;
+
+Ember.MODEL_FACTORY_INJECTIONS = true;
+
+App = Ember.Application.extend({
+  modulePrefix: config.modulePrefix,
+  podModulePrefix: config.podModulePrefix,
+  Resolver
+});
+
+loadInitializers(App, config.modulePrefix);
+
+export default App;

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/components/query-table.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/components/query-table.js b/contrib/views/hawq/src/main/resources/ui/app/components/query-table.js
new file mode 100644
index 0000000..d28e2f2
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/app/components/query-table.js
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+  didRender() {
+    this._super(...arguments);
+    // Ember.$ is contextual == #bootstrapSortable is called by default but at too high a level within Ember
+    // (and Ambari) to find the table which it is supposed to modify.
+    Ember.$.bootstrapSortable(true);
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/controllers/.gitkeep
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/controllers/.gitkeep b/contrib/views/hawq/src/main/resources/ui/app/controllers/.gitkeep
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/helpers/.gitkeep
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/helpers/.gitkeep b/contrib/views/hawq/src/main/resources/ui/app/helpers/.gitkeep
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/index.html
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/index.html b/contrib/views/hawq/src/main/resources/ui/app/index.html
new file mode 100644
index 0000000..8867616
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/app/index.html
@@ -0,0 +1,42 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <title>HawqView</title>
+    <meta name="description" content="">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+
+    {{content-for "head"}}
+
+    <link rel="stylesheet" href="assets/vendor.css">
+    <link rel="stylesheet" href="assets/hawq-view.css">
+
+    {{content-for "head-footer"}}
+  </head>
+  <body>
+    {{content-for "body"}}
+
+    <script src="assets/vendor.js"></script>
+    <script src="assets/hawq-view.js"></script>
+
+    {{content-for "body-footer"}}
+  </body>
+</html>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/models/query.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/models/query.js b/contrib/views/hawq/src/main/resources/ui/app/models/query.js
new file mode 100644
index 0000000..5906c34
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/app/models/query.js
@@ -0,0 +1,47 @@
+/**
+ * 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 DS from 'ember-data';
+import Utils from 'hawq-view/utils/utils';
+
+export default DS.Model.extend({
+
+  databaseName:         DS.attr('string'),
+  pid:                  DS.attr('number'),
+  userName:             DS.attr('string'),
+  queryText:            DS.attr('string'),
+  waiting:              DS.attr('boolean'),
+  waitingResource:      DS.attr('boolean'),
+  duration:             DS.attr('string'),
+  queryStartTime:       DS.attr('date'),
+  clientHost:           DS.attr('string'),
+  clientPort:           DS.attr('number'),
+  applicationName:      DS.attr('string'),
+
+  clientAddress: Ember.computed('clientHost', 'clientPort', function() {
+    return Utils.computeClientAddress(this.get('clientHost'), this.get('clientPort'));
+  }),
+
+  status: Ember.computed('waiting', 'waitingResource', function() {
+    return Utils.generateStatusString(this.get('waiting'), this.get('waitingResource'));
+  }),
+  formattedQueryStartTime: Ember.computed('queryStartTime', function () {
+    return Utils.formatTimeOfDay(this.get('queryStartTime'));
+  })
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/resolver.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/resolver.js b/contrib/views/hawq/src/main/resources/ui/app/resolver.js
new file mode 100644
index 0000000..b9eabe4
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/app/resolver.js
@@ -0,0 +1,21 @@
+/**
+ * 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 Resolver from 'ember-resolver';
+
+export default Resolver;

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/router.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/router.js b/contrib/views/hawq/src/main/resources/ui/app/router.js
new file mode 100644
index 0000000..f058f78
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/app/router.js
@@ -0,0 +1,30 @@
+/**
+ * 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 config from './config/environment';
+
+const Router = Ember.Router.extend({
+  location: config.locationType
+});
+
+Router.map(function() {
+  this.route('main', { path: '/' });
+});
+
+export default Router;

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/routes/application.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/routes/application.js b/contrib/views/hawq/src/main/resources/ui/app/routes/application.js
new file mode 100644
index 0000000..4ad870b
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/app/routes/application.js
@@ -0,0 +1,23 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Route.extend({
+  model() {}
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/routes/main.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/routes/main.js b/contrib/views/hawq/src/main/resources/ui/app/routes/main.js
new file mode 100644
index 0000000..a05324a
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/app/routes/main.js
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+import ENV from 'hawq-view/config/environment';
+
+export default Ember.Route.extend({
+  model() {
+    return this.store.findAll('query');
+  },
+  setupController: function(controller, model) {
+    this._super(controller, model);
+    if(ENV.shouldPoll) {
+      this.startRefreshing();
+    }
+  },
+  startRefreshing: function() {
+    this.set('refreshing', true);
+    Ember.run.later(this, this.refresh, ENV.pollingInterval);
+  },
+  refresh: function() {
+    if(!this.get('refreshing')) {
+      return;
+    }
+    this.store.unloadAll('query');
+    this.store.findAll('query');
+    Ember.run.later(this, this.refresh, ENV.pollingInterval);
+  },
+  actions: {
+    willTransition: function() {
+      this.set('refreshing', false);
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/serializers/query.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/serializers/query.js b/contrib/views/hawq/src/main/resources/ui/app/serializers/query.js
new file mode 100644
index 0000000..9546da4
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/app/serializers/query.js
@@ -0,0 +1,25 @@
+/**
+ * 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.JSONAPISerializer.extend({
+  normalizeResponse() {
+    return this._super(...arguments);
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/styles/app.scss
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/styles/app.scss b/contrib/views/hawq/src/main/resources/ui/app/styles/app.scss
new file mode 100644
index 0000000..7470867
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/app/styles/app.scss
@@ -0,0 +1,57 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+@import './../../bower_components/bootstrap-sass/assets/stylesheets/_bootstrap.scss';
+
+$border-grey: #DDD;
+
+.container-fluid {
+  font-size: 14px;
+  text-align: left;
+
+  .panel .panel-heading {
+    font-size: 18px;
+    color: #606060;
+    font-weight: 500;
+  }
+
+  .hawq-logo {
+    height: 60px;
+    margin: 10px 0 20px 0;
+  }
+
+  .query-table-container .query-table {
+    .table-header {
+      background-color: #f5f5f5;
+    }
+    .no-queries {
+      text-align: center;
+    }
+  }
+}
+
+.pid-text {
+  font-weight: bold;
+}
+
+.green {
+  color: #6CC16F
+}
+
+.orange {
+  color: #FB7F00
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/templates/application.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/templates/application.hbs b/contrib/views/hawq/src/main/resources/ui/app/templates/application.hbs
new file mode 100644
index 0000000..4c831d1
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/app/templates/application.hbs
@@ -0,0 +1,22 @@
+{{!
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+}}
+
+<div class="container-fluid">
+  <img id="hawq-logo" class="hawq-logo" src="assets/logo-hawq.png" alt="HAWQ Monitor" title="HAWQ Monitor">
+  {{outlet}}
+</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/templates/components/query-table.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/templates/components/query-table.hbs b/contrib/views/hawq/src/main/resources/ui/app/templates/components/query-table.hbs
new file mode 100644
index 0000000..5af548a
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/app/templates/components/query-table.hbs
@@ -0,0 +1,59 @@
+{{!
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+}}
+
+
+<div class="panel panel-default query-table-container">
+  <!-- Default panel contents -->
+  <div class="panel-heading">Query Monitor</div>
+
+  <table id="query-table" class="table query-table sortable table-hover">
+    <thead id="query-table-header">
+    <tr id="query-table-header-row" class="table-header">
+      <th id="query-table-header-pid" data-defaultsort="asc">PID</th>
+      <th id="query-table-header-status">Status</th>
+      <th id="query-table-header-username">User</th>
+      <th id="query-table-header-databasename">Database</th>
+      <th id="query-table-header-submittime">Submit Time</th>
+      <th id="query-table-header-duration">Duration</th>
+      <th id="query-table-header-clientaddress">Client</th>
+    </tr>
+    </thead>
+
+    <tbody id="query-table-body">
+    {{#unless queries.length}}
+      <tr id="no-queries" class="no-queries">
+        <td colspan="8">No currently running or waiting queries</td>
+      </tr>
+    {{else}}
+      {{#each queries as |query index|}}
+        <tr id="query-table-row{{index}}">
+          <td id="query-table-row{{index}}-pid" class="pid-text">{{query.pid}}</td>
+          <td id="query-table-row{{index}}-status" class="{{if query.waitingResource '' (if query.waiting 'orange' 'green')}}">{{query.status}}</td>
+          <td id="query-table-row{{index}}-username">{{query.userName}}</td>
+          <td id="query-table-row{{index}}-databasename">{{query.databaseName}}</td>
+          <td id="query-table-row{{index}}-submittime">{{query.formattedQueryStartTime}}</td>
+          <td id="query-table-row{{index}}-duration">{{query.duration}}</td>
+          <td id="query-table-row{{index}}-clientaddress">{{query.clientAddress}}</td>
+        </tr>
+      {{/each}}
+    {{/unless}}
+    </tbody>
+  </table>
+</div>
+
+{{yield}}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/templates/main.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/templates/main.hbs b/contrib/views/hawq/src/main/resources/ui/app/templates/main.hbs
new file mode 100644
index 0000000..6baba0c
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/app/templates/main.hbs
@@ -0,0 +1,20 @@
+{{!
+ 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.
+}}
+
+{{query-table queries=model}}
+{{outlet}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/app/utils/utils.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/app/utils/utils.js b/contrib/views/hawq/src/main/resources/ui/app/utils/utils.js
new file mode 100644
index 0000000..7b02cca
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/app/utils/utils.js
@@ -0,0 +1,78 @@
+/**
+ * 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*/
+/* global moment */
+
+import ENV from 'hawq-view/config/environment';
+
+export default {
+  formatTimeOfDay: function(date) {
+    return moment(date).local().format("HH:mm:ss");
+  },
+
+  calculateTimeDelta: function(time1, time2) {
+    return moment(time2).diff(moment(time1));
+  },
+
+  formatTimeDelta: function(time1, time2) {
+    let response = {
+      value: Math.max(0, this.calculateTimeDelta(time1, time2))
+    };
+
+    let delta =  Math.round((response.value) / 1000);
+    let deltaString = `${delta % 60}s`;
+    delta = Math.floor(delta / 60);
+
+    if (delta > 0) {
+      deltaString = `${delta % 60}m ${deltaString}`;
+      delta = Math.floor(delta / 60);
+    }
+
+    if (delta > 0) {
+      deltaString = `${delta}h ${deltaString}`;
+    }
+
+    response.text = deltaString;
+    return response;
+  },
+
+  computeClientAddress: function(clientHost, clientPort) {
+    if (clientPort === -1 || !clientHost) {
+      return 'local';
+    }
+    return `${clientHost}:${clientPort}`;
+  },
+
+  getWindowPathname: function() {
+    return window.location.pathname;
+  },
+
+  getNamespace: function() {
+    return (ENV.environment === 'test' ? '' : this.getWindowPathname()) + ENV.apiURL;
+  },
+
+  generateStatusString: function(waiting, waitingResource) {
+    if(waitingResource) {
+      return 'Queued';
+    } else if(waiting) {
+      return 'Waiting on Lock';
+    }
+    return 'Running';
+  }
+};

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/bower.json
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/bower.json b/contrib/views/hawq/src/main/resources/ui/bower.json
new file mode 100644
index 0000000..5bab18f
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/bower.json
@@ -0,0 +1,14 @@
+{
+  "name": "hawq-view",
+  "dependencies": {
+    "ember": "~2.4.1",
+    "ember-cli-shims": "0.1.0",
+    "ember-cli-test-loader": "0.2.2",
+    "ember-qunit-notifications": "0.1.0",
+    "bootstrap": "~3.3.6",
+    "bootstrap-sass": "~3.3.6",
+    "bootstrap-sortable": "2.0.0",
+    "pretender": "^0.10.0",
+    "moment": "2.12.0"
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/config/environment.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/config/environment.js b/contrib/views/hawq/src/main/resources/ui/config/environment.js
new file mode 100644
index 0000000..4c742ef
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/config/environment.js
@@ -0,0 +1,69 @@
+/**
+ * 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: 'hawq-view',
+    environment: environment,
+    baseURL: '/',
+    apiURL: 'api/v1',
+    locationType: 'hash',
+    pollingInterval: 7500,
+    shouldPoll: true,
+    EmberENV: {
+      FEATURES: {
+        // Here you can enable experimental features on an ember canary build
+        // e.g. 'with-controller': true
+      }
+    },
+
+    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 = 'none';
+    ENV.shouldPoll = false;
+
+    // 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/a6b96f83/contrib/views/hawq/src/main/resources/ui/ember-cli-build.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/ember-cli-build.js b/contrib/views/hawq/src/main/resources/ui/ember-cli-build.js
new file mode 100644
index 0000000..c1db4cc
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/ember-cli-build.js
@@ -0,0 +1,51 @@
+/**
+ * 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*/
+/* global require, module */
+var EmberApp = require('ember-cli/lib/broccoli/ember-app');
+
+module.exports = function(defaults) {
+  var app = new EmberApp(defaults, {
+    // Add options here
+  });
+
+  // Use `app.import` to add additional libraries to the generated
+  // output files.
+  //
+  // If you need to use different assets in different
+  // environments, specify an object as the first parameter. That
+  // object's keys should be the environment name and the values
+  // should be the asset to use in that environment.
+  //
+  // If the library that you are including contains AMD or ES6
+  // modules that you would like to import into your application
+  // please specify an object with the list of modules as keys
+  // along with the exports of each module as its value.
+  app.import('bower_components/pretender/pretender.js');
+
+  app.import('bower_components/moment/min/moment-with-locales.js');
+
+  app.import('bower_components/bootstrap/dist/js/bootstrap.min.js');
+  app.import('bower_components/bootstrap/dist/css/bootstrap.css');
+
+  app.import('bower_components/bootstrap-sortable/Scripts/bootstrap-sortable.js');
+  app.import('bower_components/bootstrap-sortable/Contents/bootstrap-sortable.css');
+
+  return app.toTree();
+};

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/package.json
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/package.json b/contrib/views/hawq/src/main/resources/ui/package.json
new file mode 100644
index 0000000..f1b4116
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/package.json
@@ -0,0 +1,49 @@
+{
+  "name": "hawq-view",
+  "version": "0.0.1",
+  "description": "Small description for hawq-view goes here",
+  "private": true,
+  "directories": {
+    "doc": "doc",
+    "test": "tests"
+  },
+  "scripts": {
+    "build": "ember build",
+    "start": "ember server",
+    "test": "ember test",
+    "postinstall": "node/node node_modules/.bin/bower --allow-root install"
+  },
+  "repository": "",
+  "engines": {
+    "node": ">= 0.10.0"
+  },
+  "author": "",
+  "license": "MIT",
+  "devDependencies": {
+    "bower": "1.7.2",
+    "broccoli-asset-rev": "^2.2.0",
+    "ember-cli": "2.4.2",
+    "ember-cli-app-version": "^1.0.0",
+    "ember-cli-babel": "^5.1.5",
+    "ember-cli-dependency-checker": "^1.2.0",
+    "ember-cli-htmlbars": "^1.0.1",
+    "ember-cli-htmlbars-inline-precompile": "^0.3.1",
+    "ember-cli-inject-live-reload": "^1.3.1",
+    "ember-cli-pretender": "0.5.0",
+    "ember-cli-qunit": "^1.2.1",
+    "ember-cli-release": "0.2.8",
+    "ember-cli-sass": "5.3.0",
+    "ember-cli-sri": "^2.1.0",
+    "ember-cli-uglify": "^1.2.0",
+    "ember-data": "^2.4.0",
+    "ember-disable-proxy-controllers": "^1.0.1",
+    "ember-export-application-global": "^1.0.4",
+    "ember-load-initializers": "^0.5.0",
+    "ember-resolver": "^2.0.3",
+    "ember-sinon": "0.5.0",
+    "ember-sinon-qunit": "1.3.0",
+    "loader.js": "^4.0.0",
+    "node-sass": "3.4.1",
+    "phantomjs": "^1.9.2"
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/public/assets/logo-hawq.png
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/public/assets/logo-hawq.png b/contrib/views/hawq/src/main/resources/ui/public/assets/logo-hawq.png
new file mode 100644
index 0000000..0f3bfcb
Binary files /dev/null and b/contrib/views/hawq/src/main/resources/ui/public/assets/logo-hawq.png differ

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/testem.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/testem.js b/contrib/views/hawq/src/main/resources/ui/testem.js
new file mode 100644
index 0000000..ee9900b
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/testem.js
@@ -0,0 +1,33 @@
+/**
+ * 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 = {
+  "framework": "qunit",
+  "test_page": "tests/index.html?hidepassed",
+  "disable_watching": true,
+  "launch_in_ci": [
+    "PhantomJS"
+  ],
+  "launch_in_dev": [
+    "PhantomJS",
+    "Chrome",
+    "Safari",
+    "Firefox"
+  ]
+};

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/tests/.jshintrc
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/tests/.jshintrc b/contrib/views/hawq/src/main/resources/ui/tests/.jshintrc
new file mode 100644
index 0000000..6ec0b7c
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/tests/.jshintrc
@@ -0,0 +1,52 @@
+{
+  "predef": [
+    "document",
+    "window",
+    "location",
+    "setTimeout",
+    "$",
+    "-Promise",
+    "define",
+    "console",
+    "visit",
+    "exists",
+    "fillIn",
+    "click",
+    "keyEvent",
+    "triggerEvent",
+    "find",
+    "findWithAssert",
+    "wait",
+    "DS",
+    "andThen",
+    "currentURL",
+    "currentPath",
+    "currentRouteName"
+  ],
+  "node": false,
+  "browser": false,
+  "boss": true,
+  "curly": true,
+  "debug": false,
+  "devel": false,
+  "eqeqeq": true,
+  "evil": true,
+  "forin": false,
+  "immed": false,
+  "laxbreak": false,
+  "newcap": true,
+  "noarg": true,
+  "noempty": false,
+  "nonew": false,
+  "nomen": false,
+  "onevar": false,
+  "plusplus": false,
+  "regexp": false,
+  "undef": true,
+  "sub": true,
+  "strict": false,
+  "white": false,
+  "eqnull": true,
+  "esnext": true,
+  "unused": true
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/tests/acceptance/application-test.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/tests/acceptance/application-test.js b/contrib/views/hawq/src/main/resources/ui/tests/acceptance/application-test.js
new file mode 100644
index 0000000..c7ce7c7
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/tests/acceptance/application-test.js
@@ -0,0 +1,55 @@
+/**
+ * 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 { test } from 'qunit';
+import moduleForAcceptance from 'hawq-view/tests/helpers/module-for-acceptance';
+import { getMockPayload } from 'hawq-view/tests/helpers/test-helper';
+import Utils from  'hawq-view/utils/utils';
+
+moduleForAcceptance('Acceptance | application');
+
+test('visiting /', function (assert) {
+  visit('/');
+
+  andThen(function () {
+    assert.equal(currentURL(), '/');
+    assert.equal(find('img#hawq-logo').length, 1);
+
+    // Test Row Data
+    var data = getMockPayload().data;
+
+    for (var i = 0, ii = data.length; i < ii; i++) {
+      let rowName = `query-table-row${i}`;
+      assert.equal(this.$(`tr#${rowName}`).length, 1);
+
+      let attr = data[i].attributes;
+      assert.equal(this.$(`td#${rowName}-pid`).text(), attr['pid']);
+      assert.equal(this.$(`td#${rowName}-databasename`).text(), attr['database-name']);
+      assert.equal(this.$(`td#${rowName}-duration`).text(), attr['duration']);
+
+      let statusDOM = this.$(`td#${rowName}-status`);
+      assert.equal(statusDOM.text(), Utils.generateStatusString(attr['waiting'], attr['waiting-resource']));
+
+      let mockStatusClass = attr['waiting-resource'] ? '' : (attr['waiting'] ? 'orange' : 'green');
+      assert.ok(statusDOM.attr('class').match(mockStatusClass));
+      assert.equal(this.$(`td#${rowName}-username`).text(), attr['user-name']);
+      assert.equal(this.$(`td#${rowName}-clientaddress`).text(), Utils.computeClientAddress(attr['client-host'], attr['client-port']));
+
+    }
+  });
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/tests/helpers/destroy-app.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/tests/helpers/destroy-app.js b/contrib/views/hawq/src/main/resources/ui/tests/helpers/destroy-app.js
new file mode 100644
index 0000000..dfabf85
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/tests/helpers/destroy-app.js
@@ -0,0 +1,23 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export default function destroyApp(application) {
+  Ember.run(application, 'destroy');
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/tests/helpers/module-for-acceptance.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/tests/helpers/module-for-acceptance.js b/contrib/views/hawq/src/main/resources/ui/tests/helpers/module-for-acceptance.js
new file mode 100644
index 0000000..3efeee7
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/tests/helpers/module-for-acceptance.js
@@ -0,0 +1,52 @@
+/**
+ * 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 { module } from 'qunit';
+import startApp from 'hawq-view/tests/helpers/start-app';
+import destroyApp from 'hawq-view/tests/helpers/destroy-app';
+import Pretender from 'pretender';
+import { getMockPayload } from 'hawq-view/tests/helpers/test-helper';
+import ENV from 'hawq-view/config/environment';
+
+let server;
+
+export default function(name, options = {}) {
+  module(name, {
+    beforeEach() {
+      this.application = startApp();
+      server = new Pretender(function() {
+        this.get(ENV.apiURL + '/queries', function () {
+          return [200, {'Content-Type': 'application/json'}, JSON.stringify(getMockPayload())];
+        });
+      });
+
+      if (options.beforeEach) {
+        options.beforeEach.apply(this, arguments);
+      }
+    },
+
+    afterEach() {
+      if (options.afterEach) {
+        options.afterEach.apply(this, arguments);
+      }
+
+      server.shutdown();
+      destroyApp(this.application);
+    }
+  });
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/tests/helpers/resolver.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/tests/helpers/resolver.js b/contrib/views/hawq/src/main/resources/ui/tests/helpers/resolver.js
new file mode 100644
index 0000000..399978a
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/tests/helpers/resolver.js
@@ -0,0 +1,29 @@
+/**
+ * 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 Resolver from '../../resolver';
+import config from '../../config/environment';
+
+const resolver = Resolver.create();
+
+resolver.namespace = {
+  modulePrefix: config.modulePrefix,
+  podModulePrefix: config.podModulePrefix
+};
+
+export default resolver;

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/tests/helpers/start-app.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/tests/helpers/start-app.js b/contrib/views/hawq/src/main/resources/ui/tests/helpers/start-app.js
new file mode 100644
index 0000000..7b25773
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/tests/helpers/start-app.js
@@ -0,0 +1,36 @@
+/**
+ * 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 Application from '../../app';
+import config from '../../config/environment';
+
+export default function startApp(attrs) {
+  let application;
+
+  let attributes = Ember.merge({}, config.APP);
+  attributes = Ember.merge(attributes, attrs); // use defaults, but you can override;
+
+  Ember.run(() => {
+    application = Application.create(attributes);
+    application.setupForTesting();
+    application.injectTestHelpers();
+  });
+
+  return application;
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/tests/helpers/test-helper.js
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/tests/helpers/test-helper.js b/contrib/views/hawq/src/main/resources/ui/tests/helpers/test-helper.js
new file mode 100644
index 0000000..8c70dbc
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/tests/helpers/test-helper.js
@@ -0,0 +1,118 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export function getMockPayload() {
+  return {
+    data: [
+      {
+        id: 1,
+        type: 'query',
+        attributes: {
+          'database-name': 'template1',
+          'pid': 90201,
+          'user-name': 'gpadmin',
+          'waiting': false,
+          'waiting-resource': false,
+          'duration': '00:00:12',
+          'query-start-time': '2016-02-16T16:41:13-08:00',
+          'formatted-query-start-time': '2016-02-16T16:41:13-08:00',
+          'client-host': '127.0.0.1',
+          'client-port': 9999,
+          'application-name': 'psql'
+        }
+      }, {
+        id: 2,
+        type: 'query',
+        attributes: {
+          'database-name': 'gpadmin',
+          'pid': 13345,
+          'user-name': 'foo',
+          'waiting': true,
+          'waiting-resource': true,
+          'duration': '00:20:12',
+          'query-start-time': '1963-10-21T00:00:00-08:00',
+          'formatted-query-start-time': '2016-02-16T16:41:13-08:00',
+          'client-port': -1,
+          'application-name': 'mock'
+        }
+      }],
+    'server-time': '1963-10-21T00:43:15-08:00'
+  };
+}
+
+export function makeQueryObjects() {
+  var mockQueries = [
+    {
+      'id': 1,
+      'databaseName': 'template1',
+      'pid': 90210,
+      'userName': 'gpadmin',
+      'status': 'Running',
+
+      // Used to verify the CSS class for the status because the class is generated in the hbs
+      'waiting': false,
+      'waitingResource': false,
+      'statusClass': 'green',
+      'duration': '02:30:57',
+      'queryStartTime': '2016-02-16T16:41:13-08:00',
+      'formattedQueryStartTime': '2016-02-16T16:41:13-08:00',
+      'clientAddress': 'local'
+    }, {
+      'id': 2,
+      'databaseName': 'DB2',
+      'pid': 421,
+      'userName': 'thor',
+      'status': 'Running',
+
+      // Used to verify the CSS class for the status because the class is generated in the hbs
+      'waiting': true,
+      'waitingResource': false,
+      'statusClass': 'orange',
+      'duration': '01:20:12',
+      'queryStartTime': '2016-02-16T16:41:13-08:00',
+      'formattedQueryStartTime': '2016-02-16T16:41:13-08:00',
+      'clientAddress': 'local'
+    }, {
+      'id': 3,
+      'databaseName': 'FoxPro',
+      'pid': 3221,
+      'userName': 'batman',
+      'status': 'Running',
+
+      // Used to verify the CSS class for the status because the class is generated in the hbs
+      'waiting': false,
+      'waitingResource': true,
+      'statusClass': '',
+      'duration': '00:20:12',
+      'queryStartTime': '2016-02-16T16:41:13-08:00',
+      'formattedQueryStartTime': '2016-02-16T16:41:13-08:00',
+      'clientAddress': 'local'
+    }];
+
+  var queries = [];
+
+  for (var i = 0, ii = mockQueries.length; i < ii; ++i) {
+    queries.push(Ember.Object.extend(mockQueries[i]).create());
+  }
+
+  return queries;
+}
+
+export { getMockPayload, makeQueryObjects };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/a6b96f83/contrib/views/hawq/src/main/resources/ui/tests/index.html
----------------------------------------------------------------------
diff --git a/contrib/views/hawq/src/main/resources/ui/tests/index.html b/contrib/views/hawq/src/main/resources/ui/tests/index.html
new file mode 100644
index 0000000..aebdf17
--- /dev/null
+++ b/contrib/views/hawq/src/main/resources/ui/tests/index.html
@@ -0,0 +1,51 @@
+<!--
+ 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.
+-->
+<!DOCTYPE html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <title>HawqView Tests</title>
+    <meta name="description" content="">
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+
+    {{content-for "head"}}
+    {{content-for "test-head"}}
+
+    <link rel="stylesheet" href="assets/vendor.css">
+    <link rel="stylesheet" href="assets/hawq-view.css">
+    <link rel="stylesheet" href="assets/test-support.css">
+
+    {{content-for "head-footer"}}
+    {{content-for "test-head-footer"}}
+  </head>
+  <body>
+    {{content-for "body"}}
+    {{content-for "test-body"}}
+
+    <script src="testem.js" integrity=""></script>
+    <script src="assets/vendor.js"></script>
+    <script src="assets/test-support.js"></script>
+    <script src="assets/hawq-view.js"></script>
+    <script src="assets/tests.js"></script>
+    <script src="assets/test-loader.js"></script>
+
+    {{content-for "body-footer"}}
+    {{content-for "test-body-footer"}}
+  </body>
+</html>