You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jl...@apache.org on 2016/06/27 23:36:33 UTC
[07/34] ambari git commit: AMBARI-17355 & AMBARI-17354: POC: FE & BE
changes for first class support for Yarn hosted services
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/queries.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/queries.hbs b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/queries.hbs
new file mode 100644
index 0000000..96e2498
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/queries.hbs
@@ -0,0 +1,96 @@
+{{!
+* 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.
+}}
+
+<table class="table">
+ <thead>
+ <tr>
+ {{#each column in columns}}
+ <th>
+ {{#if column.caption}}
+ {{column-filter-widget class="pull-left"
+ column=column
+ filterValue=column.filterValue
+ sortAscending=controller.sortAscending
+ sortProperties=controller.sortProperties
+ columnSorted="sort"
+ columnFiltered="filter"}}
+ {{else}}
+ {{column.caption}}
+ {{/if}}
+ </th>
+ {{/each}}
+ <th>
+ <button type="btn" class="btn btn-sm btn-warning pull-right clear-filters" {{action "clearFilters"}}>{{t "buttons.clearFilters"}}</button>
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {{#if queries.length}}
+ {{#if model.length}}
+ {{#each query in this}}
+ {{#unless query.isNew}}
+ <tr>
+ <td>
+ {{#link-to "index.savedQuery" query}}
+ {{query.shortQuery}}
+ {{/link-to}}
+ </td>
+
+ <td>
+ {{#link-to "index.savedQuery" query}}
+ {{query.title}}
+ {{/link-to}}
+ </td>
+
+ <td>{{query.dataBase}}</td>
+
+ <td>{{query.owner}}</td>
+
+ <td>
+ {{#unless query.isNew}}
+ <div class="btn-group pull-right">
+ <span data-toggle="dropdown">
+ <a class="fa fa-gear"></a>
+ </span>
+ <ul class="dropdown-menu" role="menu">
+ {{#each link in controller.links}}
+ <li {{action 'executeAction' link query}}><a>{{tb-helper link}}</a></li>
+ {{/each}}
+ </ul>
+ </div>
+ {{/unless}}
+ </td>
+ </tr>
+ {{/unless}}
+ {{/each}}
+ {{else}}
+ <tr>
+ <td colspan="5">
+ <h4 class="empty-list">{{t "emptyList.savedQueries.noMatches"}}</h4>
+ </td>
+ </tr>
+ {{/if}}
+ {{else}}
+ <tr>
+ <td colspan="5">
+ <h4 class="empty-list">{{t "emptyList.savedQueries.noItems"}}</h4>
+ </td>
+ </tr>
+ {{/if}}
+ </tbody>
+</table>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/query-tabs.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/query-tabs.hbs b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/query-tabs.hbs
new file mode 100644
index 0000000..62b15c1
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/query-tabs.hbs
@@ -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.
+}}
+
+{{#each tab in tabs}}
+ <span {{action tab.action tab}} {{bind-attr class=":query-menu-tab tabClassNames tab.iconClass tab.active:active tab.flash:flash" title="tab.tooltip" id="tab.id"}}>
+ {{#if tab.badge}}
+ <span class="badge">{{tab.badge}}</span>
+ {{/if}}
+ {{#if tab.text}}
+ {{tab.text}}
+ {{/if}}
+ </span>
+{{/each}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/redirect.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/redirect.hbs b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/redirect.hbs
new file mode 100644
index 0000000..b776fd2
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/redirect.hbs
@@ -0,0 +1,19 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+{{outlet}}
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/settings.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/settings.hbs b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/settings.hbs
new file mode 100644
index 0000000..e24c667
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/settings.hbs
@@ -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.
+}}
+
+<div class="editor-overlay settings-container fadeIn">
+ <div class='settings-controls'>
+ <button class="btn btn-success btn-xs" {{action 'add'}}><i class="fa fa-plus"></i> Add</button>
+
+ {{#if settings.length}}
+ <button class="btn btn-danger btn-xs" {{action 'removeAll'}}><i class="fa fa-minus"></i> Remove All</button>
+ {{/if}}
+
+ <button class="btn btn-success btn-xs pull-right" {{action 'saveDefaultSettings'}}><i class="fa fa-plus"></i> Save Default Settings</button>
+ </div>
+
+ {{#each setting in settings}}
+ <div class="setting col-md-12 col-sm-12">
+ <form>
+ <div class="form-group">
+ <div class="input-group">
+ <div class="input-group-addon">
+
+ <div {{bind-attr keyname="setting.key.name"}} class="typeahead-container">
+ {{typeahead-widget
+ options=predefinedSettings
+ excluded=excluded
+ optionLabelPath="name"
+ optionValuePath="name"
+ plugins="remove_button,restore_on_backspace"
+ selection=setting.key
+ safeValue = setting.key.name
+ create="addKey"
+ }}
+ </div>
+ </div>
+ <div {{bind-attr class=":input-group-addon setting.valid::has-error"}}>
+ <div class="setting-input-value">
+ {{#if setting.key.values}}
+ {{select-widget items=setting.key.values
+ labelPath="value"
+ selectedValue=setting.selection
+ defaultLabelTranslation="placeholders.select.value"
+ }}
+ {{else}}
+ {{input class="input-sm form-control" placeholderTranslation="placeholders.select.value" value=setting.selection.value}}
+ {{/if}}
+ </div>
+
+ <span class="fa fa-times-circle remove pull-right" {{action 'remove' setting}}></span>
+ </div>
+ </div>
+ </div>
+ </form>
+ </div>
+ {{/each}}
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/splash.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/splash.hbs b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/splash.hbs
new file mode 100644
index 0000000..84c7a71
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/splash.hbs
@@ -0,0 +1,102 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<div class="spinner"></div>
+<div class="container-fluid">
+ <h1>Welcome to the Hive View</h1>
+ {{#if allTestsCompleted }}
+ <h3>Service checks completed.</h3>
+ {{else}}
+ <h3>Service checks in progress.</h3>
+ {{/if}}
+
+ {{#if errors}}
+ <div class="progress active">
+ <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" {{bind-attr style="progressBarStyle"}}></div>
+ </div>
+ {{else}}
+ <div class="progress progress-striped active">
+ <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" {{bind-attr style="progressBarStyle"}}></div>
+ </div>
+ {{/if}}
+
+ <table class="table">
+ <tbody>
+ <tr>
+ <td>
+ {{#if modelhdfsTestDone}}
+ {{#if modelhdfsTest}}
+ <i class="fa fa-check"></i>
+ {{else}}
+ <i class="fa fa-remove"></i>
+ {{/if}}
+ {{else}}
+ <i class="fa fa-arrow-right"></i>
+ {{/if}}
+ </td>
+ <td>hdfs service test</td>
+ </tr>
+ <tr>
+ <td>
+ {{#if modelhiveserverTestDone}}
+ {{#if modelhiveserverTest}}
+ <i class="fa fa-check"></i>
+ {{else}}
+ <i class="fa fa-remove"></i>
+ {{/if}}
+ {{else}}
+ <i class="fa fa-arrow-right"></i>
+ {{/if}}
+ </td>
+ <td>hiveserver service test</td>
+ </tr>
+ <tr>
+ <td>
+ {{#if modelatsTestDone}}
+ {{#if modelatsTest}}
+ <i class="fa fa-check"></i>
+ {{else}}
+ <i class="fa fa-remove"></i>
+ {{/if}}
+ {{else}}
+ <i class="fa fa-arrow-right"></i>
+ {{/if}}
+ </td>
+ <td>ats service test</td>
+ </tr>
+ </tbody>
+ </table>
+ {{#if errors}}
+ <h3>Issues detected</h3>
+ <p>{{{errors}}}</p>
+ {{/if}}
+ {{#if stackTrace}}
+ <a href="#" {{action "toggleStackTrace" post}}>
+ {{#if isExpanded}}
+ <i class="fa fa-minus"></i> Collapse Stack Trace
+ {{else}}
+ <<i class="fa fa-plus"></i> Expand Stack Trace
+ {{/if}}
+ </a>
+ {{#if isExpanded}}
+ <pre class="prettyprint">
+ {{stackTrace}}
+ </pre>
+ {{/if}}
+ {{/if}}
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/tez-ui.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/tez-ui.hbs b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/tez-ui.hbs
new file mode 100644
index 0000000..6f6df4c
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/tez-ui.hbs
@@ -0,0 +1,31 @@
+{{!
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+}}
+
+<div id="tez-ui" class="index-overlay">
+ {{#panel-widget headingTranslation="titles.query.tez"}}
+ {{#if dagURL}}
+ <iframe {{bind-attr src=dagURL}}></iframe>
+ {{else}}
+ {{#if error}}
+ <div class="alert alert-danger" role="alert"><strong>{{tb-helper error}}</strong></div>
+ {{else}}
+ <div class="alert alert-danger" role="alert"><strong>{{tb-helper 'tez.errors.no.dag'}}</strong></div>
+ {{/if}}
+ {{/if}}
+ {{/panel-widget}}
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/udfs.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/udfs.hbs b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/udfs.hbs
new file mode 100644
index 0000000..7650fba
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/udfs.hbs
@@ -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.
+}}
+
+<table class="table">
+ <thead>
+ <tr>
+ <th>{{t "columns.fileResource"}}</th>
+ {{#each column in columns}}
+ <th>
+ {{column-filter-widget class="pull-left"
+ column=column
+ filterValue=column.filterValue
+ sortAscending=controller.sortAscending
+ sortProperties=controller.sortProperties
+ columnSorted="sort"
+ columnFiltered="filter"}}
+ </th>
+ {{/each}}
+ <th>
+ <div class="pull-right">
+ <button type="button" class="btn btn-sm btn-warning clear-filters" {{action "clearFilters"}}>{{t "buttons.clearFilters"}}</button>
+ <button type="button" class="btn btn-sm btn-success add-udf" {{action "add"}}>{{t "buttons.newUdf"}}</button>
+ </div>
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {{#each udf in this}}
+ {{udf-tr-view udf=udf
+ fileResources=fileResources
+ columns=columns
+ onAddFileResource="handleAddFileResource"
+ onDeleteFileResource="handleDeleteFileResource"
+ onSaveUdf="handleSaveUdf"
+ onDeleteUdf='handleDeleteUdf'}}
+ {{/each}}
+ </tbody>
+</table>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/upload-table.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/upload-table.hbs b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/upload-table.hbs
new file mode 100644
index 0000000..b7d9011
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/upload-table.hbs
@@ -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.
+}}
+
+<div style="width : 90%">
+ <div class="main-content">
+ {{#if showErrors}}
+ {{render 'messages'}}
+ {{/if}}
+ </div>
+</div>
+
+<div id="uploadProgressModal" class="modal fade" role="dialog" data-backdrop="static">
+ <div class="modal-dialog">
+
+ <!-- Modal content-->
+ <div class="modal-content">
+ <div class="modal-header">
+ <h4 class="modal-title">Upload Progress</h4>
+ </div>
+ <div class="modal-body">
+ <p>
+ <ul>
+ {{uploadProgressInfo}}
+ </ul>
+ </p>
+ </div>
+ </div>
+
+ </div>
+</div>
+
+<div class="pull-right">
+ <i class="query-menu-tab fa queries-icon fa-envelope" {{ action 'toggleErrors'}}></i>
+</div>
+<div {{bind-attr class="showErrors:hide-data:show-data"}}>
+ <div>
+ <table class="table data-upload-form pull-left">
+ <tr>
+ <td class="data-upload-form-label"><label>Upload from Local</label></td>
+ <td class="data-upload-form-field"> {{radio-button value='local' checked=uploadSource}}</td>
+
+ <td class="data-upload-form-label"><label>Upload from HDFS</label></td>
+ <td class="data-upload-form-field">{{radio-button value='hdfs' checked=uploadSource}}</td>
+ </tr>
+ <tr>
+ <td class="data-upload-form-label"><label>File type</label></td>
+ <td class="data-upload-form-field">
+ {{typeahead-widget
+ content=inputFileTypes
+ optionValuePath="id"
+ optionLabelPath="name"
+ selection=inputFileType
+ placeholder="Select File Type"}}
+ </td>
+
+
+ {{#if isLocalUpload }}
+ <td class="data-upload-form-label"><label>Select from local</label></td>
+ <td class="data-upload-form-field">{{file-upload filesUploaded="filesUploaded"}}</td>
+ {{else}}
+ <td class="data-upload-form-label"><label>HDFS Path</label></td>
+ <td class="data-upload-form-field" id="hdfs-param">{{input type="text" class="form-control" placeholder="Enter full HDFS path" value=hdfsPath }}
+ <button style="margin-left: 5px; padding-top: 6px;padding-bottom: 6px; padding-right: 10px; padding-left: 10px;" type="button" {{action "previewFromHdfs"}}
+ {{bind-attr class=":btn :btn-sm :btn-default"}}>{{t "buttons.showPreview"}}</button></td>
+ {{/if}}
+ </tr>
+ {{#if rows}}
+ <tr>
+ <td class="data-upload-form-label"><label>Database</label></td>
+ <td class="data-upload-form-field">
+ {{typeahead-widget
+ content=controllers.databases.databases
+ optionValuePath="id"
+ optionLabelPath="name"
+ selection=selectedDatabase
+ placeholder="Select a Database"
+ }}
+ </td>
+
+ <td class="data-upload-form-label"><label>Table name</label></td>
+ <td
+ class="data-upload-form-field">{{input type="text" class="form-control" placeholder="Table Name" value=tableName }}</td>
+ </tr>
+ <tr>
+ <td class="data-upload-form-label"><label>Stored as</label></td>
+ <td class="data-upload-form-field">
+ {{typeahead-widget
+ content=fileTypes
+ selection=selectedFileType}}
+ </td>
+ {{#if inputFileTypeCSV }}
+ <td class="data-upload-form-label"><label>Is first row header ?</label></td>
+ <td class="data-upload-form-field">
+ {{input id="isFirstRowHeader" type="checkbox" checked=isFirstRowHeader }}
+ </td>
+
+ {{/if}}
+ </tr>
+ {{/if}}
+ </table>
+
+ <table class="pull-right">
+ <tr>
+ <td>
+ {{#if rows}}
+ <button type="button" {{action "uploadTable"}}
+ {{bind-attr class=":btn :btn-sm :btn-default"}}>{{t "buttons.uploadTable"}}</button>
+ {{/if}}
+ </td>
+ </tr>
+ </table>
+
+ </div>
+
+ <div>
+ {{#if rows}}
+ <div id="upload-table">
+ <table class="table table-expandable no-border">
+ <thead>
+ <tr>
+ {{#each column in header}}
+ <th>{{input placeholder="column-name" type="text" class="form-control" value=column.name}}</th>
+ {{/each}}
+ </tr>
+ <tr id="upload-controls">
+ {{#each column in header}}
+ <th>
+ <table>
+ <tbody>
+ <tr>
+ <td>{{typeahead-widget content=dataTypes selection=column.type }}</td>
+ {{input-header column=column dataTypes=dataTypes}}
+ </tr>
+ </tbody>
+ </table>
+ </th>
+ {{/each}}
+ </tr>
+ </thead>
+ <tbody>
+ {{#each row in rows}}
+ <tr>
+ {{#each item in row.row}}
+ <td>{{item}}</td>
+ {{/each}}
+ </tr>
+ {{/each}}
+ </tbody>
+ </table>
+ </div>
+ {{/if}}
+ </div>
+</div>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/visual-explain.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/visual-explain.hbs b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/visual-explain.hbs
new file mode 100644
index 0000000..bef0693
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/visual-explain.hbs
@@ -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.
+}}
+
+<div id="visual-explain" class="index-overlay">
+ {{#panel-widget headingTranslation="titles.query.visualExplain"}}
+
+ {{#if noquery}}
+ <div class="alert alert-danger" role="alert"><strong>{{tb-helper 'hive.errors.no.query'}}</strong></div>
+ {{/if}}
+
+ {{#unless showSpinner}}
+ <div class="spinner"></div>
+ {{/unless}}
+
+ <div id="no-visual-explain-graph"></div>
+
+ <div id="visual-explain-graph">
+ {{#each edge in view.edges}}
+ <div class="edge">
+ <div class="edge-path" {{bind-attr style="edge.style"}}>
+ {{edge.type}}
+ </div>
+ {{!-- <div class="edge-arrow" ></div> --}}
+ </div>
+ {{/each}}
+
+ <div class="nodes">
+ {{#each group in view.verticesGroups}}
+ <div class="node-container">
+ {{#if group.contents}}
+ {{#each node in group.contents}}
+ <div {{bind-attr class="node.isTableNode:table-node node.isOutputNode:output-node :node" title="node.id"}}>
+ {{#if node.isTableNode}}
+ <p><strong>{{t 'labels.table'}}</strong></p>
+ {{node.label}}
+ {{else}}
+ {{#if node.isOutputNode}}
+ {{node.label}}
+ {{else}}
+ <div class="node-heading">
+ <strong>{{node.label}}</strong>
+ </div>
+ <div class="node-content">
+ {{#each section in node.contents}}
+ <p>
+ {{#popover-widget classNames="fa fa-info-circle" titleTranslation="popover.visualExplain.statistics" }}
+ {{section.statistics}}
+ {{/popover-widget}}
+ <strong>
+ {{section.index}}. {{section.title}}
+ </strong>
+ {{section.value}}
+ </p>
+
+ {{#each field in section.fields}}
+ {{#if field.value}}
+ <p>{{field.label}} {{field.value}}</p>
+ {{/if}}
+ {{/each}}
+ {{/each}}
+ </div>
+ {{progress-widget value=node.progress}}
+ {{/if}}
+ {{/if}}
+ </div>
+ {{/each}}
+ {{else}}
+ <div class="node" {{bind-attr title="group.label"}}>
+ {{group.label}}
+ </div>
+ {{/if}}
+ </div>
+ {{/each}}
+ </div>
+ </div>
+
+ {{/panel-widget}}
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/visualization-ui.hbs
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/visualization-ui.hbs b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/visualization-ui.hbs
new file mode 100644
index 0000000..22cbaef
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/templates/visualization-ui.hbs
@@ -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.
+}}
+
+<div id="visualization" class="index-overlay">
+ {{#panel-widget headingTranslation="titles.query.visualization"}}
+ {{#if error}}
+ <div class="alert alert-danger" role="alert"><strong>{{error}}</strong></div>
+ {{else}}
+ {{#if polestarUrl}}
+ <div class="max-rows" >
+ <label>Maximum Row Count: </label> {{input value=selectedRowCount placeholder=selectedRowCount }}
+ <button {{action "changeRowCount"}}>OK</button>
+ </div>
+ {{#visualization-tabs-widget tabs=visualizationTabs }}
+
+ {{/visualization-tabs-widget}}
+ {{else}}
+ <div class="alert alert-danger" role="alert"><strong>An unknown error occurred! Please try again later.</strong></div>
+ {{/if}}
+ {{/if}}
+ {{/panel-widget}}
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/transforms/date.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/transforms/date.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/transforms/date.js
new file mode 100644
index 0000000..716ab84
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/transforms/date.js
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ember from 'ember';
+import DS from 'ember-data';
+
+export default DS.Transform.extend({
+
+ deserialize: function (serialized) {
+ var type = typeof serialized;
+
+ if (type === "string") {
+ return new Date(Ember.Date.parse(serialized));
+ } else if (type === "number") {
+ return new Date(serialized);
+ } else if (serialized === null || serialized === undefined) {
+ // if the value is not present in the data,
+ // return undefined, not null.
+ return serialized;
+ } else {
+ return null;
+ }
+ },
+
+ serialize: function (date) {
+ if (date instanceof Date) {
+ // Serialize it as a number to maintain millisecond precision
+ return Number(date);
+ } else {
+ return null;
+ }
+ }
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/constants.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/constants.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/constants.js
new file mode 100644
index 0000000..e40e447
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/constants.js
@@ -0,0 +1,233 @@
+/**
+ * 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 'hive/utils/functions';
+
+export default Ember.Object.create({
+ appTitle: 'Hive',
+
+ /**
+ * This should reflect the naming conventions accross the application.
+ * Changing one value also means changing the filenames for the chain of files
+ * represented by that value (routes, controllers, models etc).
+ * This dependency goes both ways.
+ */
+ namingConventions: {
+ routes: {
+ index: 'index',
+ savedQuery: 'savedQuery',
+ historyQuery: 'historyQuery',
+ queries: 'queries',
+ history: 'history',
+ udfs: 'udfs',
+ logs: 'logs',
+ results: 'results',
+ explain: 'explain',
+ uploadTable :'upload-table',
+ visualization: 'visualization'
+ },
+
+ subroutes: {
+ savedQuery: 'index.savedQuery',
+ historyQuery: 'index.historyQuery',
+ jobLogs: 'index.historyQuery.logs',
+ jobResults: 'index.historyQuery.results',
+ jobExplain: 'index.historyQuery.explain'
+ },
+
+ index: 'index',
+ udf: 'udf',
+ udfs: 'udfs',
+ udfInsertPrefix: 'create temporary function ',
+ fileInsertPrefix: 'add jar ',
+ explainPrefix: 'EXPLAIN ',
+ explainFormattedPrefix: 'EXPLAIN FORMATTED ',
+ insertUdfs: 'insert-udfs',
+ job: 'job',
+ jobs: 'jobs',
+ history: 'history',
+ savedQuery: 'saved-query',
+ database: 'database',
+ databases: 'databases',
+ openQueries: 'open-queries',
+ visualExplain: 'visual-explain',
+ notify: 'notify',
+ tezUI: 'tez-ui',
+ file: 'file',
+ fileResource: 'file-resource',
+ alerts: 'alerts',
+ logs: 'logs',
+ results: 'results',
+ jobResults: 'index/history-query/results',
+ jobLogs: 'index/history-query/logs',
+ jobExplain: 'index/history-query/explain',
+ databaseTree: 'databases-tree',
+ databaseSearch: 'databases-search-results',
+ settings: 'settings',
+ jobProgress: 'job-progress',
+ queryTabs: 'query-tabs',
+ session: 'session'
+ },
+
+ hiveParameters: [
+ {
+ name: 'hive.tez.container.size',
+ validate: helpers.regexes.digits
+ },
+
+ {
+ name: 'hive.prewarm.enabled',
+ values: helpers.validationValues.bool
+ },
+ {
+ name: 'hive.prewarm.numcontainers',
+ validate: helpers.regexes.digits
+ },
+ {
+ name: 'hive.tez.auto.reducer.parallelism',
+ values: helpers.validationValues.bool
+ },
+ {
+ name: 'hive.execution.engine',
+ values: helpers.validationValues.execEngine
+ },
+ {
+ name: 'hive.vectorized.execution.enabled',
+ values: helpers.validationValues.bool
+ },
+ {
+ name: 'hive.auto.convert.join',
+ values: helpers.validationValues.bool
+ },
+ {
+ name: 'tez.am.resource.memory.mb',
+ validate: helpers.regexes.digits
+ },
+ {
+ name: 'tez.am.container.idle.release-timeout-min.millis',
+ validate: helpers.regexes.digits
+ },
+ {
+ name: 'tez.am.container.idle.release-timeout-max.millis',
+ validate: helpers.regexes.digits
+ },
+ {
+ name: 'tez.queue.name',
+ validate: helpers.regexes.name
+ },
+ {
+ name: 'tez.runtime.io.sort.mb',
+ validate: helpers.regexes.digits
+ },
+ {
+ name: 'tez.runtime.sort.threads',
+ validate: helpers.regexes.digits
+ },
+ {
+ name: 'tez.runtime.compress.codec',
+ validate: helpers.regexes.dotPath
+ },
+ {
+ name: 'tez.grouping.min-size',
+ validate: helpers.regexes.digits
+ },
+ {
+ name: 'tez.grouping.max-size',
+ validate: helpers.regexes.digits
+ },
+ {
+ name: 'tez.generate.debug.artifacts',
+ values: helpers.validationValues.bool
+ }
+ ],
+
+ jobReferrer: {
+ sample: 'sample',
+ explain: 'explain',
+ visualExplain: 'visualExplain',
+ job: 'job'
+ },
+
+ statuses: {
+ unknown: "UNKNOWN",
+ initialized: "INITIALIZED",
+ running: "RUNNING",
+ succeeded: "SUCCEEDED",
+ canceled: "CANCELED",
+ closed: "CLOSED",
+ error: "ERROR",
+ failed: 'FAILED',
+ killed: 'KILLED',
+ pending: "PENDING"
+ },
+
+ alerts: {
+ warning: 'warning',
+ error: 'danger',
+ success: 'success'
+ },
+
+ results: {
+ save: {
+ csv: 'Save as csv',
+ hdfs: 'Save to HDFS'
+ },
+ statuses: {
+ terminated: "TERMINATED",
+ runnable: "RUNNABLE"
+ }
+ },
+
+ //this can be replaced by a string.format implementation
+ adapter: {
+ version: '2.0.0',
+ instance: 'Hive',
+ apiPrefix: '/api/v1/views/HIVE/versions/',
+ instancePrefix: '/instances/',
+ resourcePrefix: 'resources/'
+ },
+
+ sampleDataQuery: 'SELECT * FROM %@ LIMIT 100;',
+
+ notify: {
+ ERROR: {
+ typeClass : 'alert-danger',
+ typeIcon : 'fa-exclamation-triangle'
+ },
+ WARN: {
+ typeClass : 'alert-warning',
+ typeIcon : 'fa-times-circle'
+ },
+ SUCCESS: {
+ typeClass : 'alert-success',
+ typeIcon : 'fa-check'
+ },
+ INFO: {
+ typeClass : 'alert-info',
+ typeIcon : 'fa-info'
+ }
+ },
+
+ globalSettings: {
+ comment: "--Global Settings--\n\n"
+ },
+
+ defaultVisualizationRowCount: 10000
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/dag-rules.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/dag-rules.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/dag-rules.js
new file mode 100644
index 0000000..c854892
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/dag-rules.js
@@ -0,0 +1,141 @@
+/**
+ * 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.ArrayProxy.create({
+ content: Ember.A(
+ [
+ {
+ targetOperator: 'TableScan',
+ targetProperty: 'alias:',
+ label: 'Table Scan:',
+
+ fields: [
+ {
+ label: 'filterExpr:',
+ targetProperty: 'filterExpr:'
+ }
+ ]
+ },
+ {
+ targetOperator: 'Filter Operator',
+ targetProperty: 'predicate:',
+ label: 'Filter:',
+
+ fields: []
+ },
+ {
+ targetOperator: 'Map Join Operator',
+ label: 'Map Join',
+
+ fields: []
+ },
+ {
+ targetOperator: 'Merge Join Operator',
+ label: 'Merge Join',
+
+ fields: []
+ },
+ {
+ targetOperator: 'Select Operator',
+ label: 'Select',
+
+ fields: []
+ },
+ {
+ targetOperator: 'Reduce Output Operator',
+ label: 'Reduce',
+
+ fields: [
+ {
+ label: 'Partition columns:',
+ targetProperty: 'Map-reduce partition columns:'
+ },
+ {
+ label: 'Key expressions:',
+ targetProperty: 'key expressions:'
+ },
+ {
+ label: 'Sort order:',
+ targetProperty: 'sort order:'
+ }
+ ]
+ },
+ {
+ targetOperator: 'File Output Operator',
+ label: 'File Output Operator',
+
+ fields: []
+ },
+ {
+ targetOperator: 'Group By Operator',
+ label: 'Group By:',
+
+ fields: [
+ {
+ label: 'Aggregations:',
+ targetProperties: 'aggregations:'
+ },
+ {
+ label: 'Keys:',
+ targetProperty: 'keys:'
+ }
+ ]
+ },
+ {
+ targetOperator: 'Limit',
+ targetProperty: 'Number of rows:',
+ label: 'Limit:',
+
+ fields: []
+ },
+ {
+ targetOperator: 'Extract',
+ label: 'Extract',
+
+ fields: []
+ },
+ {
+ targetOperator: 'PTF Operator',
+ label: 'Partition Table Function',
+
+ fields: []
+ },
+ {
+ targetOperator: 'Dynamic Partitioning Event Operator',
+ labelel: 'Dynamic Partitioning Event',
+
+ fields: [
+ {
+ label: 'Target column:',
+ targetProperty: 'Target column:'
+ },
+ {
+ label: 'Target Vertex:',
+ targetProperty: 'Target Vertex:'
+ },
+ {
+ label: 'Partition key expr:',
+ targetProperty: 'Partition key expr:'
+ }
+ ]
+ }
+ ]
+ )
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/functions.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/functions.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/functions.js
new file mode 100644
index 0000000..32d81d3
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/utils/functions.js
@@ -0,0 +1,139 @@
+/**
+ * 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';
+
+/* 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(' ');
+ }
+
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/.gitkeep
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/.gitkeep b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/.gitkeep
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/index.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/index.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/index.js
new file mode 100644
index 0000000..204e67f
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/index.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.View.extend({
+ didInsertElement: function() {
+ this._super();
+ Ember.$('body').tooltip({
+ selector: '[data-toggle="tooltip"]'
+ });
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/message.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/message.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/message.js
new file mode 100644
index 0000000..45b0236
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/message.js
@@ -0,0 +1,36 @@
+ /**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import Ember from 'ember';
+import NotificationView from 'hive/views/notification';
+
+export default NotificationView.extend({
+ templateName : 'message',
+ removeLater : Ember.K,
+ isExpanded : false,
+ removeMessage: 'removeMessage',
+
+ actions: {
+ expand: function () {
+ this.toggleProperty('isExpanded');
+ },
+
+ close: function () {
+ this.get('controller').send('removeMessage', this.get('notification'));
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/messages.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/messages.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/messages.js
new file mode 100644
index 0000000..5e720c0
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/messages.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.View.extend({
+ didInsertElement: function () {
+ var target = this.$('#messages');
+ var panel = this.$('#messages .panel-body');
+
+ panel.css('min-height', $('.main-content').height());
+ target.animate({ width: $('.main-content').width() }, 'fast');
+ },
+
+ willDestroyElement: function () {
+ var target = this.$('#messages');
+ var panel = this.$('#messages .panel-body');
+
+ panel.css('min-height', 0);
+ target.css('width', 0);
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/notification.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/notification.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/notification.js
new file mode 100644
index 0000000..1fd2ce8
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/notification.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';
+
+export default Ember.View.extend({
+ closeAfter : 5000,
+ isHovering : false,
+ templateName : 'notification',
+ removeNotification : 'removeNotification',
+
+ setup: function () {
+ this.set('typeClass', this.get('notification.type.typeClass'));
+ this.set('typeIcon', this.get('notification.type.typeIcon'));
+ }.on('init'),
+
+ removeLater: function () {
+ Ember.run.later(this, function () {
+ if (this.get('isHovering')) {
+ this.removeLater();
+ } else if (this.element) {
+ this.send('close');
+ }
+ }, this.get('closeAfter'));
+ }.on('didInsertElement'),
+
+ mouseEnter: function () { this.set('isHovering', true); },
+ mouseLeave: function () { this.set('isHovering', false); },
+
+ actions: {
+ close: function () {
+ this.remove();
+ this.get('parentView').send('removeNotification', this.get('notification'));
+ }
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/tez-ui.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/tez-ui.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/tez-ui.js
new file mode 100644
index 0000000..7601463
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/tez-ui.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.View.extend({
+ didInsertElement: function () {
+ var target = this.$('#tez-ui');
+ var panel = this.$('#tez-ui .panel-body');
+
+ panel.css('min-height', $('.main-content').height());
+ target.animate({ width: $('.main-content').width() }, 'fast');
+ },
+
+ willDestroyElement: function () {
+ var target = this.$('#tez-ui');
+ var panel = this.$('#tez-ui .panel-body');
+
+ panel.css('min-height', 0);
+ target.css('width', 0);
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/visual-explain.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/visual-explain.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/visual-explain.js
new file mode 100644
index 0000000..94cb05a
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/visual-explain.js
@@ -0,0 +1,461 @@
+/**
+ * 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 dagre */
+
+import Ember from 'ember';
+import dagRules from '../utils/dag-rules';
+import utils from 'hive/utils/functions';
+
+export default Ember.View.extend({
+ verticesGroups: [],
+ edges: [],
+
+ willInsertElement: function () {
+ this.set('graph', new dagre.graphlib.Graph());
+ },
+
+ didInsertElement: function () {
+ this._super();
+
+ var target = this.$('#visual-explain');
+ var panel = this.$('#visual-explain .panel-body');
+
+ panel.css('min-height', $('.main-content').height());
+ target.animate({ width: $('.main-content').width() }, 'fast');
+
+ this.$('#visual-explain-graph').draggable();
+
+ if (this.get('controller.rerender')) {
+ this.renderDag();
+ }
+ },
+
+ willDestroyElement: function () {
+ var target = this.$('#visual-explain');
+ var panel = this.$('#visual-explain .panel-body');
+
+ panel.css('min-height', 0);
+ target.css('width', 0);
+ },
+
+ updateProgress: function () {
+ var verticesProgress = this.get('controller.verticesProgress');
+ var verticesGroups = this.get('verticesGroups');
+
+ if (!verticesGroups || !verticesProgress || !verticesProgress.length) {
+ return;
+ }
+
+ verticesGroups.forEach(function (verticesGroup) {
+ verticesGroup.contents.forEach(function (node) {
+ var progress = verticesProgress.findBy('name', node.get('label'));
+
+ if (progress) {
+ node.set('progress', progress.get('value'));
+ }
+ });
+ });
+ }.observes('controller.verticesProgress.@each.value', 'verticesGroups'),
+
+ jsonChanged: function () {
+ var json = this.get('controller.json');
+ this.renderDag();
+ }.observes('controller.json'),
+
+ getOffset: function (el) {
+ var _x = 0;
+ var _y = 0;
+ var _w = el.offsetWidth|0;
+ var _h = el.offsetHeight|0;
+ while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) ) {
+ _x += el.offsetLeft - el.scrollLeft;
+ _y += el.offsetTop - el.scrollTop;
+ el = el.offsetParent;
+ }
+ return { top: _y, left: _x, width: _w, height: _h };
+ },
+
+ addEdge: function (div1, div2, thickness, type) {
+ var off1 = this.getOffset(div1);
+ var off2 = this.getOffset(div2);
+ // bottom right
+ var x1 = off1.left + off1.width / 2;
+ var y1 = off1.top + off1.height;
+ // top right
+ var x2 = off2.left + off2.width / 2;
+ var y2 = off2.top;
+ // distance
+ var length = Math.sqrt(((x2-x1) * (x2-x1)) + ((y2-y1) * (y2-y1)));
+ // center
+ var cx = ((x1 + x2) / 2) - (length / 2);
+ var cy = ((y1 + y2) / 2) - (thickness / 2) - 73;
+ // angle
+ var angle = Math.round(Math.atan2((y1-y2), (x1-x2)) * (180 / Math.PI));
+
+ if (angle < -90) {
+ angle = 180 + angle;
+ }
+
+ var style = "left: %@px; top: %@px; width: %@px; transform:rotate(%@4deg);";
+ style = style.fmt(cx, cy, length, angle);
+
+ var edgeType;
+
+ if (type) {
+ if (type === 'BROADCAST_EDGE') {
+ edgeType = 'BROADCAST';
+ } else {
+ edgeType = 'SHUFFLE';
+ }
+ }
+
+ this.get('edges').pushObject({
+ style: style,
+ type: edgeType
+ });
+ },
+
+ getNodeContents: function (operator, contents, table, vertex) {
+ var currentTable = table,
+ contents = contents || [],
+ nodeName,
+ node,
+ ruleNode,
+ nodeLabelValue,
+ self = this;
+
+ if (operator.constructor === Array) {
+ operator.forEach(function (childOperator) {
+ self.getNodeContents(childOperator, contents, currentTable, vertex);
+ });
+
+ return contents;
+ } else {
+ nodeName = Object.getOwnPropertyNames(operator)[0];
+ node = operator[nodeName];
+ ruleNode = dagRules.findBy('targetOperator', nodeName);
+
+ if (ruleNode) {
+ if (nodeName.indexOf('Map Join') > -1) {
+ nodeLabelValue = this.handleMapJoinNode(node, currentTable);
+ currentTable = null;
+ } else if (nodeName.indexOf('Merge Join') > -1) {
+ nodeLabelValue = this.handleMergeJoinNode(node, vertex);
+ } else {
+ nodeLabelValue = node[ruleNode.targetProperty];
+ }
+
+ contents.pushObject({
+ title: ruleNode.label,
+ statistics: node["Statistics:"],
+ index: contents.length + 1,
+ value: nodeLabelValue,
+ fields: ruleNode.fields.map(function (field) {
+ var value = node[field.targetProperty || field.targetProperties];
+
+ return {
+ label: field.label,
+ value: value
+ };
+ })
+ });
+
+ if (node.children) {
+ return this.getNodeContents(node.children, contents, currentTable, vertex);
+ } else {
+ return contents;
+ }
+ } else {
+ return contents;
+ }
+ }
+ },
+
+ handleMapJoinNode: function (node, table) {
+ var rows = table || "<rows from above>";
+ var firstTable = node["input vertices:"][0] || rows;
+ var secondTable = node["input vertices:"][1] || rows;
+
+ var joinString = node["condition map:"][0][""];
+ joinString = joinString.replace("0", firstTable);
+ joinString = joinString.replace("1", secondTable);
+ joinString += " on ";
+ joinString += node["keys:"][0] + "=";
+ joinString += node["keys:"][1];
+
+ return joinString;
+ },
+
+ handleMergeJoinNode: function (node, vertex) {
+ var graphData = this.get('controller.json')['STAGE PLANS']['Stage-1']['Tez'];
+ var edges = graphData['Edges:'];
+ var index = 0;
+ var joinString = node["condition map:"][0][""];
+
+ edges[vertex].toArray().forEach(function (edge) {
+ if (edge.type === "SIMPLE_EDGE") {
+ joinString.replace(String(index), edge.parent);
+ index++;
+ }
+ });
+
+ return joinString;
+ },
+
+ //sets operator nodes
+ setNodes: function (vertices) {
+ var g = this.get('graph');
+ var self = this;
+
+ vertices.forEach(function (vertex) {
+ var contents = [];
+ var operator;
+ var currentTable;
+
+ if (vertex.name.indexOf('Map') > -1) {
+ if (vertex.value && vertex.value['Map Operator Tree:']) {
+ operator = vertex.value['Map Operator Tree:'][0];
+ currentTable = operator["TableScan"]["alias:"];
+ } else {
+ //https://hortonworks.jira.com/browse/BUG-36168
+ operator = "None";
+ }
+ } else if (vertex.name.indexOf('Reducer') > -1) {
+ operator = vertex.value['Reduce Operator Tree:'];
+ }
+
+ if (operator) {
+ contents = self.getNodeContents(operator, null, currentTable, vertex.name);
+
+ g.setNode(vertex.name, {
+ contents: contents,
+ id: vertex.name,
+ label: vertex.name
+ });
+ }
+ });
+
+ return this;
+ },
+
+ //sets edges between operator nodes
+ setEdges: function (edges) {
+ var g = this.get('graph');
+ var invalidEdges = [];
+ var edgesToBeRemoved = [];
+ var isValidEdgeType = function (type) {
+ return type === "SIMPLE_EDGE" ||
+ type === "BROADCAST_EDGE";
+ };
+
+ edges.forEach(function (edge) {
+ var parent;
+ var type;
+
+ if (edge.value.constructor === Array) {
+ edge.value.forEach(function (childEdge) {
+ parent = childEdge.parent;
+ type = childEdge.type;
+
+ if (isValidEdgeType(type)) {
+ g.setEdge(parent, edge.name);
+ g.edge({v: parent, w: edge.name}).type = type;
+ } else {
+ invalidEdges.pushObject({
+ vertex: edge.name,
+ edge: childEdge
+ });
+ }
+ });
+ } else {
+ parent = edge.value.parent;
+ type = edge.value.type;
+
+ if (isValidEdgeType(type)) {
+ g.setEdge(parent, edge.name);
+ g.edge({v: parent, w: edge.name}).type = type;
+ } else {
+ invalidEdges.pushObject({
+ vertex: edge.name,
+ edge: edge.name
+ });
+ }
+ }
+ });
+
+ invalidEdges.forEach(function (invalidEdge) {
+ var parent;
+ var targetEdge = g.edges().find(function (graphEdge) {
+ return graphEdge.v === invalidEdge.edge.parent ||
+ graphEdge.w === invalidEdge.edge.parent;
+ });
+
+ var targetVertex;
+
+ if (targetEdge) {
+ edgesToBeRemoved.pushObject(targetEdge);
+
+ if (targetEdge.v === invalidEdge.edge.parent) {
+ targetVertex = targetEdge.w;
+ } else {
+ targetVertex = targetEdge.v;
+ }
+
+ parent = invalidEdge.vertex;
+
+ g.setEdge({v: parent, w: targetVertex});
+ g.setEdge({v: parent, w: targetVertex}).type = "BROADCAST_EDGE";
+ }
+ });
+
+ edgesToBeRemoved.uniq().forEach(function (edge) {
+ g.removeEdge(edge.v, edge.w, edge.name);
+ });
+
+ return this;
+ },
+
+ //sets nodes for tables and their edges
+ setTableNodesAndEdges: function (vertices) {
+ var g = this.get('graph');
+
+ vertices.forEach(function (vertex) {
+ var operator;
+ var table;
+ var id;
+
+ if (vertex.name.indexOf('Map') > -1 && vertex.value && vertex.value['Map Operator Tree:']) {
+ operator = vertex.value['Map Operator Tree:'][0];
+ for (var node in operator) {
+ table = operator[node]['alias:'];
+
+ //create unique identifier by using table + map pairs so that we have
+ //different nodes for the same table if it's a table connected to multiple Map operators
+ id = table + ' for ' + vertex.name;
+
+ g.setNode(id, { id: id, label: table, isTableNode: true });
+ g.setEdge(id, vertex.name);
+ }
+ }
+ });
+
+ dagre.layout(g);
+
+ return this;
+ },
+
+ createNodeGroups: function () {
+ var groupedNodes = [];
+ var g = this.get('graph');
+ var lastRowNode;
+ var fileOutputOperator;
+
+ g.nodes().forEach(function (value) {
+ var node = g.node(value);
+
+ if (node) {
+ var existentRow = groupedNodes.findBy('topOffset', node.y);
+
+ if (!existentRow) {
+ groupedNodes.pushObject({
+ topOffset: node.y,
+ contents: [ Ember.Object.create(node) ]
+ });
+ } else {
+ existentRow.contents.pushObject(Ember.Object.create(node));
+ }
+ }
+ });
+
+ groupedNodes = groupedNodes.sortBy('topOffset');
+ groupedNodes.forEach(function (group) {
+ group.contents = group.contents.sortBy('x');
+ });
+
+ lastRowNode = groupedNodes.get('lastObject.contents.lastObject');
+ fileOutputOperator = lastRowNode.contents.get('lastObject');
+
+ g.setNode(fileOutputOperator.title, { id: fileOutputOperator.title, label: fileOutputOperator.title, isOutputNode: true });
+ g.setEdge(fileOutputOperator.title, lastRowNode.id);
+
+ groupedNodes.pushObject({
+ contents: [ Ember.Object.create(g.node(fileOutputOperator.title)) ]
+ });
+
+ lastRowNode.contents.removeObject(fileOutputOperator);
+
+ this.set('verticesGroups', groupedNodes);
+
+ return this;
+ },
+
+ renderEdges: function () {
+ var self = this;
+ var g = this.get('graph');
+
+ Ember.run.later(function () {
+ g.edges().forEach(function (value) {
+ var firstNode = self.$("[title='" + value.v + "']");
+ var secondNode = self.$("[title='" + value.w + "']");
+
+ if (firstNode && secondNode) {
+ self.addEdge(firstNode[0], secondNode[0], 2, g.edge(value).type);
+ }
+
+ });
+ }, 400);
+ },
+
+ renderDag: function () {
+ var json = this.get('controller.json');
+ var isVisualExplain = json && (json['STAGE PLANS'] != undefined) && (json['STAGE PLANS']['Stage-1'] != undefined) && (json['STAGE PLANS']['Stage-1']['Tez'] != undefined);
+ if (isVisualExplain) {
+ this.set('edges', []);
+
+ // Create a new directed graph
+ var g = this.get('graph');
+
+ var graphData = json['STAGE PLANS']['Stage-1']['Tez'];
+ var vertices = utils.convertToArray(graphData['Vertices:']);
+ var edges = utils.convertToArray(graphData['Edges:']);
+
+ // Set an object for the graph label
+ g.setGraph({});
+
+ // Default to assigning a new object as a label for each new edge.
+ g.setDefaultEdgeLabel(function () { return {}; });
+
+ this.setNodes(vertices)
+ .setEdges(edges)
+ .setTableNodesAndEdges(vertices)
+ .createNodeGroups()
+ .renderEdges();
+
+ this.set('controller.showSpinner', true);
+
+ } else {
+
+ if(!this.get('controller.noquery')) {
+ $('#no-visual-explain-graph').html('Visual explain is not available.');
+ }
+
+ }
+
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/visualization-ui.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/visualization-ui.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/visualization-ui.js
new file mode 100644
index 0000000..b1c10df
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/app/views/visualization-ui.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.View.extend({
+ didInsertElement: function () {
+ var target = this.$('#visualization');
+ var panel = this.$('#visualization .panel-body').first();
+
+ panel.css('min-height', $('.main-content').height());
+ target.animate({ width: $('.main-content').width() }, 'fast');
+ },
+
+ willDestroyElement: function () {
+ var target = this.$('#visualization');
+ var panel = this.$('#visualization .panel-body');
+
+ panel.css('min-height', 0);
+ target.css('width', 0);
+ }
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/big_tables.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/big_tables.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/big_tables.js
new file mode 100644
index 0000000..9f3a317
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/big_tables.js
@@ -0,0 +1,54 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var result = '';
+var tableCount = 15000;
+var columnCount = 100;
+
+//tables and columns script
+for (var i = 0; i < tableCount; i++) {
+ result += 'CREATE TABLE TABLE_' + i + ' (';
+ (function () {
+ for (var j = 0; j < columnCount; j++) {
+ result += 'field_' + j + ' STRING';
+
+ if (j < columnCount - 1) {
+ result += ',';
+ } else {
+ result += ') '
+ }
+ }
+ }());
+
+ result += "ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS TEXTFILE; \nLOAD DATA LOCAL INPATH 'test.csv' OVERWRITE INTO TABLE " +
+ 'TABLE_' + i + ';\n\n';
+}
+
+console.log(result);
+
+//csv script
+var fill = '';
+for (var i = 0; i < columnCount; i++) {
+ fill += 'field_' + i;
+
+ if (i < columnCount - 1) {
+ fill += ', ';
+ }
+}
+
+console.log(fill);
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/bower.json
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/bower.json b/contrib/views/hive-next/src/main/resources/ui/hive-web/bower.json
new file mode 100644
index 0000000..d029eff
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/bower.json
@@ -0,0 +1,28 @@
+{
+ "name": "hive",
+ "dependencies": {
+ "jquery": "1.11.3",
+ "ember": "1.10.0",
+ "ember-data": "1.0.0-beta.16.1",
+ "ember-resolver": "~0.1.12",
+ "loader.js": "stefanpenner/loader.js#3.2.0",
+ "ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.3",
+ "ember-cli-test-loader": "rwjblue/ember-cli-test-loader#0.1.3",
+ "ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2",
+ "ember-qunit": "0.4.0",
+ "ember-qunit-notifications": "0.0.7",
+ "qunit": "1.18.0",
+ "bootstrap": "~3.2.0",
+ "ember-i18n": "~3.0.0",
+ "blanket": "~1.1.5",
+ "jquery-ui": "~1.11.2",
+ "selectize": "~0.12.0",
+ "pretender": "0.1.0",
+ "ember-uploader": "0.3.9",
+ "polestar": "https://github.com/hortonworks/polestar.git#0.7.2",
+ "voyager": "https://github.com/hortonworks/voyager.git#0.7.2"
+ },
+ "resolutions": {
+ "ember": "1.10.0"
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/config/environment.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/config/environment.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/config/environment.js
new file mode 100644
index 0000000..992d91c
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/config/environment.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.
+ */
+
+/* jshint node: true */
+
+module.exports = function(environment) {
+ var ENV = {
+ modulePrefix: 'hive',
+ environment: environment,
+ baseURL: '/',
+ locationType: 'hash',
+ EmberENV: {
+ FEATURES: {
+ // Here you can enable experimental features on an ember canary build
+ // e.g. 'with-controller': true
+ }
+ },
+
+ contentSecurityPolicy: {
+ 'connect-src': "'self' ws://localhost:35729 ws://0.0.0.0:35729",
+ 'style-src': "'self' 'unsafe-inline'"
+ },
+
+ APP: {
+ // Here you can pass flags/options to your application instance
+ // when it is created
+ }
+ };
+
+ if (environment === 'development') {
+ // ENV.APP.LOG_RESOLVER = true;
+ ENV.APP.LOG_ACTIVE_GENERATION = true;
+ // ENV.APP.LOG_TRANSITIONS = true;
+ // ENV.APP.LOG_TRANSITIONS_INTERNAL = true;
+ ENV.APP.LOG_VIEW_LOOKUPS = true;
+ }
+
+ if (environment === 'test') {
+ // Testem prefers this...
+ ENV.baseURL = '/';
+ ENV.locationType = 'auto';
+
+ // keep test console output quieter
+ ENV.APP.LOG_ACTIVE_GENERATION = false;
+ ENV.APP.LOG_VIEW_LOOKUPS = false;
+
+ ENV.APP.rootElement = '#ember-testing';
+ }
+
+ if (environment === 'production') {
+
+ }
+
+ return ENV;
+};
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/package.json
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/package.json b/contrib/views/hive-next/src/main/resources/ui/hive-web/package.json
new file mode 100644
index 0000000..595b1f2
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "hive",
+ "version": "0.0.0",
+ "private": true,
+ "directories": {
+ "doc": "doc",
+ "test": "tests"
+ },
+ "scripts": {
+ "start": "ember server",
+ "build": "ember build",
+ "test": "ember test",
+ "preinstall": "chmod +x node/npm/bin/node-gyp-bin/node-gyp",
+ "postinstall": "bash node/with_new_path.sh node node_modules/.bin/bower --allow-root install"
+ },
+ "repository": "https://github.com/stefanpenner/ember-cli",
+ "engines": {
+ "node": ">= 0.10.32"
+ },
+ "author": "",
+ "license": "MIT",
+ "devDependencies": {
+ "body-parser": "^1.2.0",
+ "bower": ">= 1.3.12",
+ "broccoli-asset-rev": "^2.0.0",
+ "broccoli-sass": "0.6.3",
+ "ember-cli": "0.2.2",
+ "ember-cli-autoprefixer": "0.4.1",
+ "ember-cli-blanket": "^0.5.0",
+ "ember-cli-content-security-policy": "0.3.0",
+ "ember-cli-font-awesome": "0.0.4",
+ "ember-cli-htmlbars": "0.7.4",
+ "ember-cli-ic-ajax": "0.1.1",
+ "ember-cli-inject-live-reload": "^1.3.0",
+ "ember-cli-jquery-ui": "0.0.12",
+ "ember-cli-moment": "0.0.1",
+ "ember-cli-pretender": "^0.3.1",
+ "ember-cli-qunit": "0.3.14",
+ "ember-cli-selectize": "0.0.19",
+ "ember-cli-uglify": "1.0.1",
+ "ember-cli-uploader": "^0.3.9",
+ "ember-data": "1.0.0-beta.16.1",
+ "ember-dynamic-component": "0.0.1",
+ "ember-export-application-global": "^1.0.0",
+ "express": "^4.8.5"
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/testem.json
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/testem.json b/contrib/views/hive-next/src/main/resources/ui/hive-web/testem.json
new file mode 100644
index 0000000..78029a1
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/testem.json
@@ -0,0 +1,10 @@
+{
+ "framework": "qunit",
+ "test_page": "tests/index.html?hidepassed&nocontainer",
+ "launch_in_ci": [
+ "PhantomJS"
+ ],
+ "launch_in_dev": [
+ "Chrome"
+ ]
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/tests/.jshintrc
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/tests/.jshintrc b/contrib/views/hive-next/src/main/resources/ui/hive-web/tests/.jshintrc
new file mode 100644
index 0000000..6ebf71a
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/tests/.jshintrc
@@ -0,0 +1,74 @@
+{
+ "predef": [
+ "document",
+ "window",
+ "location",
+ "setTimeout",
+ "$",
+ "-Promise",
+ "QUnit",
+ "define",
+ "console",
+ "equal",
+ "notEqual",
+ "notStrictEqual",
+ "test",
+ "asyncTest",
+ "testBoth",
+ "testWithDefault",
+ "raises",
+ "throws",
+ "deepEqual",
+ "start",
+ "stop",
+ "ok",
+ "strictEqual",
+ "module",
+ "moduleFor",
+ "moduleForComponent",
+ "moduleForModel",
+ "process",
+ "expect",
+ "visit",
+ "exists",
+ "fillIn",
+ "click",
+ "keyEvent",
+ "triggerEvent",
+ "find",
+ "findWithAssert",
+ "wait",
+ "DS",
+ "isolatedContainer",
+ "startApp",
+ "andThen",
+ "currentURL",
+ "currentPath",
+ "currentRouteName"
+ ],
+ "node": false,
+ "browser": false,
+ "boss": true,
+ "curly": false,
+ "debug": false,
+ "devel": false,
+ "eqeqeq": true,
+ "evil": true,
+ "forin": false,
+ "immed": false,
+ "laxbreak": false,
+ "newcap": true,
+ "noarg": true,
+ "noempty": false,
+ "nonew": false,
+ "nomen": false,
+ "onevar": false,
+ "plusplus": false,
+ "regexp": false,
+ "undef": true,
+ "sub": true,
+ "strict": false,
+ "white": false,
+ "eqnull": true,
+ "esnext": true
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/b88db3cc/contrib/views/hive-next/src/main/resources/ui/hive-web/tests/blanket-options.js
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/resources/ui/hive-web/tests/blanket-options.js b/contrib/views/hive-next/src/main/resources/ui/hive-web/tests/blanket-options.js
new file mode 100644
index 0000000..63e022b
--- /dev/null
+++ b/contrib/views/hive-next/src/main/resources/ui/hive-web/tests/blanket-options.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.
+ */
+
+/*globals blanket, module */
+
+var options = {
+ modulePrefix: "hive",
+ filter: "//.*hive/.*/",
+ antifilter: "//.*(tests|template).*/",
+ loaderExclusions: ['ember-cli-jquery-ui', 'hive/config/environment'],
+ enableCoverage: true,
+ cliOptions: {
+ reporters: ['json']
+ }
+};
+
+if (typeof exports === 'undefined') {
+ blanket.options(options);
+} else {
+ module.exports = options;
+}