ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbhowm...@apache.org
Subject [12/21] ambari git commit: AMBARI-16963: JDBC implementation of hive view. (dipayanb)
Date Tue, 31 May 2016 19:44:28 GMT
http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/alert-message-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/alert-message-widget.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/alert-message-widget.js
new file mode 100644
index 0000000..565d93d
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/alert-message-widget.js
@@ -0,0 +1,35 @@
+/**
+ * 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({
+  actions: {
+    remove: function () {
+      this.sendAction('removeMessage', this.get('message'));
+    },
+
+    toggleMessage: function () {
+      this.toggleProperty('message.isExpanded');
+
+      if (!this.get('message.isExpanded')) {
+        this.sendAction('removeLater', this.get('message'));
+      }
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/collapsible-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/collapsible-widget.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/collapsible-widget.js
new file mode 100644
index 0000000..eb174ab
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/collapsible-widget.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.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+  tagName: 'collapsible',
+
+  actions: {
+    toggle: function () {
+      this.toggleProperty('isExpanded');
+
+      if (this.get('isExpanded')) {
+        this.sendAction('expanded', this.get('heading'), this.get('toggledParam'));
+      }
+    },
+
+    sendControlAction: function (action) {
+      this.set('controlAction', action);
+      this.sendAction('controlAction', this.get('heading'), this.get('toggledParam'));
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/column-filter-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/column-filter-widget.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/column-filter-widget.js
new file mode 100644
index 0000000..461dabe
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/column-filter-widget.js
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+  tagName: 'column-filter',
+
+  didInsertElement: function () {
+    if (this.get('filterValue')) {
+      this.send('sendFilter');
+    }
+  },
+
+  isSorted: (function () {
+    var sortProperties = this.get('sortProperties');
+
+    if (sortProperties) {
+      return sortProperties[0] === this.get('column.property');
+    } else {
+      return false;
+    }
+  }).property('sortProperties'),
+
+  actions: {
+    sendSort: function () {
+      this.sendAction('columnSorted', this.get('column.property'));
+    },
+
+    sendFilter: function (params) {
+      if (params && (params.from || params.from === 0) && (params.to || params.to === 0)) {
+        this.set('filterValue', Ember.Object.create({
+          min: params.from,
+          max: params.to
+        }));
+      }
+
+      this.sendAction('columnFiltered', this.get('column.property'), this.get('filterValue'));
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/date-range-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/date-range-widget.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/date-range-widget.js
new file mode 100644
index 0000000..9e38786
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/date-range-widget.js
@@ -0,0 +1,85 @@
+/**
+ * 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.
+ */
+
+ /* globals moment */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+  displayFromDate: function () {
+    return moment(this.get('dateRange.from')).format('MM/DD/YYYY');
+  }.property('dateRange.from'),
+
+  displayToDate: function () {
+    return moment(this.get('dateRange.to')).format('MM/DD/YYYY');
+  }.property('dateRange.to'),
+
+  updateMinDate: function () {
+    if (this.get('rendered')) {
+      this.$('.toDate').datepicker("option", "minDate", new Date(this.get('dateRange.from')));
+    }
+  }.observes('dateRange.from'),
+
+  updateMaxDate: function () {
+    if (this.get('rendered')) {
+      this.$('.fromDate').datepicker("option", "maxDate", new Date(this.get('dateRange.to')));
+    }
+  }.observes('dateRange.to'),
+
+  didInsertElement: function () {
+    var self = this;
+    var dateRange = this.get('dateRange');
+
+    if (!dateRange.get('min') && !dateRange.get('max')) {
+      dateRange.set('max', new Date());
+    }
+
+    if (!dateRange.get('from') && !dateRange.get('to')) {
+      dateRange.set('from', dateRange.get('min'));
+      dateRange.set('to', dateRange.get('max'));
+    }
+
+    this.$(".fromDate").datepicker({
+      defaultDate: new Date(dateRange.get("from")),
+      maxDate: new Date(dateRange.get('to')),
+
+      onSelect: function (selectedDate) {
+        self.$(".toDate").datepicker("option", "minDate", selectedDate);
+
+        dateRange.set('from', new Date(selectedDate).getTime());
+        self.sendAction('rangeChanged', dateRange);
+      }
+    });
+
+    this.$(".toDate").datepicker({
+      defaultDate: new Date(dateRange.get('to')),
+      minDate: new Date(dateRange.get('from')),
+
+      onSelect: function (selectedDate) {
+        selectedDate += ' 23:59';
+
+        self.$(".fromDate").datepicker("option", "maxDate", selectedDate);
+
+        dateRange.set('to', new Date(selectedDate).getTime());
+        self.sendAction('rangeChanged', dateRange);
+      }
+    });
+
+    this.set('rendered', true);
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/expander-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/expander-widget.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/expander-widget.js
new file mode 100644
index 0000000..12da9ea
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/expander-widget.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';
+
+export default Ember.Component.extend({
+  tagName: 'expander',
+
+  didInsertElement: function () {
+    if (this.get('isExpanded')) {
+      this.$('.accordion-body').toggle();
+    }
+  },
+
+  actions: {
+    toggle: function () {
+      this.toggleProperty('isExpanded');
+      this.$('.accordion-body').toggle(200);
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/extended-input.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/extended-input.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/extended-input.js
new file mode 100644
index 0000000..9b30201
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/extended-input.js
@@ -0,0 +1,50 @@
+/**
+ * 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.TextField.extend(Ember.I18n.TranslateableProperties, {
+  didInsertElement: function () {
+    var dynamicValue = this.get('dynamicValue');
+    var dynamicContext = this.get('dynamicContext');
+
+    if (dynamicValue && dynamicContext) {
+      this.set('value', dynamicContext.get(dynamicValue));
+    }
+  },
+
+  sendValueChanged: function () {
+    var dynamicValue = this.get('dynamicValue');
+    var dynamicContext = this.get('dynamicContext');
+
+    if (dynamicValue && dynamicContext) {
+      dynamicContext.set(dynamicValue, this.get('value'));
+    }
+
+    this.sendAction('valueChanged', this.get('value'));
+  },
+
+  keyUp: function (e) {
+    //if user has pressed enter
+    if (e.keyCode === 13) {
+      this.sendAction('valueSearched', this.get('value'));
+    } else {
+      Ember.run.debounce(this, this.get('sendValueChanged'), 300);
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/file-upload.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/file-upload.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/file-upload.js
new file mode 100644
index 0000000..1cd05ae
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/file-upload.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 EmberUploader from 'ember-uploader';
+
+export default EmberUploader.FileField.extend({
+  filesDidChange: function(files) {
+    this.sendAction('filesUploaded',files); // sends this action to controller.
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/input-header.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/input-header.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/input-header.js
new file mode 100644
index 0000000..7ff5bf7
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/input-header.js
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+  tagName: '',
+  dataTypes: null,
+  column: null,
+  precisionChanged: Ember.observer('column.precision', function () {
+    var col = this.get('column');
+    if( typeof col.precision !== 'number') {
+        Ember.set(col, 'precision', Number(col.precision));
+      }
+  }),
+
+  scaleChanged: Ember.observer('column.scale', function () {
+    var col = this.get('column');
+    if( typeof col.scale !== 'number'){
+      Ember.set(col,'scale',Number(col.scale));
+    }
+  }),
+
+  typeChanged: Ember.observer('column.type', function () {
+    var col = this.get('column');
+
+    var type = col.type;
+    if( type != "DECIMAL" ){
+      Ember.set(col,'scale');
+    }
+
+    if(type != "VARCHAR" && type != "CHAR" && type != "DECIMAL" ){
+      Ember.set(col,'precision');
+    }
+  }),
+
+  noPrecision: Ember.computed('column.type', function () {
+    var type = this.get('column').type;
+    return (type == "VARCHAR" || type == "CHAR" || type == "DECIMAL" ) ? false : true;
+  }),
+
+  noScale: Ember.computed('column.type', function () {
+    return this.get('column').type == "DECIMAL" ? false : true;
+  })
+
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/job-tr-view.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/job-tr-view.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/job-tr-view.js
new file mode 100644
index 0000000..f439ca2
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/job-tr-view.js
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+import constants from 'hive/utils/constants';
+import utils from 'hive/utils/functions';
+
+export default Ember.Component.extend({
+  tagName: '',
+
+  canStop: function () {
+    return utils.insensitiveCompare(this.get('job.status'), constants.statuses.running, constants.statuses.initialized, constants.statuses.pending);
+  }.property('job.status'),
+
+  actions: {
+    requestFile: function () {
+      this.toggleProperty('expanded');
+
+      this.sendAction('onFileRequested', this.get('job'));
+    },
+
+    stopJob: function () {
+      this.sendAction('onStopJob', this.get('job'));
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/modal-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/modal-widget.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/modal-widget.js
new file mode 100644
index 0000000..ce25bf1
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/modal-widget.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.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend(Ember.I18n.TranslateableProperties, {
+  show: function () {
+    var self = this;
+
+    this.$('.modal').modal().on('hidden.bs.modal', function () {
+      self.sendAction('close');
+    });
+  }.on('didInsertElement'),
+
+  keyPress: function (e) {
+    Ember.run.debounce(this, function () {
+      if (e.which === 13) {
+        this.send('ok');
+      } else if (e.which === 27) {
+        this.send('close');
+      }
+    }, 200);
+  },
+
+  setupEvents: function () {
+    this.$(document).on('keyup', Ember.$.proxy(this.keyPress, this));
+  }.on('didInsertElement'),
+
+  destroyEvents: function () {
+    this.$(document).off('keyup', Ember.$.proxy(this.keyPress, this));
+  }.on('willDestroyElement'),
+
+  actions: {
+    ok: function () {
+      this.$('.modal').modal('hide');
+      this.sendAction('ok');
+    },
+    close: function () {
+      this.$('.modal').modal('hide');
+      this.sendAction('close');
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/navbar-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/navbar-widget.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/navbar-widget.js
new file mode 100644
index 0000000..11333d0
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/navbar-widget.js
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+import constants from 'hive/utils/constants';
+
+export default Ember.Component.extend({
+  tagName: 'navigation-bar',
+  title: constants.appTitle,
+
+  items: Ember.A([
+    Ember.Object.create({text: 'menus.query',
+                         path: constants.namingConventions.routes.index}),
+
+    Ember.Object.create({text: 'menus.savedQueries',
+                         path: constants.namingConventions.routes.queries}),
+
+    Ember.Object.create({text: 'menus.history',
+                         path: constants.namingConventions.routes.history}),
+
+    Ember.Object.create({text: 'menus.udfs',
+                         path: constants.namingConventions.routes.udfs}),
+
+    Ember.Object.create({text: 'menus.uploadTable',
+      path: constants.namingConventions.routes.uploadTable})
+  ])
+});

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

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

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/number-range-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/number-range-widget.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/number-range-widget.js
new file mode 100644
index 0000000..5d62b59
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/number-range-widget.js
@@ -0,0 +1,70 @@
+/**
+ * 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 utils from 'hive/utils/functions';
+
+export default Ember.Component.extend({
+  didInsertElement: function () {
+    var self = this;
+    var numberRange = this.get('numberRange');
+
+    if (!numberRange.get('from') && !numberRange.get('to')) {
+      numberRange.set('from', numberRange.get('min'));
+      numberRange.set('to', numberRange.get('max'));
+    }
+
+    this.$('.slider').slider({
+      range: true,
+      min: numberRange.get('min'),
+      max: numberRange.get('max'),
+      units: numberRange.get('units'),
+      values: [numberRange.get('from'), numberRange.get('to')],
+
+      slide: function (event, ui) {
+        numberRange.set('from', ui.values[0]);
+        numberRange.set('to', ui.values[1]);
+        self.updateRangeLables();
+      },
+
+      change: function () {
+        self.sendAction('rangeChanged', numberRange);
+      }
+    });
+    this.updateRangeLables();
+    this.set('rendered', true);
+  },
+  updateRangeLables: function () {
+    var numberRange = this.get('numberRange');
+    numberRange.set('fromDuration', utils.secondsToHHMMSS(numberRange.get('from')));
+    numberRange.set('toDuration', utils.secondsToHHMMSS(numberRange.get('to')));
+  },
+  updateMin: function () {
+    if (this.get('rendered')) {
+      this.$('.slider').slider('values', 0, this.get('numberRange.from'));
+      this.updateRangeLables();
+    }
+  }.observes('numberRange.from'),
+
+  updateMax: function () {
+    if (this.get('rendered')) {
+      this.$('.slider').slider('values', 1, this.get('numberRange.to'));
+      this.updateRangeLables();
+    }
+  }.observes('numberRange.to')
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/panel-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/panel-widget.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/panel-widget.js
new file mode 100644
index 0000000..e2b4ae8
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/panel-widget.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';
+
+export default Ember.Component.extend(Ember.I18n.TranslateableProperties, {
+  tagName: 'panel',
+
+  actions: {
+    sendMenuItemAction: function (action) {
+      this.set('menuItemAction', action);
+      this.sendAction('menuItemAction');
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/popover-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/popover-widget.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/popover-widget.js
new file mode 100644
index 0000000..cfb0c31
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/popover-widget.js
@@ -0,0 +1,34 @@
+/**
+ * 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(Ember.I18n.TranslateableProperties, {
+  tagName: 'popover',
+  attributeBindings: [ 'title', 'content:data-content' ],
+
+  didInsertElement: function () {
+    this.$().popover({
+      html: true,
+      placement: 'left',
+      trigger: 'hover'
+    });
+
+    this.$().attr('data-content', this.$('.hide').html());
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/progress-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/progress-widget.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/progress-widget.js
new file mode 100644
index 0000000..9a459c3
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/progress-widget.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';
+
+export default Ember.Component.extend({
+  tagName: 'progress-bar',
+
+  updateValue: function () {
+    var progress = this.get('value') ? this.get('value').toFixed() : 0;
+
+    this.set('style', 'width: %@%'.fmt(progress));
+    this.set('percentage', '%@%'.fmt(progress));
+  }.observes('value').on('didInsertElement')
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/query-editor.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/query-editor.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/query-editor.js
new file mode 100644
index 0000000..34b293c
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/query-editor.js
@@ -0,0 +1,129 @@
+/**
+ * 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.
+ */
+
+/* global CodeMirror */
+
+/**
+/* Copyright (C) 2014 by Marijn Haverbeke <marijnh@gmail.com> and others
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+
+ * The above copyright notice and this permission notice shal l be included in
+ * all copies or substantial portions of the Software.
+*/
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+  tagName: 'query-editor',
+
+  tablesChanged: function () {
+    //Format hintOptions object as needed by the CodeMirror
+    //http://stackoverflow.com/questions/20023381/codemirror-how-add-tables-to-sql-hint
+    this.set('editor.options.hintOptions', { tables: this.get('tables') });
+  }.observes('tables'),
+
+  getColumnsHint: function (cm, tableName) {
+    var callback = function () {
+      CodeMirror.showHint(cm);
+    };
+
+    this.sendAction('columnsNeeded', tableName, callback);
+  },
+
+  initEditor: function () {
+    var editor,
+        updateSize,
+        self = this;
+
+    updateSize = function () {
+      editor.setSize(self.$(this).width(), self.$(this).height());
+      editor.refresh();
+    };
+
+    this.set('editor', CodeMirror.fromTextArea(document.getElementById('code-mirror'), {
+      mode: 'text/x-hive',
+      hint: CodeMirror.hint.sql,
+      indentWithTabs: true,
+      smartIndent: true,
+      lineNumbers: true,
+      matchBrackets : true,
+      autofocus: true,
+      extraKeys: {'Ctrl-Space': 'autocomplete'}
+    }));
+
+    CodeMirror.commands.autocomplete = function (cm) {
+      var lastWord = cm.getValue().split(' ').pop();
+
+      //if user wants to fill in a column
+      if (lastWord.indexOf('.') > -1) {
+        lastWord = lastWord.split('.')[0];
+
+        self.getColumnsHint(cm, lastWord);
+      } else {
+        CodeMirror.showHint(cm);
+      }
+    };
+
+    editor = this.get('editor');
+
+    editor.on('cursorActivity', function () {
+      self.set('highlightedText', editor.getSelections());
+    });
+
+    editor.setValue(this.get('query') || '');
+
+    editor.on('change', function (instance) {
+      Ember.run(function () {
+        self.set('query', instance.getValue());
+      });
+    });
+
+    this.$('.CodeMirror').resizable({
+      handles: 's',
+
+      resize: function () {
+        Ember.run.debounce(this, updateSize, 150);
+      }
+    }).find('.ui-resizable-s').addClass('grip fa fa-reorder');
+
+    this.tablesChanged();
+  }.on('didInsertElement'),
+
+  updateValue: function () {
+    var query = this.get('query');
+    var editor = this.get('editor');
+
+    var isFinalExplainQuery = (query.toUpperCase().trim().indexOf('EXPLAIN') > -1);
+    var editorQuery = editor.getValue();
+
+    if (editor.getValue() !== query) {
+      if(isFinalExplainQuery){
+        editor.setValue(editorQuery || '')
+      }else {
+        editor.setValue(query || '');
+      }
+    }
+
+  }.observes('query')
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/radio-button.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/radio-button.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/radio-button.js
new file mode 100644
index 0000000..a07caaf
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/radio-button.js
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+  tagName: 'input',
+  type: 'radio',
+  attributeBindings: ['type', 'htmlChecked:checked', 'value', 'name', 'disabled'],
+
+  htmlChecked: function() {
+    return this.get('value') === this.get('checked');
+  }.property('value', 'checked'),
+
+  change: function() {
+    this.set('checked', this.get('value'));
+  },
+
+  _updateElementValue: function() {
+    Ember.run.next(this, function() {
+      this.$().prop('checked', this.get('htmlChecked'));
+    });
+  }.observes('htmlChecked')
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/select-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/select-widget.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/select-widget.js
new file mode 100644
index 0000000..8bd7a22
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/select-widget.js
@@ -0,0 +1,66 @@
+/**
+ * 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(Ember.I18n.TranslateableProperties, {
+  tagName: 'dropdown',
+
+  selectedLabel: function () {
+    var value;
+
+    //if there's an item selected, retrieve the property to be displayed as a label
+    if (this.get('selectedValue') && this.get('labelPath')) {
+      value = this.get('selectedValue').get(this.get('labelPath'));
+
+      if (value) {
+        return value;
+      }
+    }
+
+    //else if a default label has been provided, use it as the selected label.
+    if (this.get('defaultLabel')) {
+      return this.get('defaultLabel');
+    }
+  }.property('selectedValue'),
+
+  didInsertElement: function () {
+    //if no selected item nor defaultLabel, set the selected value
+    if (!this.get('selectedValue') && !this.get('defaultLabel') && this.get('items')) {
+      this.set('selectedValue', this.get('items').objectAt(0));
+    }
+  },
+
+  actions: {
+    select: function (item){
+      this.set('selectedValue', item);
+    },
+
+    add: function () {
+      this.sendAction('itemAdded');
+    },
+
+    edit: function (item) {
+      this.sendAction('itemEdited', item);
+    },
+
+    remove: function (item) {
+      this.sendAction('itemRemoved', item);
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/tabs-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/tabs-widget.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/tabs-widget.js
new file mode 100644
index 0000000..abb1337
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/tabs-widget.js
@@ -0,0 +1,68 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+  tagName: 'tabs',
+
+  didInsertElement: function () {
+    var tabToActivate,
+        tabs = this.get('tabs');
+
+    if (tabs.get('length')) {
+      tabToActivate = tabs.find(function (tab) {
+        return tab.get('active');
+      });
+
+      if (tabToActivate) {
+        this.set('selectedTab', tabToActivate);
+      } else {
+        this.set('selectedTab', tabs.objectAt(0));
+      }
+    }
+  },
+
+  activateTab: function () {
+    var selectedTab = this.get('selectedTab');
+
+    selectedTab.set('active', true);
+
+    this.get('tabs').without(selectedTab).forEach(function (tab) {
+      tab.set('active', false);
+    });
+  }.observes('selectedTab'),
+
+  removeEnabled: function () {
+    return this.get('canRemove') && this.get('tabs.length') > 1;
+  }.property('tabs.@each'),
+
+  actions: {
+    remove: function (tab) {
+      this.sendAction('removeClicked', tab);
+    },
+
+    selectTab: function (tab) {
+      this.set('selectedTab', tab);
+    },
+
+    titleClick: function(tab) {
+      this.sendAction('onActiveTitleClick', tab);
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/tree-view.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/tree-view.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/tree-view.js
new file mode 100644
index 0000000..cd63f52
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/tree-view.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.Component.extend({
+  tagName: 'tree-view'
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/typeahead-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/typeahead-widget.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/typeahead-widget.js
new file mode 100644
index 0000000..5bc0bda
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/typeahead-widget.js
@@ -0,0 +1,108 @@
+/**
+ * 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 Typeahead from 'ember-cli-selectize/components/ember-selectize';
+import Ember from 'ember';
+
+export default Typeahead.extend(Ember.I18n.TranslateableProperties, {
+  didInsertElement: function () {
+    this._super();
+
+    if (!this.get('selection') && this.get('content.firstObject')) {
+      this.set('selection', this.get('content.firstObject'));
+    }
+
+    this.selectize.on('dropdown_close', Ember.$.proxy(this.onClose, this));
+
+    if($('.selectize-input')) {$('.selectize-input').addClass( "mozBoxSizeFix" );}
+
+    var currentKeyName = this.get('safeValue');
+    var currentTypehead = $('*[keyname="' + currentKeyName +'"]');
+
+    if (currentTypehead.find($('.selectize-input')).has('.item').length == 0) {
+      currentTypehead.find($('.selectize-input')).addClass("has-options has-items ");
+
+      currentTypehead.find($('.selectized option:selected')).val(currentKeyName);
+      currentTypehead.find($('.selectized option:selected')).text(currentKeyName);
+
+      currentTypehead.find($('.selectize-input input')).css({'opacity': 0 , 'position': 'absolute' , 'left': '-10000px'});
+
+      var itemHtml = '<div data-value=' + currentKeyName + ' class=item >' + currentKeyName + '</div>';
+      currentTypehead.find($('.selectize-input')).append( itemHtml );
+
+    }
+  },
+
+  removeExcludedObserver: function () {
+    var options = this.get('content');
+
+    if (!options) {
+      options = this.removeExcluded(true);
+      this.set('content', options);
+    } else {
+      this.removeExcluded();
+    }
+  }.observes('excluded.@each.key').on('init'),
+
+  removeExcluded: function (shouldReturn) {
+    var excluded        = this.get('excluded') || [];
+    var options         = this.get('options');
+    var selection       = this.get('selection');
+    var objectToModify  = this.get('content');
+    var objectsToRemove = [];
+    var objectsToAdd    = [];
+
+    if (!options) {
+      return;
+    }
+
+    if (shouldReturn) {
+      objectToModify = Ember.copy(options);
+    }
+
+    var valuePath = this.get('optionValuePath');
+    var selectionName = selection ? selection[valuePath] : selection;
+
+    if (options) {
+      options.forEach(function (option) {
+        if (excluded.contains(option) && option.name !== selectionName) {
+          objectsToRemove.push(option);
+        } else if (!objectToModify.contains(option)) {
+          objectsToAdd.push(option);
+        }
+      });
+    }
+
+    objectToModify.removeObjects(objectsToRemove);
+    objectToModify.pushObjects(objectsToAdd);
+
+    return objectToModify;
+  },
+
+  onClose: function () {
+    if (!this.get('selection') && this.get('prevSelection')) {
+      this.set('selection', this.get('prevSelection'));
+    }
+  },
+
+  _onItemAdd: function (value) {
+    this._super(value);
+
+    this.set('prevSelection', this.get('selection'));
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/udf-tr-view.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/udf-tr-view.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/udf-tr-view.js
new file mode 100644
index 0000000..f019578
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/udf-tr-view.js
@@ -0,0 +1,81 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+import constants from 'hive/utils/constants';
+
+export default Ember.Component.extend({
+  tagName: 'tr',
+
+  didInsertElement: function () {
+    this._super();
+
+    if (this.get('udf.isNew')) {
+      this.set('udf.isEditing', true);
+    }
+  },
+
+  setfileBackup: function () {
+    if (!this.get('udf.isDirty')) {
+      this.set('fileBackup', this.get('udf.fileResource'));
+    }
+  }.observes('udf.isDirty').on('didInsertElement'),
+
+  actions: {
+    editUdf: function () {
+      this.set('udf.isEditing', true);
+    },
+
+    deleteUdf: function () {
+      this.sendAction('onDeleteUdf', this.get('udf'));
+    },
+
+    addFileResource: function () {
+      this.sendAction('onAddFileResource', this.get('udf'));
+    },
+
+    editFileResource: function (file) {
+      this.set('udf.fileResource', file);
+      this.set('udf.isEditingResource', true);
+    },
+
+    deleteFileResource: function (file) {
+      this.sendAction('onDeleteFileResource', file);
+    },
+
+    save: function () {
+      this.sendAction('onSaveUdf', this.get('udf'));
+    },
+
+    cancel: function () {
+      var self = this;
+
+      this.set('udf.isEditing', false);
+      this.set('udf.isEditingResource', false);
+
+      this.udf.get('fileResource').then(function (file) {
+        if (file) {
+          file.rollback();
+        }
+
+        self.udf.rollback();
+        self.udf.set('fileResource', self.get('fileBackup'));
+      });
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/visualization-tabs-widget.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/visualization-tabs-widget.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/visualization-tabs-widget.js
new file mode 100644
index 0000000..4980b7a
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/components/visualization-tabs-widget.js
@@ -0,0 +1,56 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+  tagName: 'tabs',
+
+  didInsertElement: function () {
+    var tabToActivate,
+        tabs = this.get('tabs');
+
+    if (tabs.get('length')) {
+      tabToActivate = tabs.find(function (tab) {
+        return tab.get('active');
+      });
+
+      if (tabToActivate) {
+        this.set('selectedTab', tabToActivate);
+      } else {
+        this.set('selectedTab', tabs.objectAt(0));
+      }
+    }
+  },
+
+  activateTab: function () {
+    var selectedTab = this.get('selectedTab');
+
+    selectedTab.set('active', true);
+
+    this.get('tabs').without(selectedTab).forEach(function (tab) {
+      tab.set('active', false);
+    });
+  }.observes('selectedTab'),
+
+  actions: {
+    selectTab: function (tab) {
+      this.set('selectedTab', tab);
+    }
+  }
+});

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

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

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/databases.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/databases.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/databases.js
new file mode 100644
index 0000000..b76bca3
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/databases.js
@@ -0,0 +1,457 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+import constants from 'hive/utils/constants';
+import ENV from '../config/environment';
+
+export default Ember.Controller.extend({
+  databaseService: Ember.inject.service(constants.namingConventions.database),
+  notifyService: Ember.inject.service(constants.namingConventions.notify),
+
+  pageCount: 10,
+
+  previousSelectedDatabaseName : "" ,
+  selectedDatabase: Ember.computed.alias('databaseService.selectedDatabase'),
+  databases: Ember.computed.alias('databaseService.databases'),
+
+  tableSearchResults: Ember.Object.create(),
+
+  isDatabaseRefreshInProgress: false,
+
+  tableControls: [
+    {
+      icon: 'fa-list',
+      action: 'loadSampleData',
+      tooltip: Ember.I18n.t('tooltips.loadSample')
+    }
+  ],
+
+  panelIconActions: [
+    {
+      icon: 'fa-refresh',
+      action: 'refreshDatabaseExplorer',
+      tooltip: Ember.I18n.t('tooltips.refresh')
+    }
+  ],
+
+  tabs: [
+    Ember.Object.create({
+      name: Ember.I18n.t('titles.explorer'),
+      visible: true,
+      view: constants.namingConventions.databaseTree
+    }),
+    Ember.Object.create({
+      name: Ember.I18n.t('titles.results'),
+      view: constants.namingConventions.databaseSearch
+    })
+  ],
+
+  _handleError: function (error) {
+    this.get('notifyService').error(error);
+    this.set('isLoading', false);
+  },
+
+  setTablePageAvailability: function (database) {
+    var result;
+
+    if (database.get('hasNext')) {
+      result = true;
+    } else if (database.tables.length > database.get('visibleTables.length')) {
+      //if there are hidden tables
+      result = true;
+    }
+
+    database.set('canGetNextPage', result);
+  },
+
+  setColumnPageAvailability: function (table) {
+    var result;
+
+    if (table.get('hasNext')) {
+      result = true;
+    } else if (table.columns.length > table.get('visibleColumns.length')) {
+      //if there are hidden columns
+      result = true;
+    }
+
+    table.set('canGetNextPage', result);
+  },
+
+  selectedDatabaseChanged: function () {
+    var self = this;
+
+    this.resetSearch();
+
+    this.set('isLoading', true);
+
+    this.get('databaseService').getAllTables().then(function () {
+      self.set('isLoading', false);
+      self.set('previousSelectedDatabaseName',self.get('selectedDatabase').get('name'));
+      self.get('notifyService').info("Selected database : "+self.get('selectedDatabase').get('name'));
+    }, function (error) {
+      self.get('notifyService').pushError("Error while selecting database : "+self.get('selectedDatabase').get('name'),error.responseJSON.message+"\n"+error.responseJSON.trace);
+      self.get('databaseService').setDatabaseByName(self.get('previousSelectedDatabaseName'));
+      self.set('isLoading', false);
+    });
+  }.observes('selectedDatabase'),
+
+  getNextColumnPage: function (database, table) {
+    var self = this;
+
+    this.set('isLoading', true);
+
+    if (!table.columns) {
+      table.columns = [];
+      table.set('visibleColumns', []);
+    }
+
+    this.get('databaseService').getColumnsPage(database.get('name'), table).then(function (result) {
+      table.columns.pushObjects(result.columns);
+      table.get('visibleColumns').pushObjects(result.columns);
+      table.set('hasNext', result.hasNext);
+
+      self.setColumnPageAvailability(table);
+      self.set('isLoading', false);
+    }, function (err) {
+      self._handleError(err);
+    });
+  },
+
+  getNextTablePage: function (database) {
+    var self = this;
+
+    this.set('isLoading', true);
+
+    if (!database.tables) {
+      database.tables = [];
+      database.set('visibleTables', []);
+    }
+
+    this.get('databaseService').getTablesPage(database).then(function (result) {
+      database.tables.pushObjects(result.tables);
+      database.get('visibleTables').pushObjects(result.tables);
+      database.set('hasNext', result.hasNext);
+
+      self.setTablePageAvailability(database);
+      self.set('isLoading', false);
+    }, function (err) {
+      self._handleError(err);
+    });
+  },
+
+  getDatabases: function () {
+    var self = this;
+    var selectedDatabase = this.get('selectedDatabase.name') || 'default';
+
+    this.set('isDatabaseRefreshInProgress', true);
+
+    this.set('isLoading', true);
+
+    this.get('databaseService').getDatabases().then(function (databases) {
+      self.set('isLoading');
+      self.get('databaseService').setDatabaseByName(selectedDatabase);
+    }).catch(function (error) {
+      self._handleError(error);
+
+      if(error.status == 401) {
+         self.send('passwordLDAPDB');
+      }
+    }).finally(function() {
+      self.set('isDatabaseRefreshInProgress', false);
+    });
+  }.on('init'),
+
+  syncDatabases: function() {
+    this.set('isDatabaseRefreshInProgress', true);
+    var oldDatabaseNames = this.store.all('database').mapBy('name');
+    var self = this;
+    return this.get('databaseService').getDatabasesFromServer().then(function(data) {
+      // Remove the databases from store which are not in server
+      data.forEach(function(dbName) {
+        if(!oldDatabaseNames.contains(dbName)) {
+          self.store.createRecord('database', {
+            id: dbName,
+            name: dbName
+          });
+        }
+      });
+      // Add the databases in store which are new in server
+      oldDatabaseNames.forEach(function(dbName) {
+        if(!data.contains(dbName)) {
+          self.store.find('database', dbName).then(function(db) {
+            self.store.unloadRecord(db);
+          });
+        }
+      });
+    }).finally(function() {
+      self.set('isDatabaseRefreshInProgress', false);
+    });
+  },
+
+  initiateDatabaseSync: function() {
+    // This was required so that the unit test would not stall
+    if(ENV.environment !== "test") {
+      Ember.run.later(this, function() {
+        if (this.get('isDatabaseRefreshInProgress') === false) {
+          this.syncDatabases();
+          this.initiateDatabaseSync();
+        }
+      }, 15000);
+    }
+  }.on('init'),
+
+  resetSearch: function() {
+    var resultsTab = this.get('tabs').findBy('view', constants.namingConventions.databaseSearch);
+    var databaseExplorerTab = this.get('tabs').findBy('view', constants.namingConventions.databaseTree);
+    var tableSearchResults = this.get('tableSearchResults');
+    resultsTab.set('visible', false);
+    this.set('selectedTab', databaseExplorerTab);
+    this.set('tableSearchTerm', '');
+    this.set('columnSearchTerm', '');
+    tableSearchResults.set('tables', undefined);
+    tableSearchResults.set('hasNext', undefined);
+  },
+
+
+  actions: {
+    refreshDatabaseExplorer: function () {
+      if (this.get('isDatabaseRefreshInProgress') === false) {
+        this.getDatabases();
+        this.resetSearch();
+      } else {
+        console.log("Databases refresh is in progress. Skipping this request.");
+      }
+    },
+
+    passwordLDAPDB: function(){
+      var self = this,
+          defer = Ember.RSVP.defer();
+
+      this.send('openModal', 'modal-save', {
+        heading: "modals.authenticationLDAP.heading",
+        text:"",
+        type: "password",
+        defer: defer
+      });
+
+      defer.promise.then(function (text) {
+        // make a post call with the given ldap password.
+        var password = text;
+        var pathName = window.location.pathname;
+        var pathNameArray = pathName.split("/");
+        var hiveViewVersion = pathNameArray[3];
+        var hiveViewName = pathNameArray[4];
+        var ldapAuthURL = "/api/v1/views/HIVE/versions/"+ hiveViewVersion + "/instances/" + hiveViewName + "/jobs/auth";
+
+        $.ajax({
+          url: ldapAuthURL,
+          type: 'post',
+          headers: {'X-Requested-With': 'XMLHttpRequest', 'X-Requested-By': 'ambari'},
+          contentType: 'application/json',
+          data: JSON.stringify({ "password" : password}),
+          success: function( data, textStatus, jQxhr ){
+            console.log( "LDAP done: " + data );
+            self.getDatabases();
+            self.syncDatabases();
+          },
+          error: function( jqXhr, textStatus, errorThrown ){
+            console.log( "LDAP fail: " + errorThrown );
+            self.get('notifyService').error( "Wrong Credentials." );
+          }
+        });
+      });
+    },
+
+    loadSampleData: function (tableName, database) {
+      var self = this;
+      this.send('addQuery', Ember.I18n.t('titles.tableSample', { tableName: tableName }));
+
+      Ember.run.later(function () {
+        var query = constants.sampleDataQuery.fmt(tableName);
+
+        self.set('selectedDatabase', database);
+        self.send('executeQuery', constants.jobReferrer.sample, query);
+      });
+    },
+
+    getTables: function (dbName) {
+      var database = this.get('databases').findBy('name', dbName),
+          tables = database.tables,
+          pageCount = this.get('pageCount');
+
+      if (!tables) {
+        this.getNextTablePage(database);
+      } else {
+        database.set('visibleTables', tables.slice(0, pageCount));
+        this.setTablePageAvailability(database);
+      }
+    },
+
+    getColumns: function (tableName, database) {
+      var table = database.get('visibleTables').findBy('name', tableName),
+          pageCount = this.get('pageCount'),
+          columns = table.columns;
+
+      if (!columns) {
+        this.getNextColumnPage(database, table);
+      } else {
+        table.set('visibleColumns', columns.slice(0, pageCount));
+        this.setColumnPageAvailability(table);
+      }
+    },
+
+    showMoreTables: function (database) {
+      var tables = database.tables,
+          visibleTables = database.get('visibleTables'),
+          visibleCount = visibleTables.length;
+
+      if (!tables) {
+        this.getNextTablePage(database);
+      } else {
+        if (tables.length > visibleCount) {
+          visibleTables.pushObjects(tables.slice(visibleCount, visibleCount + this.get('pageCount')));
+          this.setTablePageAvailability(database);
+        } else {
+          this.getNextTablePage(database);
+        }
+      }
+    },
+
+    showMoreColumns: function (table, database) {
+      var columns = table.columns,
+          visibleColumns = table.get('visibleColumns'),
+          visibleCount = visibleColumns.length;
+
+      if (!columns) {
+        this.getNextColumnPage(database, table);
+      } else {
+        if (columns.length > visibleCount) {
+          visibleColumns.pushObjects(columns.slice(visibleCount, visibleCount + this.get('pageCount')));
+          this.setColumnPageAvailability(table);
+        } else {
+          this.getNextColumnPage(database, table);
+        }
+      }
+    },
+
+    searchTables: function (searchTerm) {
+      var self = this,
+          resultsTab = this.get('tabs').findBy('view', constants.namingConventions.databaseSearch),
+          tableSearchResults = this.get('tableSearchResults');
+
+      searchTerm = searchTerm ? searchTerm.toLowerCase() : '';
+
+      this.set('tablesSearchTerm', searchTerm);
+      resultsTab.set('visible', true);
+      this.set('selectedTab', resultsTab);
+      this.set('columnSearchTerm', '');
+      this.set('isLoading', true);
+
+      this.get('databaseService').getTablesPage(this.get('selectedDatabase'), searchTerm, true).then(function (result) {
+        tableSearchResults.set('tables', result.tables);
+        tableSearchResults.set('hasNext', result.hasNext);
+
+        self.set('isLoading', false);
+      }, function (err) {
+        self._handleError(err);
+      });
+    },
+
+    searchColumns: function (searchTerm) {
+      var self = this,
+          database = this.get('selectedDatabase'),
+          resultsTab = this.get('tabs').findBy('view', constants.namingConventions.databaseSearch),
+          tables = this.get('tableSearchResults.tables');
+
+      searchTerm = searchTerm ? searchTerm.toLowerCase() : '';
+
+      this.set('selectedTab', resultsTab);
+
+      this.set('isLoading', true);
+
+      tables.forEach(function (table) {
+        self.get('databaseService').getColumnsPage(database.get('name'), table, searchTerm, true).then(function (result) {
+          table.set('columns', result.columns);
+          table.set('hasNext', result.hasNext);
+
+          if (tables.indexOf(table) === tables.get('length') -1) {
+            self.set('isLoading', false);
+          }
+        }, function (err) {
+          self._handleError(err);
+        });
+      });
+    },
+
+    showMoreResultTables: function () {
+      var self = this,
+          database = this.get('selectedDatabase'),
+          tableSearchResults = this.get('tableSearchResults'),
+          searchTerm = this.get('tableSearchTerm');
+
+      this.set('isLoading', true);
+
+      this.get('databaseService').getTablesPage(database, searchTerm).then(function (tablesResult) {
+        var tables = tableSearchResults.get('tables');
+        var shouldGetColumns = tables.any(function (table) {
+          return table.get('columns.length') > 0;
+        });
+
+        tables.pushObjects(tablesResult.tables);
+        tableSearchResults.set('hasNext', tablesResult.hasNext);
+
+        //if user has already searched for columns for the previously loaded tables,
+        //load the columns search results for the newly loaded tables.
+        if (shouldGetColumns) {
+          tablesResult.tables.forEach(function (table) {
+            self.get('databaseService').getColumnsPage(database.get('name'), table, self.get('columnSearchTerm'), true).then(function (result) {
+              table.set('columns', result.columns);
+              table.set('hasNext', result.hasNext);
+
+              if (tablesResult.tables.indexOf(table) === tablesResult.tables.get('length') -1) {
+                self.set('isLoading', false);
+              }
+            }, function (err) {
+              self._handleError(err);
+            });
+          });
+        } else {
+          self.set('isLoading', false);
+        }
+      }, function (err) {
+        self._handleError(err);
+      });
+    },
+
+    showMoreResultColumns: function (table) {
+      var self = this;
+
+      this.set('isLoading', true);
+
+      this.get('databaseService').getColumnsPage(this.get('selectedDatabase.name'), table, this.get('columnSearchTerm')).then(function (result) {
+        table.get('columns').pushObjects(result.columns);
+        table.set('hasNext', result.hasNext);
+
+        self.set('isLoading', false);
+      }, function (err) {
+        self._handleError(err);
+      });
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/history.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/history.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/history.js
new file mode 100644
index 0000000..8c4ed2f
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/controllers/history.js
@@ -0,0 +1,172 @@
+/**
+ * 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 FilterableMixin from 'hive/mixins/filterable';
+import constants from 'hive/utils/constants';
+
+export default Ember.ArrayController.extend(FilterableMixin, {
+  jobService: Ember.inject.service('job'),
+  fileService: Ember.inject.service('file'),
+
+  sortAscending: false,
+  sortProperties: ['dateSubmittedTimestamp'],
+
+  init: function () {
+    var oneMonthAgo = new Date();
+    oneMonthAgo.setMonth(oneMonthAgo.getMonth() - 1);
+
+    this._super();
+
+    this.set('columns', Ember.ArrayProxy.create({ content: Ember.A([
+      Ember.Object.create({
+        caption: 'columns.title',
+        property: 'title',
+        link: constants.namingConventions.subroutes.historyQuery
+      }),
+      Ember.Object.create({
+        caption: 'columns.status',
+        property: 'status'
+      }),
+      Ember.Object.create({
+        caption: 'columns.date',
+        property: 'dateSubmittedTimestamp',
+        dateRange: Ember.Object.create({
+          min: oneMonthAgo,
+          max: new Date()
+        })
+      }),
+      Ember.Object.create({
+        caption: 'columns.duration',
+        property: 'duration',
+        numberRange: Ember.Object.create({
+          min: 0,
+          max: 10,
+          units: 'sec'
+        })
+      })
+    ])}));
+  },
+
+  model: function () {
+    return this.filter(this.get('history'));
+  }.property('history', 'filters.@each'),
+
+  updateIntervals: function () {
+    var durationColumn;
+    var maxDuration;
+    var minDuration;
+
+    if (this.get('columns')) {
+      durationColumn = this.get('columns').find(function (column) {
+        return column.get('caption') === 'columns.duration';
+      });
+
+      var items = this.get('history').map(function (item) {
+        return item.get(durationColumn.get('property'));
+      });
+
+      minDuration = items.length ? Math.min.apply(Math, items) : 0;
+      maxDuration = items.length ? Math.max.apply(Math, items) : 60; //Default 1 min
+
+      durationColumn.set('numberRange.min', minDuration);
+      durationColumn.set('numberRange.max', maxDuration);
+    }
+  }.observes('history'),
+
+  updateDateRange: function () {
+    var dateColumn;
+    var maxDate;
+    var minDate;
+
+    if (this.get('columns')) {
+      dateColumn = this.get('columns').find(function (column) {
+        return column.get('caption') === 'columns.date';
+      });
+
+      var items = this.get('history').map(function (item) {
+        return item.get(dateColumn.get('property'));
+      });
+
+      minDate = items.length ? Math.min.apply(Math, items) : new Date();
+      maxDate = items.length ? Math.max.apply(Math, items) : new Date();
+
+      dateColumn.set('dateRange.min', minDate);
+      dateColumn.set('dateRange.max', maxDate);
+    }
+  }.observes('history'),
+
+  filterBy: function (filterProperty, filterValue, exactMatch) {
+    var column = this.get('columns').find(function (column) {
+      return column.get('property') === filterProperty;
+    });
+
+    if (column) {
+      column.set('filterValue', filterValue, exactMatch);
+    } else {
+      this.updateFilters(filterProperty, filterValue, exactMatch);
+    }
+  },
+
+  actions: {
+    sort: function (property) {
+      //if same column has been selected, toggle flag, else default it to true
+      if (this.get('sortProperties').objectAt(0) === property) {
+        this.set('sortAscending', !this.get('sortAscending'));
+      } else {
+        this.set('sortAscending', true);
+        this.set('sortProperties', [ property ]);
+      }
+    },
+
+    interruptJob: function (job) {
+      this.get('jobService').stopJob(job);
+    },
+
+    loadFile: function (job) {
+      this.get('fileService').loadFile(job.get('queryFile')).then(function (file) {
+        job.set('file', file);
+      });
+    },
+
+    clearFilters: function () {
+      var columns = this.get('columns');
+
+      if (columns) {
+        columns.forEach(function (column) {
+          var filterValue = column.get('filterValue');
+          var rangeFilter;
+
+          if (filterValue) {
+            if (typeof filterValue === 'string') {
+              column.set('filterValue');
+            } else {
+              rangeFilter = column.get('numberRange') || column.get('dateRange');
+
+              rangeFilter.set('from', rangeFilter.get('min'));
+              rangeFilter.set('to', rangeFilter.get('max'));
+            }
+          }
+        });
+      }
+
+      //call clear filters from Filterable mixin
+      this.clearFilters();
+    }
+  }
+});


Mime
View raw message