You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2017/01/05 00:04:49 UTC
[08/50] [abbrv] ambari git commit: AMBARI-19321 : Hive View 2.0 -
Minimal view for Hive which includes new UI changes. Also made changes in
poms as required (nitirajrathore)
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/alert-message-display.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/alert-message-display.js b/contrib/views/hive20/src/main/resources/ui/app/components/alert-message-display.js
new file mode 100644
index 0000000..840dbf3
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/alert-message-display.js
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+import {shortenText} from '../helpers/shorten-text';
+
+export default Ember.Component.extend({
+ shorten: false,
+ length: 100,
+ expanded: false,
+ shortenedValue: Ember.computed('value', 'shorten', 'expanded', function() {
+ if (this.get('expanded')) {
+ return this.get('value');
+ }
+ if (this.get('shorten')) {
+ let length = this.get('length');
+ let shortenedText = shortenText([this.get('value'), length]);
+ this.set('shorten', shortenedText !== this.get('value'));
+ return shortenedText;
+ } else {
+ return this.get('value');
+ }
+ }),
+
+ actions: {
+ toggleExpanded() {
+ this.toggleProperty('expanded');
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/alert-message.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/alert-message.js b/contrib/views/hive20/src/main/resources/ui/app/components/alert-message.js
new file mode 100644
index 0000000..ef9179a
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/alert-message.js
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+ classNames: ['flash-messages'],
+
+ actions: {
+ closeAlert() {
+ const flash = this.get('flash');
+ flash.destroyMessage();
+ }
+ }
+
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/column-item.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/column-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/column-item.js
new file mode 100644
index 0000000..d4e43f3
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/column-item.js
@@ -0,0 +1,71 @@
+/**
+ * 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 datatypes from '../configs/datatypes';
+
+export default Ember.Component.extend({
+ tagName: 'tr',
+ advancedOption: false,
+ datatypes: Ember.copy(datatypes),
+
+
+
+ hasPrecision: Ember.computed.oneWay('column.type.hasPrecision'),
+ hasScale: Ember.computed.oneWay('column.type.hasScale'),
+
+ columnMetaType: null,
+
+
+ didInsertElement() {
+ Ember.run.later( () => {
+ this.$('input').focus();
+ });
+ },
+ didReceiveAttrs() {
+ if(this.get('column.isPartitioned')) {
+ this.set('columnMetaType', 'partitioned');
+ } else if(this.get('column.isPartitioned')) {
+ this.set('columnMetaType', 'clustered');
+ } else {
+ this.set('columnMetaType');
+ }
+ },
+
+ actions: {
+ typeSelectionMade(datatype) {
+ this.set('column.type', datatype);
+ },
+
+ advanceOptionToggle() {
+ this.toggleProperty('advancedOption');
+ },
+
+ edit() {
+ this.set('column.editing', true);
+ Ember.run.later(() => {
+ this.$('input').focus();
+ });
+ },
+
+ delete() {
+ console.log('deleting column');
+ this.sendAction('columnDeleted', this.get('column'));
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js
new file mode 100644
index 0000000..f31d37f
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/create-table.js
@@ -0,0 +1,160 @@
+/**
+ * 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 Helper from '../configs/helpers';
+
+export default Ember.Component.extend({
+ init() {
+ this._super(...arguments);
+ this.set('columns', Ember.A());
+ this.set('properties', []);
+ this.set('settings', {});
+ this.set('shouldAddBuckets', null);
+ this.set('settingErrors', []);
+ },
+
+ didReceiveAttrs() {
+ this.get('tabs').setEach('active', false);
+ let firstTab = this.get('tabs.firstObject')
+ firstTab.set('active', true);
+ },
+
+ actions: {
+ activate(link) {
+ console.log("Activate: ", link);
+ },
+
+ create() {
+ if (this.validate()) {
+ this.sendAction('create', {
+ name: this.get('tableName'),
+ columns: this.get('columns'),
+ settings: this.get('settings'),
+ properties: this.get('properties')
+ });
+ }
+ },
+
+ cancel() {
+ this.sendAction('cancel');
+ }
+ },
+
+ validate() {
+ if (!this.validateTableName()) {
+ return false;
+ }
+ if (!(this.checkColumnsExists() &&
+ this.checkColumnUniqueness() &&
+ this.validateColumns())) {
+ this.selectTab("create.table.columns");
+ return false;
+ }
+
+ if(!(this.validateNumBuckets())) {
+ this.selectTab("create.table.advanced");
+ return false;
+ }
+
+ if (!(this.validateTableProperties())) {
+ this.selectTab("create.table.properties");
+ return false;
+ }
+ return true;
+ },
+ validateTableName() {
+ this.set('hasTableNameError');
+ this.set('tableNameErrorText');
+
+ if (Ember.isEmpty(this.get('tableName'))) {
+ this.set('hasTableNameError', true);
+ this.set('tableNameErrorText', 'Name cannot be empty');
+ return false;
+ }
+
+ return true;
+ },
+
+ checkColumnsExists() {
+ this.set('hasEmptyColumnsError');
+ this.set('emptyColumnsErrorText');
+ if (this.get('columns.length') === 0) {
+ this.set('hasEmptyColumnsError', true);
+ this.set('emptyColumnsErrorText', 'No columns configured. Add some column definitions.');
+ return false;
+ }
+ return true;
+ },
+
+ checkColumnUniqueness() {
+ let columnNames = [];
+ for (let i = 0; i < this.get('columns.length'); i++) {
+ let column = this.get('columns').objectAt(i);
+ column.clearError();
+ if (columnNames.indexOf(column.get('name')) === -1) {
+ columnNames.pushObject(column.get('name'));
+ } else {
+ column.get('errors').push({type: 'name', error: 'Name should be unique'});
+ return false;
+ }
+ }
+
+ return true;
+ },
+
+ validateColumns() {
+ for (let i = 0; i < this.get('columns.length'); i++) {
+ let column = this.get('columns').objectAt(i);
+ if (!column.validate()) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ validateTableProperties() {
+ for (let i = 0; i < this.get('properties.length'); i++) {
+ let property = this.get('properties').objectAt(i);
+ if (!property.validate()) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ validateNumBuckets() {
+ let clusteredColumns = this.get('columns').filterBy('isClustered', true);
+ if(clusteredColumns.get('length') > 0 &&
+ (Ember.isEmpty(this.get('settings.numBuckets')) ||
+ !Helper.isInteger(this.get('settings.numBuckets')))) {
+ this.get('settingErrors').pushObject({type: 'numBuckets', error: "Some columns are clustered, Number of buckets are required."});
+ return false;
+ }
+
+ return true;
+ },
+
+ selectTab(link) {
+ this.get('tabs').setEach('active', false);
+ let selectedTab = this.get('tabs').findBy('link', link);
+ if (!Ember.isEmpty(selectedTab)) {
+ selectedTab.set('active', true);
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/database-drop-confirm.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/database-drop-confirm.js b/contrib/views/hive20/src/main/resources/ui/app/components/database-drop-confirm.js
new file mode 100644
index 0000000..2ea1718
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/database-drop-confirm.js
@@ -0,0 +1,32 @@
+/**
+ * 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({
+ name: '',
+ actions: {
+ confirm() {
+ this.sendAction('yes');
+ },
+
+ cancel() {
+ this.sendAction('no');
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/database-not-empty.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/database-not-empty.js b/contrib/views/hive20/src/main/resources/ui/app/components/database-not-empty.js
new file mode 100644
index 0000000..d3cdfc3
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/database-not-empty.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 Ember from 'ember';
+
+export default Ember.Component.extend({
+ name: '',
+
+ actions: {
+ close() {
+ this.sendAction('close');
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/database-search-bar.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/database-search-bar.js b/contrib/views/hive20/src/main/resources/ui/app/components/database-search-bar.js
new file mode 100644
index 0000000..67828c1
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/database-search-bar.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.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+ classNames: ['database-search', 'clearfix'],
+ databases: [],
+
+ heading: 'database',
+ subHeading: 'Select or search database/schema',
+ enableSecondaryAction: true,
+ secondaryActionText: 'Browse',
+ secondaryActionFaIcon: 'folder',
+
+ extendDrawer: false,
+ filterText: '',
+
+ selectedDatabase: Ember.computed('databases.@each.selected', function() {
+ return this.get('databases').findBy('selected', true);
+ }),
+
+ filteredDatabases: Ember.computed('filterText', 'databases.@each', function() {
+ return this.get('databases').filter((item) => {
+ return item.get('name').indexOf(this.get('filterText')) !== -1;
+ });
+ }),
+
+ resetDatabaseSelection() {
+ this.get('databases').forEach(x => {
+ if (x.get('selected')) {
+ x.set('selected', false);
+ }
+ });
+ },
+
+ didRender() {
+ this._super(...arguments);
+ this.$('input.display').on('focusin', () => {
+ this.set('extendDrawer', true);
+ Ember.run.later(() => {
+ this.$('input.search').focus();
+ });
+ });
+ },
+
+ actions: {
+ secondaryActionClicked: function() {
+ this.toggleProperty('extendDrawer');
+ Ember.run.later(() => {
+ this.$('input.search').focus();
+ });
+ },
+
+ databaseClicked: function(database) {
+ this.resetDatabaseSelection();
+ database.set('selected', true);
+ this.set('extendDrawer', false);
+ this.set('filterText', '');
+ this.sendAction('selected', database);
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/edit-setting-item.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/edit-setting-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/edit-setting-item.js
new file mode 100644
index 0000000..4bc8787
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/edit-setting-item.js
@@ -0,0 +1,111 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+ tagName: 'tr',
+ selectedValue: '',
+
+ didReceiveAttrs() {
+ this._super(...arguments);
+ let selectedParameter = this.get('hiveParameters').filterBy('name', this.get('setting.key'));
+ if (selectedParameter.get('length') === 1) {
+ this.set('selectedParam', selectedParameter[0]);
+ this.set('selectedValue', this.get('setting.value'));
+ }
+ },
+ setUserSettingsAddOption: function (list, term) {
+ let filteredList = list.filter(x => x.get('name').toLowerCase().indexOf('Add') !== -1);
+ if (filteredList.get('length') > 0) {
+ list.removeObject(filteredList.objectAt(0));
+ }
+
+ list.unshiftObject(Ember.Object.create({name: `Add '${term}' to list`, actualValue: term}));
+ return list;
+ },
+
+ validate() {
+ let value = this.get('selectedValue');
+ let setting = this.get('selectedParam');
+ let error = "";
+ if (Ember.isEmpty(value)) {
+ return {valid: false, error: "Value cannot be empty"};
+ }
+
+ if (Ember.isEmpty(setting.get('values')) && Ember.isEmpty(setting.get('validate'))) {
+ return {valid: true};
+ }
+
+ if (setting.get('values') && setting.get('values').mapBy('value').contains(value)) {
+ return {valid: true};
+ } else if (setting.get('values')) {
+ error = `Value should be in (${setting.get('values').mapBy('value').join(', ')})`;
+ }
+
+ if (setting.get('validate') && setting.get('validate').test(value)) {
+ return {valid: true};
+ } else if (setting.get('validate')) {
+ error = `Value should be matching regex ${setting.get('validate')}`;
+ }
+
+ return {valid: false, error: error};
+ },
+
+ actions: {
+ searchAction(term) {
+ this.set('currentSearchField', term);
+ // Check for partial Matches
+ let filteredList = this.get('hiveParameters').filter(x => x.get('name').toLowerCase().indexOf(term.toLowerCase()) !== -1);
+ //check for exact matches
+ if ((filteredList.get('length') !== 1) || (filteredList[0].get('name') !== term)) {
+ filteredList = this.setUserSettingsAddOption(filteredList, term);
+ }
+ return filteredList;
+ },
+ selectionMade(selection, list) {
+ this.get('hiveParameters').setEach('disable', false);
+ if (selection.get('name').startsWith('Add')) {
+ let actualValue = selection.get('actualValue');
+ let newParam = Ember.Object.create({name: actualValue, disabled: true});
+ this.set('selectedParam', newParam);
+ this.get('hiveParameters').unshiftObject(newParam);
+ } else {
+ selection.set('disabled', true);
+ this.set('selectedParam', selection);
+ }
+ },
+ cancel() {
+ this.set('setting.editMode', false);
+ this.sendAction('cancelAction', this.get('setting'));
+ },
+ update() {
+ let validationResult = this.validate();
+ if(validationResult.valid) {
+ let selected = this.get('selectedParam');
+ this.set('setting.key', selected.get('name'));
+ this.set('setting.value', this.get('selectedValue') || '');
+ this.sendAction('updateAction', this.get('setting'));
+ } else {
+ this.set('invalid', true);
+ this.set('currentError', validationResult.error);
+ }
+
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/hdfs-viewer-modal.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/hdfs-viewer-modal.js b/contrib/views/hive20/src/main/resources/ui/app/components/hdfs-viewer-modal.js
new file mode 100644
index 0000000..20f3f65
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/hdfs-viewer-modal.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.
+ */
+
+import Ember from 'ember';
+import HdfsPickerConfig from '../utils/hdfs-picker-config';
+
+export default Ember.Component.extend({
+ store: Ember.inject.service(),
+ config: null,
+ showSelectedPath: true,
+
+ hdfsLocation: null,
+
+ init() {
+ this._super(...arguments);
+ this.set('config', HdfsPickerConfig.create({store: this.get('store')}));
+ },
+
+ actions: {
+ closeDirectoryViewer() {
+ this.sendAction('close');
+ },
+
+ pathSelected() {
+ this.sendAction('selected', this.get('hdfsLocation'));
+ },
+
+ viewerSelectedPath(data) {
+ this.set('hdfsLocation', data.path);
+ },
+
+ viewerError(err) {
+ console.log("Error", err);
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/job-item.js
new file mode 100644
index 0000000..3d37df8
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/job-item.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({
+ jobs: Ember.inject.service(),
+ tagName: '',
+ expanded: false,
+ expandedValue: null,
+ actions: {
+ toggleExpandJob(jobId) {
+ this.toggleProperty('expanded');
+ this.set('valueLoading', true);
+ this.get('jobs').getQuery(jobId).then((queryFile) => {
+ this.set('queryFile', queryFile);
+ this.set('valueLoading', false);
+ }).catch((err) => {
+ this.set('valueLoading', false);
+ })
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js
new file mode 100644
index 0000000..e3b22e9
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/jobs-browser.js
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+ startTime: null,
+ endTime: null,
+ maxEndTime: null,
+ statusCounts: Ember.computed('jobs', function() {
+ return this.get('jobs').reduce((acc, item, index) => {
+ let status = item.get('status').toLowerCase();
+ if(Ember.isEmpty(acc[status])) {
+ acc[status] = 1;
+ } else {
+ acc[status] = acc[status] + 1;
+ }
+
+ return acc;
+ }, {});
+ }),
+
+
+ actions: {
+ setDateRange(startDate, endDate) {
+ this.sendAction('filterChanged', startDate, endDate);
+ },
+
+ expandJob(jobId) {
+ console.log("Job to be expanded", jobId);
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js b/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js
new file mode 100644
index 0000000..d538aa3
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/list-filter.js
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+ classNames: ['list-filter'],
+ header: '',
+ subHeader: '',
+ items: [],
+ filterText: '',
+ emptyFilterText: Ember.computed('filterText', function() {
+ return this.get('filterText').length === 0;
+ }),
+ filteredItems: Ember.computed('filterText', 'items.@each', function() {
+ return this.get('items').filter((item) => {
+ return item.get('name').indexOf(this.get('filterText')) !== -1;
+ });
+ }),
+
+ actions: {
+ enableFilter() {
+ this.$('input').focus();
+ },
+
+ disableFilter() {
+ this.set('filterText', '');
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/list-group.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/list-group.js b/contrib/views/hive20/src/main/resources/ui/app/components/list-group.js
new file mode 100644
index 0000000..aeafcde
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/list-group.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({
+ classNames: ['list-group']
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/list-item.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/list-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/list-item.js
new file mode 100644
index 0000000..d29495a
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/list-item.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 Ember from 'ember';
+
+export default Ember.Component.extend({
+ tagName: 'a',
+ classNames: ['list-group-item', 'am-view-list-item'],
+ classNameBindings: ['selected:active'],
+ selected: Ember.computed.oneWay('item.selected'),
+ click() {
+ this.sendAction('itemClicked', this.get('item'));
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/multiple-database-search-bar.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/multiple-database-search-bar.js b/contrib/views/hive20/src/main/resources/ui/app/components/multiple-database-search-bar.js
new file mode 100644
index 0000000..384368f
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/multiple-database-search-bar.js
@@ -0,0 +1,84 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+
+ classNames: ['multiple-database-search', 'clearfix'],
+
+ databases: [],
+
+ //will make use of these in templates
+ heading: 'database',
+ subHeading: 'Select or search database/schema',
+
+ selectedDatabase: Ember.computed('databases.@each.selected', function() {
+ return this.get('databases').findBy('selected', true);
+ }),
+
+ filteredDatabases: Ember.computed('filterText', 'databases.@each', function() {
+ return this.get('databases').filter((item) => {
+ return item.get('name');
+ });
+ }),
+
+ resetDatabaseSelection() {
+ this.get('databases').forEach(x => {
+ if (x.get('selected')) {
+ x.set('selected', false);
+ }
+ });
+ },
+
+ allDbs: Ember.computed('selectedDatabase','filteredDatabases', function() {
+ let dblist =[];
+ this.get('filteredDatabases').forEach(db => {
+ dblist.push(db.get('name'));
+ });
+
+ return dblist;
+ }),
+
+ selectedDbs: Ember.computed('selectedDatabase','filteredDatabases', function() {
+ let selecteddblist =[];
+ selecteddblist.push(this.get('selectedDatabase.name')); //As of now for single selection but will convert this for multiple DBs selected.
+ return selecteddblist;
+ }),
+
+ actions: {
+ createOnEnter(select, e) {
+ if (e.keyCode === 13 && select.isOpen &&
+ !select.highlighted && !Ember.isBlank(select.searchText)) {
+
+ let selected = this.get('selectedDbs');
+ if (!selected.includes(select.searchText)) {
+ this.get('options').pushObject(select.searchText);
+ select.actions.choose(select.searchText);
+ }
+ }
+ },
+
+ updateTables(){
+ console.log('updateTables for selected databases.', this.get('selectedDbs'));
+ this.sendAction('xyz', this.get('selectedDbs'));
+ }
+
+ }
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/property-item.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/property-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/property-item.js
new file mode 100644
index 0000000..96ef473
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/property-item.js
@@ -0,0 +1,43 @@
+/**
+ * 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: 'tr',
+
+ didInsertElement() {
+ Ember.run.later( () => {
+ this.$('input')[0].focus();
+ });
+ },
+
+
+ actions: {
+ edit() {
+ this.set('property.editing', true);
+ Ember.run.later(() => {
+ this.$('input')[0].focus();
+ });
+ },
+
+ delete() {
+ this.sendAction('propertyItemDeleted', this.get('property'));
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js b/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js
new file mode 100644
index 0000000..f08e5a6
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/query-editor.js
@@ -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.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+
+ tagName: "query-editor",
+
+ _initializeEditor: 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());
+ });
+ });
+
+
+ }.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'),
+
+
+ actions:{
+ }
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js b/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js
new file mode 100644
index 0000000..1cb1d3d
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/query-result-table.js
@@ -0,0 +1,84 @@
+/**
+ * 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 Table from 'ember-light-table';
+import TableCommon from '../mixins/table-common';
+
+export default Ember.Component.extend({
+
+ classNames: ['query-result-table', 'clearfix'],
+
+ queryResult: {'schema' :[], 'rows' :[]},
+
+ columns: Ember.computed('queryResult', function() {
+ let queryResult = this.get('queryResult');
+ let columnArr =[];
+
+ this.get('queryResult').schema.forEach(function(column){
+ let tempColumn = {};
+
+ tempColumn['label'] = column[0];
+
+ let localValuePath = column[0];
+ tempColumn['valuePath'] = localValuePath.substring(localValuePath.lastIndexOf('.') +1 , localValuePath.length);
+
+ columnArr.push(tempColumn);
+ });
+ return columnArr;
+ }),
+
+ rows: Ember.computed('queryResult','columns', function() {
+ let rowArr = [], self = this;
+
+ if(self.get('columns').length > 0) {
+ self.get('queryResult').rows.forEach(function(row, rowindex){
+ var mylocalObject = {};
+ self.get('columns').forEach(function(column, index){
+ mylocalObject[self.get('columns')[index].valuePath] = row[index];
+ })
+ rowArr.push(mylocalObject);
+ });
+ return rowArr;
+ }
+ return rowArr;
+ }),
+
+ table: Ember.computed('queryResult', 'rows', 'columns', function() {
+ return new Table(this.get('columns'), this.get('rows'));
+ }),
+
+ actions: {
+ onScrolledToBottom() {
+ //this.send('goNextPage');
+ console.log('hook for INFINITE scroll');
+ },
+
+ onColumnClick(column) {
+ console.log('I am in onColumnClick');
+ },
+ goNextPage(){
+ this.sendAction('goNextPage');
+ },
+ goPrevPage(){
+ this.sendAction('goPrevPage');
+ }
+
+ }
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/setting-item.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/setting-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/setting-item.js
new file mode 100644
index 0000000..aa1fce0
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/setting-item.js
@@ -0,0 +1,32 @@
+/**
+ * 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: 'tr',
+ actions: {
+ edit() {
+ this.sendAction('editAction', this.get('setting'));
+ },
+
+ delete() {
+ this.sendAction('deleteAction', this.get('setting'));
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/setting-list.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/setting-list.js b/contrib/views/hive20/src/main/resources/ui/app/components/setting-list.js
new file mode 100644
index 0000000..72a83a3
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/setting-list.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({
+ settings: [],
+ actions: {
+ addNewSettings() {
+ this.sendAction('newSettings');
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js
new file mode 100644
index 0000000..181816a
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/table-advanced-settings.js
@@ -0,0 +1,168 @@
+/**
+ * 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 fileFormats from '../configs/file-format';
+import Helpers from '../configs/helpers';
+
+
+export default Ember.Component.extend({
+
+ classNames: ['create-table-advanced-wrap'],
+ showLocationInput: false,
+ showFileFormatInput: false,
+ showRowFormatInput: false,
+ shouldAddBuckets: false,
+ errors: [],
+
+ settings: {},
+
+ errorsObserver: Ember.observer('errors.@each', function() {
+ let numBucketsError = this.get('errors').findBy('type', 'numBuckets');
+ if(!Ember.isEmpty(numBucketsError)) {
+ this.set('hasNumBucketError', true);
+ this.set('numBucketErrorText', numBucketsError.error);
+ }
+ }).on('init'),
+
+
+ fileFormats: Ember.copy(fileFormats),
+ terminationChars: Ember.computed(function () {
+ return Helpers.getAllTerminationCharacters();
+ }),
+
+ didReceiveAttrs() {
+ if (!Ember.isEmpty(this.get('settings.location'))) {
+ this.set('showLocationInput', true);
+ }
+ if (!Ember.isEmpty(this.get('settings.fileFormat'))) {
+ this.set('showFileFormatInput', true);
+ let currentFileFormat = this.get('fileFormats').findBy('name', this.get('settings.fileFormat.type'));
+ this.set('selectedFileFormat', currentFileFormat);
+ this.set('customFileFormat', currentFileFormat.custom);
+ } else {
+ let defaultFileFormat = this.get('fileFormats').findBy('default', true);
+ this.set('settings.fileFormat', {});
+ debugger;
+ this.set('settings.fileFormat.type', defaultFileFormat.name);
+ }
+ if (!Ember.isEmpty(this.get('settings.rowFormat'))) {
+ this.set('showRowFormatInput', true);
+ this.set('selectedFieldTerminator', this.get('settings.rowFormat.fieldTerminatedBy'));
+ this.set('selectedLinesTerminator', this.get('settings.rowFormat.linesTerminatedBy'));
+ this.set('selectedNullDefinition', this.get('settings.rowFormat.nullDefinedAs'));
+ this.set('selectedEscapeDefinition', this.get('settings.rowFormat.escapeDefinedAs'));
+ }
+ },
+
+ locationInputObserver: Ember.observer('showLocationInput', function () {
+ if (!this.get('showLocationInput')) {
+ this.set('settings.location');
+ }
+ }),
+
+ fileFormatInputObserver: Ember.observer('showFileFormatInput', function () {
+ if (!this.get('showFileFormatInput')) {
+ this.set('settings.fileFormat');
+ } else {
+ this.set('selectedFileFormat', this.get('fileFormats').findBy('default', true));
+ }
+ }),
+
+ rowFormatInputObserver: Ember.observer('showRowFormatInput', function () {
+ if (!this.get('showRowFormatInput')) {
+ this.send('clearFieldTerminator');
+ this.send('clearLinesTerminator');
+ this.send('clearNullDefinition');
+ this.send('clearEscapeDefinition');
+ this.set('settings.rowFormat');
+ } else {
+ this.set('settings.rowFormat', {});
+ }
+ }),
+
+ actions: {
+
+ closeHdfsModal() {
+ this.set('showDirectoryViewer', false);
+ },
+
+ hdfsPathSelected(path) {
+ this.set('settings.location', path);
+ this.set('showDirectoryViewer', false);
+ },
+
+ toggleDirectoryViewer() {
+ this.set('showDirectoryViewer', true);
+ },
+
+ toggleLocation() {
+ this.toggleProperty('showLocationInput');
+ },
+
+ toggleFileFormat() {
+ this.toggleProperty('showFileFormatInput')
+ },
+
+ toggleRowFormat() {
+ this.toggleProperty('showRowFormatInput')
+ },
+
+ fileFormatSelected(format) {
+ this.set('settings.fileFormat.type', format.name);
+ this.set('selectedFileFormat', format);
+ this.set('customFileFormat', format.custom);
+ },
+
+ fieldTerminatorSelected(terminator) {
+ this.set('settings.rowFormat.fieldTerminatedBy', terminator);
+ this.set('selectedFieldTerminator', terminator);
+ },
+ clearFieldTerminator() {
+ this.set('settings.rowFormat.fieldTerminatedBy');
+ this.set('selectedFieldTerminator');
+ },
+
+ linesTerminatorSelected(terminator) {
+ this.set('settings.rowFormat.linesTerminatedBy', terminator);
+ this.set('selectedLinesTerminator', terminator);
+ },
+ clearLinesTerminator() {
+ this.set('settings.rowFormat.linesTerminatedBy');
+ this.set('selectedLinesTerminator');
+ },
+
+ nullDefinedAsSelected(terminator) {
+ this.set('settings.rowFormat.nullDefinedAs', terminator);
+ this.set('selectedNullDefinition', terminator);
+ },
+ clearNullDefinition() {
+ this.set('settings.rowFormat.nullDefinedAs');
+ this.set('selectedNullDefinition');
+ },
+
+ escapeDefinedAsSelected(terminator) {
+ this.set('settings.rowFormat.escapeDefinedAs', terminator);
+ this.set('selectedEscapeDefinition', terminator);
+ },
+ clearEscapeDefinition() {
+ this.set('settings.rowFormat.escapeDefinedAs');
+ this.set('selectedEscapeDefinition');
+ },
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/table-columns.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-columns.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-columns.js
new file mode 100644
index 0000000..5479496
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/table-columns.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 Ember from 'ember';
+import Column from '../models/column';
+
+export default Ember.Component.extend({
+ columns: [],
+ shouldAddBuckets: null,
+
+ clusteredColumnObserver: Ember.observer('columns.@each.isClustered', function(sender, key, value, rev) {
+ let clusteredColumns = this.get('columns').filterBy('isClustered');
+ if (clusteredColumns.length > 0) {
+ this.set('shouldAddBuckets', true);
+ } else {
+ if(!Ember.isEmpty(this.get('shouldAddBuckets'))) {
+ this.set('shouldAddBuckets', false);
+ }
+
+ }
+ }),
+
+ actions: {
+ addNewColumn() {
+ let newEmptyColumn = Column.create({editing: true});
+ this.get('columns').pushObject(newEmptyColumn);
+ },
+
+ columnDeleted(column) {
+ this.get('columns').removeObject(column);
+ },
+
+ columnUpdated() {
+
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/table-properties.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/table-properties.js b/contrib/views/hive20/src/main/resources/ui/app/components/table-properties.js
new file mode 100644
index 0000000..1ba15cc
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/table-properties.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';
+import TableProperty from '../models/table-property';
+
+export default Ember.Component.extend({
+ properties: [],
+
+ actions: {
+ addNewRow() {
+ let emptyProperty = TableProperty.create({editing: true});
+ this.get('properties').pushObject(emptyProperty);
+ },
+
+ itemDeleted(property) {
+ this.get('properties').removeObject(property);
+ },
+
+ itemUpdated(property) {
+
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/tabs-item.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/tabs-item.js b/contrib/views/hive20/src/main/resources/ui/app/components/tabs-item.js
new file mode 100644
index 0000000..e790c55
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/tabs-item.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: 'li',
+ classNameBindings: ['pullRight:pull-right', 'active'],
+ pullRight: Ember.computed.readOnly('tab.pullRight'),
+ active: Ember.computed.alias('tab.active'),
+
+ shouldTransition: Ember.computed('tab.transition', function() {
+ if(!Ember.isEmpty(this.get('tab.transition'))) {
+ return this.get('tab.transition');
+ } else {
+ return true;
+ }
+ }),
+
+ didInsertElement: function() {
+ Ember.run.later(() => this.send('changeActiveState'));
+ this.$('a').click(() => {
+ Ember.run.later(() => {
+ this.send('changeActiveState');
+ });
+ });
+ },
+
+ actions : {
+ selected() {
+ this.get('tabs').forEach((x) => x.set('active', false));
+ this.set('active', true);
+ this.sendAction('activate', this.get('tab.link'));
+ },
+
+ changeActiveState: function() {
+ if(this.get('shouldTransition')) {
+ let classes = this.$('a').attr('class').split(' ');
+ if(classes.contains('active')) {
+ this.get('tabs').forEach((x) => x.set('active', false));
+ this.set('active', true);
+ }
+ }
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/tabs-pane.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/tabs-pane.js b/contrib/views/hive20/src/main/resources/ui/app/components/tabs-pane.js
new file mode 100644
index 0000000..060a062
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/tabs-pane.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';
+
+export default Ember.Component.extend({
+ tagName: 'ul',
+ classNames: ['row', 'nav', 'nav-tabs'],
+ classNameBindings : ['inverse'],
+ inverse: false,
+ tabs: Ember.A()
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/components/top-application-bar.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/components/top-application-bar.js b/contrib/views/hive20/src/main/resources/ui/app/components/top-application-bar.js
new file mode 100644
index 0000000..8828275
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/components/top-application-bar.js
@@ -0,0 +1,22 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+export default Ember.Component.extend({
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/configs/create-table-tabs.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/configs/create-table-tabs.js b/contrib/views/hive20/src/main/resources/ui/app/configs/create-table-tabs.js
new file mode 100644
index 0000000..d1da231
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/configs/create-table-tabs.js
@@ -0,0 +1,48 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+
+let createTableTabs = [
+ Ember.Object.create({
+ name: 'columns',
+ label: 'COLUMNS',
+ transition: false,
+ link: 'create.table.columns',
+ faIcon: 'list'
+ }),
+
+ Ember.Object.create({
+ name: 'advanced',
+ label: 'ADVANCED',
+ transition: false,
+ link: 'create.table.advanced',
+ faIcon: 'file-text-o'
+ }),
+
+ Ember.Object.create({
+ name: 'properties',
+ label: 'TABLE PROPERTIES',
+ transition: false,
+ link: 'create.table.properties',
+ faIcon: 'file-text-o'
+ })
+
+];
+
+export default createTableTabs;
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/configs/datatypes.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/configs/datatypes.js b/contrib/views/hive20/src/main/resources/ui/app/configs/datatypes.js
new file mode 100644
index 0000000..0d07ce2
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/configs/datatypes.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.
+ */
+
+export default [
+ {label: "TINYINT", hasPrecision: false, hasScale: false},
+ {label: "SMALLINT", hasPrecision: false, hasScale: false},
+ {label: "INT", hasPrecision: false, hasScale: false},
+ {label: "BIGINT",hasPrecision: false, hasScale: false},
+ {label: "BOOLEAN",hasPrecision: false, hasScale: false},
+ {label: "FLOAT",hasPrecision: false, hasScale: false},
+ {label: "DOUBLE",hasPrecision: false, hasScale: false},
+ {label: "STRING",hasPrecision: false, hasScale: false},
+ {label: "BINARY",hasPrecision: false, hasScale: false},
+ {label: "DATE", hasPrecision: false, hasScale: false},
+ {label: "TIMESTAMP",hasPrecision: false, hasScale: false},
+ {label: "DECIMAL", hasPrecision: true, hasScale: true},
+ {label: "VARCHAR", hasPrecision: true, hasScale: false},
+ {label: "CHAR", hasPrecision: true, hasScale: false},
+]
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js b/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.js
new file mode 100644
index 0000000..4042b63
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/configs/file-format.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.
+ */
+
+export default [
+ {name: "SEQUENCEFILE", default: false, custom: false},
+ {name: "TEXTFILE", default: false, custom: false},
+ {name: "RCFILE", default: false, custom: false},
+ {name: "ORC", default: true, custom: false},
+ {name: "AVRO", default: false, custom: false},
+ {name: "CUSTOM SerDe", default: false, custom: true},
+];
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/configs/helpers.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/configs/helpers.js b/contrib/views/hive20/src/main/resources/ui/app/configs/helpers.js
new file mode 100644
index 0000000..025caa6
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/configs/helpers.js
@@ -0,0 +1,151 @@
+/**
+ * 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 nonPrintableChars from './non-printable-escape-chars';
+
+/* globals moment */
+
+export default Ember.Object.create({
+ isInteger: function (x) {
+ return !isNaN(x);
+ },
+
+ isDate: function (date) {
+ return moment(date).isValid();
+ },
+
+ regexes: {
+ allUppercase: /^[^a-z]*$/,
+ whitespaces: /^(\s*).*$/,
+ digits: /^\d+$/,
+ name: /\w+/ig,
+ dotPath: /[a-z.]+/i,
+ setSetting: /^set\s+[\w-.]+(\s+|\s?)=(\s+|\s?)[\w-.]+(\s+|\s?);/gim
+ },
+
+ validationValues: {
+ bool: [
+ Ember.Object.create({
+ value: 'true'
+ }),
+ Ember.Object.create({
+ value: 'false'
+ })
+ ],
+
+ execEngine: [
+ Ember.Object.create({
+ value: 'tez'
+ }),
+ Ember.Object.create({
+ value: 'mr'
+ })
+ ]
+ },
+
+ insensitiveCompare: function (sourceString) {
+ var args = Array.prototype.slice.call(arguments, 1);
+
+ if (!sourceString) {
+ return false;
+ }
+
+ return !!args.find(function (arg) {
+ return sourceString.match(new RegExp('^' + arg + '$', 'i'));
+ });
+ },
+
+ insensitiveContains: function (sourceString, destString) {
+ return sourceString.toLowerCase().indexOf(destString.toLowerCase()) > -1;
+ },
+
+ convertToArray: function (inputObj) {
+ var array = [];
+
+ for (var key in inputObj) {
+ if (inputObj.hasOwnProperty(key)) {
+ array.pushObject({
+ name: key,
+ value: inputObj[key]
+ });
+ }
+ }
+ return array;
+ },
+
+ /**
+ * Convert number of seconds into time object HH MM SS
+ *
+ * @param integer secs Number of seconds to convert
+ * @return object
+ */
+ secondsToHHMMSS: function (secs) {
+ var hours = 0,
+ minutes = 0,
+ seconds = secs,
+ divisor_for_minutes,
+ divisor_for_seconds,
+ formattedVal = [];
+
+ if (seconds < 60) {
+ formattedVal.push(Ember.I18n.t('labels.secsShort', {
+ seconds: seconds
+ }));
+ } else {
+ hours = Math.floor(seconds / (60 * 60));
+
+ divisor_for_minutes = seconds % (60 * 60);
+ minutes = Math.floor(divisor_for_minutes / 60);
+
+ divisor_for_seconds = divisor_for_minutes % 60;
+ seconds = Math.ceil(divisor_for_seconds);
+
+ if (hours > 0) {
+ formattedVal.push(Ember.I18n.t('labels.hrsShort', {
+ hours: hours
+ }));
+ }
+ if (minutes > 0) {
+ formattedVal.push(Ember.I18n.t('labels.minsShort', {
+ minutes: minutes
+ }));
+ }
+ if (seconds > 0) {
+ formattedVal.push(Ember.I18n.t('labels.secsShort', {
+ seconds: seconds
+ }));
+ }
+
+ }
+
+ return formattedVal.join(' ');
+ },
+
+ /**
+ * Returns all Ascii characters which will be used to fill the termination characters
+ */
+ getAllTerminationCharacters() {
+ let arr = Ember.copy(nonPrintableChars);
+ for(let i=33; i < 127; i++) {
+ arr.pushObject({id: i.toString(), name: String.fromCodePoint(i)});
+ }
+ return arr;
+ }
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/configs/hive-parameters.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/configs/hive-parameters.js b/contrib/views/hive20/src/main/resources/ui/app/configs/hive-parameters.js
new file mode 100644
index 0000000..df16c39
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/configs/hive-parameters.js
@@ -0,0 +1,93 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+import helpers from './helpers';
+
+let hiveParameters = [
+ Ember.Object.create({
+ name: 'hive.tez.container.size',
+ validate: helpers.regexes.digits
+ }),
+ Ember.Object.create({
+ name: 'hive.prewarm.enabled',
+ values: helpers.validationValues.bool
+ }),
+ Ember.Object.create({
+ name: 'hive.prewarm.numcontainers',
+ validate: helpers.regexes.digits
+ }),
+ Ember.Object.create({
+ name: 'hive.tez.auto.reducer.parallelism',
+ values: helpers.validationValues.bool
+ }),
+ Ember.Object.create({
+ name: 'hive.execution.engine',
+ values: helpers.validationValues.execEngine
+ }),
+ Ember.Object.create({
+ name: 'hive.vectorized.execution.enabled',
+ values: helpers.validationValues.bool
+ }),
+ Ember.Object.create({
+ name: 'hive.auto.convert.join',
+ values: helpers.validationValues.bool
+ }),
+ Ember.Object.create({
+ name: 'tez.am.resource.memory.mb',
+ validate: helpers.regexes.digits
+ }),
+ Ember.Object.create({
+ name: 'tez.am.container.idle.release-timeout-min.millis',
+ validate: helpers.regexes.digits
+ }),
+ Ember.Object.create({
+ name: 'tez.am.container.idle.release-timeout-max.millis',
+ validate: helpers.regexes.digits
+ }),
+ Ember.Object.create({
+ name: 'tez.queue.name',
+ validate: helpers.regexes.name
+ }),
+ Ember.Object.create({
+ name: 'tez.runtime.io.sort.mb',
+ validate: helpers.regexes.digits
+ }),
+ Ember.Object.create({
+ name: 'tez.runtime.sort.threads',
+ validate: helpers.regexes.digits
+ }),
+ Ember.Object.create({
+ name: 'tez.runtime.compress.codec',
+ validate: helpers.regexes.dotPath
+ }),
+ Ember.Object.create({
+ name: 'tez.grouping.min-size',
+ validate: helpers.regexes.digits
+ }),
+ Ember.Object.create({
+ name: 'tez.grouping.max-size',
+ validate: helpers.regexes.digits
+ }),
+ Ember.Object.create({
+ name: 'tez.generate.debug.artifacts',
+ values: helpers.validationValues.bool
+ })
+];
+
+export default hiveParameters;
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/configs/non-printable-escape-chars.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/configs/non-printable-escape-chars.js b/contrib/views/hive20/src/main/resources/ui/app/configs/non-printable-escape-chars.js
new file mode 100644
index 0000000..6c41a11
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/configs/non-printable-escape-chars.js
@@ -0,0 +1,53 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+export default [{"id": "0", "name": "NUL", "description": "(null)"},
+ {"id": "1", "name": "SOH", "description": "(start of heading)"},
+ {"id": "2", "name": "STX", "description": "(start of text)"},
+ {"id": "3", "name": "ETX", "description": "(end of text)"},
+ {"id": "4", "name": "EOT", "description": "(end of transmission)"},
+ {"id": "5", "name": "ENQ", "description": "(enquiry)"},
+ {"id": "6", "name": "ACK", "description": "(acknowledge)"},
+ {"id": "7", "name": "BEL", "description": "(bell)"},
+ {"id": "8", "name": "BS", "description": "(backspace)"},
+ {"id": "9", "name": "TAB", "description": "(horizontal tab)"},
+ {"id": "10", "name": "LF", "description": "(NL line feed - new line)"},
+ {"id": "11", "name": "VT", "description": "(vertical tab)"},
+ {"id": "12", "name": "FF", "description": "(NP form feed - new page)"},
+ {"id": "13", "name": "CR", "description": "(carriage return)"},
+ {"id": "14", "name": "SO", "description": "(shift out)"},
+ {"id": "15", "name": "SI", "description": "(shift in)"},
+ {"id": "16", "name": "DLE", "description": "(data link escape)"},
+ {"id": "17", "name": "DC1", "description": "(device control 1)"},
+ {"id": "18", "name": "DC2", "description": "(device control 2)"},
+ {"id": "19", "name": "DC3", "description": "(device control 3)"},
+ {"id": "20", "name": "DC4", "description": "(device control 4)"},
+ {"id": "21", "name": "NAK", "description": "(negative ackowledge)"},
+ {"id": "22", "name": "SYN", "description": "(synchronous idle)"},
+ {"id": "23", "name": "ETB", "description": "(end of trans. block)"},
+ {"id": "24", "name": "CAN", "description": "(cancel)"},
+ {"id": "25", "name": "EM", "description": "(end of medium)"},
+ {"id": "26", "name": "SUB", "description": "(substitute)"},
+ {"id": "27", "name": "ESC", "description": "(escape)"},
+ {"id": "28", "name": "FS", "description": "(file separator)"},
+ {"id": "29", "name": "GS", "description": "(group separator)"},
+ {"id": "30", "name": "RS", "description": "(record separator)"},
+ {"id": "31", "name": "US", "description": "(unit separator)"},
+ {"id": "32", "name": "Space", "description": ""},
+ {"id": "127", "name": "DEL", "description": ""}
+];
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/configs/table-level-tabs.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/configs/table-level-tabs.js b/contrib/views/hive20/src/main/resources/ui/app/configs/table-level-tabs.js
new file mode 100644
index 0000000..7a0cec1
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/configs/table-level-tabs.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';
+
+let tableLevelTabs = [
+ Ember.Object.create({
+ name: 'columns',
+ label: 'COLUMNS',
+ link: 'databases.database.tables.table.columns',
+ faIcon: 'list'
+ }),
+ Ember.Object.create({
+ name: 'partitions',
+ label: 'PARTITIONS',
+ link: 'databases.database.tables.table.partitions',
+ faIcon: 'file-text-o'
+ }),
+ Ember.Object.create({
+ name: 'ddl',
+ label: 'DDL',
+ link: 'databases.database.tables.table.ddl',
+ faIcon: 'file-text-o'
+ }),
+ Ember.Object.create({
+ name: 'storage',
+ label: 'STORAGE INFORMATION',
+ link: 'databases.database.tables.table.storage',
+ faIcon: 'file-text-o'
+ }),
+ Ember.Object.create({
+ name: 'detailedInfo',
+ label: 'DETAILED INFORMATION',
+ link: 'databases.database.tables.table.details',
+ faIcon: 'file-text-o'
+ }),
+ Ember.Object.create({
+ name: 'viewInfo',
+ label: 'VIEW INFORMATION',
+ link: 'databases.database.tables.table.view',
+ faIcon: 'file-text-o'
+ }),
+ Ember.Object.create({
+ name: 'statistics',
+ label: 'STATISTICS',
+ link: 'databases.database.tables.table.stats',
+ faIcon: 'line-chart'
+ })
+];
+
+export default tableLevelTabs;
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/configs/top-level-tabs.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/configs/top-level-tabs.js b/contrib/views/hive20/src/main/resources/ui/app/configs/top-level-tabs.js
new file mode 100644
index 0000000..6f04f0a
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/configs/top-level-tabs.js
@@ -0,0 +1,67 @@
+/**
+ * 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';
+
+let topLevelTabs = [
+ Ember.Object.create({
+ name: 'query',
+ label: 'QUERY',
+ link: 'query',
+ faIcon: 'paper-plane'
+ }),
+ Ember.Object.create({
+ name: 'jobs',
+ label: 'JOBS',
+ link: 'jobs',
+ faIcon: 'paper-plane'
+ }),
+ Ember.Object.create({
+ name: 'tables',
+ label: 'TABLES',
+ link: 'databases',
+ faIcon: 'table'
+ }),
+ Ember.Object.create({
+ name: 'saves-queries',
+ label: 'SAVED QUERIES',
+ link: 'savedqueries',
+ faIcon: 'paperclip'
+ }),
+ Ember.Object.create({
+ name: 'udfs',
+ label: 'UDFs',
+ link: 'udfs',
+ faIcon: 'puzzle-piece'
+ }),
+ Ember.Object.create({
+ name: 'settings',
+ label: 'SETTINGS',
+ link: 'settings',
+ faIcon: 'cog'
+ }),
+ Ember.Object.create({
+ name: 'notifications',
+ label: 'NOTIFICATIONS',
+ link: 'messages',
+ faIcon: 'bell',
+ pullRight: true
+ })
+];
+
+export default topLevelTabs;
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/controllers/.gitkeep
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/.gitkeep b/contrib/views/hive20/src/main/resources/ui/app/controllers/.gitkeep
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js b/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js
new file mode 100644
index 0000000..9ab46f3
--- /dev/null
+++ b/contrib/views/hive20/src/main/resources/ui/app/controllers/jobs.js
@@ -0,0 +1,37 @@
+/**
+ * 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.Controller.extend({
+ moment: Ember.inject.service(),
+ queryParams: ['startTime', 'endTime'],
+ startTime: null,
+ endTime: null,
+
+
+ startTimeText: Ember.computed('startTime', function() {
+ return this.get('moment').moment(this.get('startTime')).format('YYYY-MM-DD');
+ }),
+
+ endTimeText: Ember.computed('endTime', function() {
+ return this.get('moment').moment(this.get('endTime')).format('YYYY-MM-DD');
+ })
+
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/853a1ce7/contrib/views/hive20/src/main/resources/ui/app/helpers/.gitkeep
----------------------------------------------------------------------
diff --git a/contrib/views/hive20/src/main/resources/ui/app/helpers/.gitkeep b/contrib/views/hive20/src/main/resources/ui/app/helpers/.gitkeep
new file mode 100644
index 0000000..e69de29