ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbhowm...@apache.org
Subject [21/21] ambari git commit: AMBARI-16963: JDBC implementation of hive view. (dipayanb)
Date Tue, 31 May 2016 19:44:37 GMT
AMBARI-16963: JDBC implementation of hive view. (dipayanb)


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

Branch: refs/heads/trunk
Commit: 9dc382a5b0a0f40b6891351058146e4f1062620c
Parents: 01a9225
Author: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Authored: Tue May 31 16:08:21 2016 +0530
Committer: Dipayan Bhowmick <dipayan.bhowmick@gmail.com>
Committed: Wed Jun 1 01:12:53 2016 +0530

----------------------------------------------------------------------
 contrib/views/hive-next/pom.xml                 | 369 +++++++++
 .../apache/ambari/view/hive2/BaseService.java   |  54 ++
 .../ambari/view/hive2/ConnectionDelegate.java   |  40 +
 .../ambari/view/hive2/ConnectionFactory.java    | 123 +++
 .../ambari/view/hive2/ConnectionSystem.java     | 100 +++
 .../apache/ambari/view/hive2/HelpService.java   | 118 +++
 .../view/hive2/HiveJdbcConnectionDelegate.java  | 144 ++++
 .../apache/ambari/view/hive2/HiveViewImpl.java  |  50 ++
 .../ambari/view/hive2/PropertyValidator.java    |  98 +++
 .../org/apache/ambari/view/hive2/TestBean.java  |  36 +
 .../view/hive2/actor/AsyncJdbcConnector.java    | 192 +++++
 .../view/hive2/actor/AsyncQueryExecutor.java    |  92 +++
 .../ambari/view/hive2/actor/DeathWatch.java     |  54 ++
 .../view/hive2/actor/GetResultHolder.java       |  47 ++
 .../ambari/view/hive2/actor/HiveActor.java      |  51 ++
 .../ambari/view/hive2/actor/JdbcConnector.java  | 305 ++++++++
 .../ambari/view/hive2/actor/LogAggregator.java  | 109 +++
 .../view/hive2/actor/OperationController.java   | 438 +++++++++++
 .../view/hive2/actor/ResultSetIterator.java     | 219 ++++++
 .../view/hive2/actor/SyncJdbcConnector.java     | 174 +++++
 .../ambari/view/hive2/actor/YarnAtsParser.java  |  32 +
 .../view/hive2/actor/message/AdvanceCursor.java |  32 +
 .../hive2/actor/message/AssignResultSet.java    |  48 ++
 .../hive2/actor/message/AssignStatement.java    |  46 ++
 .../view/hive2/actor/message/AsyncJob.java      |  52 ++
 .../view/hive2/actor/message/Connect.java       |  56 ++
 .../view/hive2/actor/message/CursorReset.java   |  22 +
 .../ambari/view/hive2/actor/message/DDLJob.java |  73 ++
 .../view/hive2/actor/message/ExecuteJob.java    |  38 +
 .../view/hive2/actor/message/ExecuteQuery.java  |  23 +
 .../view/hive2/actor/message/FetchError.java    |  42 ++
 .../view/hive2/actor/message/FetchResult.java   |  42 ++
 .../actor/message/GetColumnMetadataJob.java     |  60 ++
 .../view/hive2/actor/message/GetMoreLogs.java   |  22 +
 .../view/hive2/actor/message/HiveJob.java       |  63 ++
 .../view/hive2/actor/message/HiveMessage.java   |  53 ++
 .../actor/message/JobExecutionCompleted.java    |  21 +
 .../view/hive2/actor/message/JobRejected.java   |  44 ++
 .../view/hive2/actor/message/JobSubmitted.java  |  38 +
 .../actor/message/LogAggregationFinished.java   |  21 +
 .../view/hive2/actor/message/RegisterActor.java |  34 +
 .../view/hive2/actor/message/ResetCursor.java   |  22 +
 .../view/hive2/actor/message/ResultReady.java   |  47 ++
 .../actor/message/StartLogAggregation.java      |  21 +
 .../view/hive2/actor/message/SyncJob.java       |  27 +
 .../actor/message/job/AsyncExecutionFailed.java |  46 ++
 .../actor/message/job/ExecutionFailed.java      |  31 +
 .../view/hive2/actor/message/job/Failure.java   |  37 +
 .../hive2/actor/message/job/FetchFailed.java    |  31 +
 .../view/hive2/actor/message/job/Next.java      |  22 +
 .../hive2/actor/message/job/NoMoreItems.java    |  21 +
 .../view/hive2/actor/message/job/NoResult.java  |  21 +
 .../view/hive2/actor/message/job/Result.java    |  43 ++
 .../actor/message/job/ResultSetHolder.java      |  33 +
 .../hive2/actor/message/lifecycle/CleanUp.java  |  21 +
 .../message/lifecycle/DestroyConnector.java     |  52 ++
 .../actor/message/lifecycle/FreeConnector.java  |  53 ++
 .../message/lifecycle/InactivityCheck.java      |  21 +
 .../actor/message/lifecycle/KeepAlive.java      |  21 +
 .../lifecycle/TerminateInactivityCheck.java     |  21 +
 .../backgroundjobs/BackgroundJobController.java |  84 +++
 .../view/hive2/client/AsyncJobRunner.java       |  36 +
 .../view/hive2/client/AsyncJobRunnerImpl.java   | 115 +++
 .../view/hive2/client/ColumnDescription.java    |  45 ++
 .../hive2/client/ColumnDescriptionExtended.java |  74 ++
 .../hive2/client/ColumnDescriptionShort.java    |  53 ++
 .../view/hive2/client/ConnectionConfig.java     |  51 ++
 .../apache/ambari/view/hive2/client/Cursor.java |  30 +
 .../ambari/view/hive2/client/DDLDelegator.java  |  36 +
 .../view/hive2/client/DDLDelegatorImpl.java     | 242 ++++++
 .../ambari/view/hive2/client/EmptyCursor.java   | 110 +++
 .../view/hive2/client/HiveAuthCredentials.java  |  31 +
 .../hive2/client/HiveAuthRequiredException.java |  27 +
 .../client/HiveClientAuthRequiredException.java |  25 +
 .../view/hive2/client/HiveClientException.java  |  25 +
 .../client/HiveClientRuntimeException.java      |  25 +
 .../view/hive2/client/NonPersistentCursor.java  | 153 ++++
 .../view/hive2/client/PersistentCursor.java     |  87 +++
 .../apache/ambari/view/hive2/client/Row.java    |  74 ++
 .../hive2/exceptions/NotConnectedException.java |  28 +
 .../hive2/internal/AsyncExecutionFailure.java   |  23 +
 .../hive2/internal/AsyncExecutionSuccess.java   |  25 +
 .../ambari/view/hive2/internal/Connectable.java |  59 ++
 .../hive2/internal/ConnectionException.java     |  25 +
 .../hive2/internal/ConnectionProperties.java    |  94 +++
 .../view/hive2/internal/ConnectionSupplier.java |  37 +
 .../view/hive2/internal/ContextSupplier.java    |  37 +
 .../hive2/internal/DataStorageSupplier.java     |  42 ++
 .../view/hive2/internal/DefaultSupplier.java    |  62 ++
 .../ambari/view/hive2/internal/Either.java      |  78 ++
 .../view/hive2/internal/HdfsApiSupplier.java    |  59 ++
 .../hive2/internal/HiveConnectionWrapper.java   | 109 +++
 .../ambari/view/hive2/internal/HiveQuery.java   |  71 ++
 .../ambari/view/hive2/internal/HiveResult.java  | 160 ++++
 .../ambari/view/hive2/internal/HiveTask.java    |  53 ++
 .../view/hive2/internal/HiveTaskMessage.java    | 118 +++
 .../hive2/persistence/DataStoreStorage.java     | 172 +++++
 .../view/hive2/persistence/IStorageFactory.java |  23 +
 .../persistence/InstanceKeyValueStorage.java    | 132 ++++
 .../view/hive2/persistence/KeyValueStorage.java | 163 ++++
 .../hive2/persistence/LocalKeyValueStorage.java |  69 ++
 .../persistence/PersistentConfiguration.java    |  52 ++
 .../ambari/view/hive2/persistence/Storage.java  |  77 ++
 .../utils/ContextConfigurationAdapter.java      | 260 +++++++
 .../persistence/utils/FilteringStrategy.java    |  32 +
 .../view/hive2/persistence/utils/Indexed.java   |  36 +
 .../hive2/persistence/utils/ItemNotFound.java   |  25 +
 .../utils/OnlyOwnersFilteringStrategy.java      |  38 +
 .../view/hive2/persistence/utils/Owned.java     |  36 +
 .../persistence/utils/PersonalResource.java     |  22 +
 .../hive2/persistence/utils/StorageFactory.java |  69 ++
 .../hive2/resources/CRUDResourceManager.java    | 131 ++++
 .../view/hive2/resources/IResourceManager.java  |  37 +
 .../resources/PersonalCRUDResourceManager.java  |  99 +++
 .../resources/SharedCRUDResourceManager.java    |  44 ++
 .../resources/browser/HiveBrowserService.java   | 261 +++++++
 .../hive2/resources/files/FileResource.java     |  70 ++
 .../view/hive2/resources/files/FileService.java | 250 +++++++
 .../view/hive2/resources/jobs/Aggregator.java   | 259 +++++++
 .../hive2/resources/jobs/FileResourceShort.java |  55 ++
 .../jobs/IOperationHandleResourceManager.java   |  39 +
 .../resources/jobs/JobResourceProvider.java     | 117 +++
 .../view/hive2/resources/jobs/JobService.java   | 620 ++++++++++++++++
 .../view/hive2/resources/jobs/LogParser.java    | 139 ++++
 .../jobs/ModifyNotificationDelegate.java        |  23 +
 .../ModifyNotificationInvocationHandler.java    |  40 +
 .../jobs/NoOperationStatusSetException.java     |  23 +
 .../jobs/OperationHandleResourceManager.java    | 110 +++
 .../hive2/resources/jobs/ProgressRetriever.java |  66 ++
 .../jobs/ResultsPaginationController.java       | 299 ++++++++
 .../resources/jobs/StoredOperationHandle.java   | 140 ++++
 .../hive2/resources/jobs/atsJobs/ATSParser.java | 184 +++++
 .../jobs/atsJobs/ATSParserFactory.java          |  42 ++
 .../jobs/atsJobs/ATSRequestsDelegate.java       |  43 ++
 .../jobs/atsJobs/ATSRequestsDelegateImpl.java   | 146 ++++
 .../resources/jobs/atsJobs/HiveQueryId.java     |  42 ++
 .../resources/jobs/atsJobs/IATSParser.java      |  33 +
 .../hive2/resources/jobs/atsJobs/TezDagId.java  |  26 +
 .../resources/jobs/atsJobs/TezVertexId.java     |  24 +
 .../view/hive2/resources/jobs/rm/RMParser.java  | 129 ++++
 .../resources/jobs/rm/RMParserFactory.java      |  48 ++
 .../resources/jobs/rm/RMRequestsDelegate.java   |  31 +
 .../jobs/rm/RMRequestsDelegateImpl.java         |  99 +++
 .../jobs/viewJobs/IJobControllerFactory.java    |  23 +
 .../view/hive2/resources/jobs/viewJobs/Job.java | 131 ++++
 .../resources/jobs/viewJobs/JobController.java  |  54 ++
 .../jobs/viewJobs/JobControllerFactory.java     |  41 +
 .../jobs/viewJobs/JobControllerImpl.java        | 397 ++++++++++
 .../hive2/resources/jobs/viewJobs/JobImpl.java  | 322 ++++++++
 .../jobs/viewJobs/JobResourceManager.java       | 108 +++
 .../resources/resources/FileResourceItem.java   |  78 ++
 .../resources/FileResourceResourceManager.java  |  65 ++
 .../resources/FileResourceResourceProvider.java | 110 +++
 .../resources/FileResourceService.java          | 180 +++++
 .../resources/savedQueries/SavedQuery.java      |  96 +++
 .../savedQueries/SavedQueryResourceManager.java | 162 ++++
 .../SavedQueryResourceProvider.java             | 113 +++
 .../savedQueries/SavedQueryService.java         | 230 ++++++
 .../ambari/view/hive2/resources/udfs/UDF.java   |  87 +++
 .../resources/udfs/UDFResourceManager.java      |  65 ++
 .../resources/udfs/UDFResourceProvider.java     | 111 +++
 .../view/hive2/resources/udfs/UDFService.java   | 193 +++++
 .../uploads/ColumnDescriptionImpl.java          | 119 +++
 .../hive2/resources/uploads/HiveFileType.java   |  30 +
 .../resources/uploads/TableDataReader.java      |  86 +++
 .../hive2/resources/uploads/TableInput.java     |  90 +++
 .../resources/uploads/UploadFromHdfsInput.java  |  91 +++
 .../hive2/resources/uploads/UploadService.java  | 463 ++++++++++++
 .../resources/uploads/parsers/DataParser.java   |  72 ++
 .../uploads/parsers/EndOfDocumentException.java |  41 +
 .../resources/uploads/parsers/IParser.java      |  44 ++
 .../resources/uploads/parsers/ParseOptions.java |  49 ++
 .../resources/uploads/parsers/ParseUtils.java   | 133 ++++
 .../hive2/resources/uploads/parsers/Parser.java | 154 ++++
 .../resources/uploads/parsers/PreviewData.java  |  56 ++
 .../resources/uploads/parsers/RowIterator.java  |  96 +++
 .../uploads/parsers/RowMapIterator.java         |  29 +
 .../uploads/parsers/csv/CSVIterator.java        |  57 ++
 .../uploads/parsers/csv/CSVParser.java          |  55 ++
 .../uploads/parsers/json/JSONIterator.java      | 160 ++++
 .../uploads/parsers/json/JSONParser.java        |  85 +++
 .../uploads/parsers/xml/XMLIterator.java        | 195 +++++
 .../uploads/parsers/xml/XMLParser.java          | 100 +++
 .../uploads/query/DeleteQueryInput.java         |  48 ++
 .../uploads/query/InsertFromQueryInput.java     |  68 ++
 .../resources/uploads/query/LoadQueryInput.java |  67 ++
 .../resources/uploads/query/QueryGenerator.java |  98 +++
 .../resources/uploads/query/TableInfo.java      |  83 +++
 .../utils/BadRequestFormattedException.java     |  27 +
 .../ambari/view/hive2/utils/FilePaginator.java  | 127 ++++
 .../hive2/utils/HiveActorConfiguration.java     |  71 ++
 .../utils/HiveClientFormattedException.java     |  26 +
 .../view/hive2/utils/LoggingOutputStream.java   |  85 +++
 .../MisconfigurationFormattedException.java     |  47 ++
 .../hive2/utils/NotFoundFormattedException.java |  27 +
 .../hive2/utils/ServiceFormattedException.java  | 105 +++
 .../view/hive2/utils/SharedObjectsFactory.java  | 185 +++++
 .../src/main/resources/application.conf         |  57 ++
 .../src/main/resources/ui/hive-web/.bowerrc     |   4 +
 .../main/resources/ui/hive-web/.editorconfig    |  34 +
 .../src/main/resources/ui/hive-web/.ember-cli   |  27 +
 .../src/main/resources/ui/hive-web/.gitignore   |  37 +
 .../src/main/resources/ui/hive-web/.jshintrc    |  33 +
 .../src/main/resources/ui/hive-web/.travis.yml  |  38 +
 .../src/main/resources/ui/hive-web/Brocfile.js  |  54 ++
 .../src/main/resources/ui/hive-web/README.md    |  14 +
 .../ui/hive-web/app/adapters/application.js     |  46 ++
 .../ui/hive-web/app/adapters/database.js        |  25 +
 .../ui/hive-web/app/adapters/file-upload.js     |  31 +
 .../resources/ui/hive-web/app/adapters/file.js  |  26 +
 .../ui/hive-web/app/adapters/upload-table.js    |  93 +++
 .../src/main/resources/ui/hive-web/app/app.js   |  34 +
 .../ui/hive-web/app/components/.gitkeep         |   0
 .../app/components/alert-message-widget.js      |  35 +
 .../app/components/collapsible-widget.js        |  38 +
 .../app/components/column-filter-widget.js      |  56 ++
 .../app/components/date-range-widget.js         |  85 +++
 .../hive-web/app/components/expander-widget.js  |  36 +
 .../hive-web/app/components/extended-input.js   |  50 ++
 .../ui/hive-web/app/components/file-upload.js   |  25 +
 .../ui/hive-web/app/components/input-header.js  |  61 ++
 .../ui/hive-web/app/components/job-tr-view.js   |  41 +
 .../ui/hive-web/app/components/modal-widget.js  |  58 ++
 .../ui/hive-web/app/components/navbar-widget.js |  42 ++
 .../ui/hive-web/app/components/no-bubbling.js   |  31 +
 .../ui/hive-web/app/components/notify-widget.js |  31 +
 .../app/components/number-range-widget.js       |  70 ++
 .../ui/hive-web/app/components/panel-widget.js  |  30 +
 .../hive-web/app/components/popover-widget.js   |  34 +
 .../hive-web/app/components/progress-widget.js  |  30 +
 .../ui/hive-web/app/components/query-editor.js  | 129 ++++
 .../ui/hive-web/app/components/radio-button.js  |  39 +
 .../ui/hive-web/app/components/select-widget.js |  66 ++
 .../ui/hive-web/app/components/tabs-widget.js   |  68 ++
 .../ui/hive-web/app/components/tree-view.js     |  23 +
 .../hive-web/app/components/typeahead-widget.js | 108 +++
 .../ui/hive-web/app/components/udf-tr-view.js   |  81 ++
 .../app/components/visualization-tabs-widget.js |  56 ++
 .../ui/hive-web/app/controllers/.gitkeep        |   0
 .../ui/hive-web/app/controllers/application.js  |  26 +
 .../ui/hive-web/app/controllers/databases.js    | 457 ++++++++++++
 .../ui/hive-web/app/controllers/history.js      | 172 +++++
 .../ui/hive-web/app/controllers/index.js        | 731 ++++++++++++++++++
 .../controllers/index/history-query/explain.js  | 134 ++++
 .../app/controllers/index/history-query/logs.js | 108 +++
 .../controllers/index/history-query/results.js  | 238 ++++++
 .../ui/hive-web/app/controllers/insert-udfs.js  |  58 ++
 .../ui/hive-web/app/controllers/messages.js     |  41 +
 .../ui/hive-web/app/controllers/modal-delete.js |  33 +
 .../app/controllers/modal-save-query.js         |  42 ++
 .../ui/hive-web/app/controllers/modal-save.js   |  34 +
 .../ui/hive-web/app/controllers/open-queries.js | 397 ++++++++++
 .../ui/hive-web/app/controllers/queries.js      | 125 ++++
 .../ui/hive-web/app/controllers/query-tabs.js   | 176 +++++
 .../ui/hive-web/app/controllers/settings.js     |  69 ++
 .../ui/hive-web/app/controllers/splash.js       | 126 ++++
 .../ui/hive-web/app/controllers/tez-ui.js       | 106 +++
 .../ui/hive-web/app/controllers/udfs.js         | 143 ++++
 .../ui/hive-web/app/controllers/upload-table.js | 740 +++++++++++++++++++
 .../hive-web/app/controllers/visual-explain.js  |  64 ++
 .../app/controllers/visualization-ui.js         | 134 ++++
 .../resources/ui/hive-web/app/helpers/.gitkeep  |   0
 .../ui/hive-web/app/helpers/all-uppercase.js    |  25 +
 .../ui/hive-web/app/helpers/code-helper.js      |  28 +
 .../ui/hive-web/app/helpers/date-binding.js     |  27 +
 .../hive-web/app/helpers/format-column-type.js  |  39 +
 .../ui/hive-web/app/helpers/log-helper.js       |  28 +
 .../ui/hive-web/app/helpers/path-binding.js     |  29 +
 .../hive-web/app/helpers/preformatted-string.js |  28 +
 .../ui/hive-web/app/helpers/tb-helper.js        |  33 +
 .../main/resources/ui/hive-web/app/index.html   |  42 ++
 .../ui/hive-web/app/initializers/i18n.js        | 269 +++++++
 .../ui/hive-web/app/mixins/filterable.js        | 106 +++
 .../ui/hive-web/app/mixins/sortable.js          |  31 +
 .../resources/ui/hive-web/app/models/.gitkeep   |   0
 .../ui/hive-web/app/models/database.js          |  25 +
 .../ui/hive-web/app/models/file-resource.js     |  25 +
 .../resources/ui/hive-web/app/models/file.js    |  26 +
 .../resources/ui/hive-web/app/models/job.js     |  54 ++
 .../ui/hive-web/app/models/saved-query.js       |  29 +
 .../resources/ui/hive-web/app/models/udf.js     |  27 +
 .../main/resources/ui/hive-web/app/router.js    |  50 ++
 .../resources/ui/hive-web/app/routes/.gitkeep   |   0
 .../ui/hive-web/app/routes/application.js       |  89 +++
 .../resources/ui/hive-web/app/routes/history.js |  46 ++
 .../app/routes/index/history-query/explain.js   |  28 +
 .../app/routes/index/history-query/index.js     |  44 ++
 .../app/routes/index/history-query/logs.js      |  28 +
 .../app/routes/index/history-query/results.js   |  28 +
 .../ui/hive-web/app/routes/index/index.js       |  36 +
 .../ui/hive-web/app/routes/index/saved-query.js |  43 ++
 .../resources/ui/hive-web/app/routes/loading.js |  22 +
 .../resources/ui/hive-web/app/routes/queries.js |  40 +
 .../resources/ui/hive-web/app/routes/splash.js  |  59 ++
 .../resources/ui/hive-web/app/routes/udfs.js    |  36 +
 .../ui/hive-web/app/serializers/database.js     |  41 +
 .../ui/hive-web/app/serializers/file.js         |  23 +
 .../ui/hive-web/app/services/database.js        | 243 ++++++
 .../resources/ui/hive-web/app/services/file.js  |  59 ++
 .../ui/hive-web/app/services/job-progress.js    | 102 +++
 .../resources/ui/hive-web/app/services/job.js   |  56 ++
 .../ui/hive-web/app/services/notify.js          | 113 +++
 .../ui/hive-web/app/services/session.js         |  48 ++
 .../ui/hive-web/app/services/settings.js        | 175 +++++
 .../resources/ui/hive-web/app/styles/.gitkeep   |   0
 .../resources/ui/hive-web/app/styles/app.scss   | 680 +++++++++++++++++
 .../hive-web/app/styles/dropdown-submenu.scss   |  65 ++
 .../ui/hive-web/app/styles/mixins.scss          |  28 +
 .../ui/hive-web/app/styles/notifications.scss   |  37 +
 .../ui/hive-web/app/styles/query-tabs.scss      |  69 ++
 .../resources/ui/hive-web/app/styles/vars.scss  |  21 +
 .../ui/hive-web/app/templates/.gitkeep          |   0
 .../ui/hive-web/app/templates/application.hbs   |  26 +
 .../hive-web/app/templates/components/.gitkeep  |   0
 .../components/alert-message-widget.hbs         |  28 +
 .../templates/components/collapsible-widget.hbs |  33 +
 .../components/column-filter-widget.hbs         |  42 ++
 .../templates/components/date-range-widget.hbs  |  22 +
 .../templates/components/expander-widget.hbs    |  31 +
 .../app/templates/components/input-header.hbs   |  20 +
 .../app/templates/components/job-tr-view.hbs    |  49 ++
 .../app/templates/components/modal-widget.hbs   |  35 +
 .../app/templates/components/navbar-widget.hbs  |  45 ++
 .../app/templates/components/no-bubbling.hbs    |  19 +
 .../app/templates/components/notify-widget.hbs  |  21 +
 .../components/number-range-widget.hbs          |  23 +
 .../app/templates/components/panel-widget.hbs   |  54 ++
 .../app/templates/components/popover-widget.hbs |  19 +
 .../templates/components/progress-widget.hbs    |  23 +
 .../app/templates/components/query-editor.hbs   |  19 +
 .../app/templates/components/select-widget.hbs  |  39 +
 .../app/templates/components/tabs-widget.hbs    |  41 +
 .../app/templates/components/tree-view.hbs      |  28 +
 .../app/templates/components/udf-tr-view.hbs    |  77 ++
 .../components/visualization-tabs-widget.hbs    |  27 +
 .../app/templates/databases-search-results.hbs  |  50 ++
 .../hive-web/app/templates/databases-tree.hbs   |  50 ++
 .../ui/hive-web/app/templates/databases.hbs     |  54 ++
 .../ui/hive-web/app/templates/history.hbs       |  63 ++
 .../ui/hive-web/app/templates/index.hbs         | 110 +++
 .../templates/index/history-query/explain.hbs   |  23 +
 .../app/templates/index/history-query/logs.hbs  |  19 +
 .../templates/index/history-query/results.hbs   |  56 ++
 .../ui/hive-web/app/templates/insert-udfs.hbs   |  46 ++
 .../ui/hive-web/app/templates/loading.hbs       |  19 +
 .../ui/hive-web/app/templates/logs.hbs          |  19 +
 .../ui/hive-web/app/templates/message.hbs       |  36 +
 .../ui/hive-web/app/templates/messages.hbs      |  32 +
 .../ui/hive-web/app/templates/modal-delete.hbs  |  21 +
 .../hive-web/app/templates/modal-save-query.hbs |  24 +
 .../ui/hive-web/app/templates/modal-save.hbs    |  21 +
 .../ui/hive-web/app/templates/notification.hbs  |  23 +
 .../ui/hive-web/app/templates/open-queries.hbs  |  23 +
 .../ui/hive-web/app/templates/queries.hbs       |  96 +++
 .../ui/hive-web/app/templates/query-tabs.hbs    |  28 +
 .../ui/hive-web/app/templates/redirect.hbs      |  19 +
 .../ui/hive-web/app/templates/settings.hbs      |  70 ++
 .../ui/hive-web/app/templates/splash.hbs        | 102 +++
 .../ui/hive-web/app/templates/tez-ui.hbs        |  31 +
 .../ui/hive-web/app/templates/udfs.hbs          |  53 ++
 .../ui/hive-web/app/templates/upload-table.hbs  | 168 +++++
 .../hive-web/app/templates/visual-explain.hbs   |  93 +++
 .../hive-web/app/templates/visualization-ui.hbs |  37 +
 .../ui/hive-web/app/transforms/date.js          |  49 ++
 .../ui/hive-web/app/utils/constants.js          | 233 ++++++
 .../ui/hive-web/app/utils/dag-rules.js          | 141 ++++
 .../ui/hive-web/app/utils/functions.js          | 139 ++++
 .../resources/ui/hive-web/app/views/.gitkeep    |   0
 .../resources/ui/hive-web/app/views/index.js    |  28 +
 .../resources/ui/hive-web/app/views/message.js  |  36 +
 .../resources/ui/hive-web/app/views/messages.js |  37 +
 .../ui/hive-web/app/views/notification.js       |  51 ++
 .../resources/ui/hive-web/app/views/tez-ui.js   |  37 +
 .../ui/hive-web/app/views/visual-explain.js     | 461 ++++++++++++
 .../ui/hive-web/app/views/visualization-ui.js   |  37 +
 .../main/resources/ui/hive-web/big_tables.js    |  54 ++
 .../src/main/resources/ui/hive-web/bower.json   |  28 +
 .../resources/ui/hive-web/config/environment.js |  70 ++
 .../src/main/resources/ui/hive-web/package.json |  47 ++
 .../src/main/resources/ui/hive-web/testem.json  |  10 +
 .../main/resources/ui/hive-web/tests/.jshintrc  |  74 ++
 .../ui/hive-web/tests/blanket-options.js        |  36 +
 .../ui/hive-web/tests/helpers/api-mock.js       | 291 ++++++++
 .../ui/hive-web/tests/helpers/resolver.js       |  29 +
 .../ui/hive-web/tests/helpers/start-app.js      |  43 ++
 .../resources/ui/hive-web/tests/img/spinner.gif | Bin 0 -> 11435 bytes
 .../main/resources/ui/hive-web/tests/index.html |  71 ++
 .../hive-web/tests/integration/database-test.js | 103 +++
 .../hive-web/tests/integration/history-test.js  |  95 +++
 .../tests/integration/query-editor-test.js      | 106 +++
 .../tests/integration/saved-queries-test.js     | 126 ++++
 .../hive-web/tests/integration/tez-ui-test.js   |  49 ++
 .../ui/hive-web/tests/integration/udfs-test.js  |  91 +++
 .../resources/ui/hive-web/tests/test-helper.js  |  24 +
 .../resources/ui/hive-web/tests/unit/.gitkeep   |   0
 .../hive-web/tests/unit/adapters/application.js |  48 ++
 .../ui/hive-web/tests/unit/adapters/file.js     |  39 +
 .../components/alert-message-widget-test.js     |  91 +++
 .../unit/components/collapsible-widget-test.js  |  46 ++
 .../components/column-filter-widget-test.js     | 138 ++++
 .../unit/components/date-range-widget-test.js   | 132 ++++
 .../unit/components/expander-widget-test.js     |  59 ++
 .../unit/components/extended-input-test.js      |  81 ++
 .../tests/unit/components/job-tr-view-test.js   |  62 ++
 .../tests/unit/components/modal-widget-test.js  |  69 ++
 .../tests/unit/components/no-bubbling-test.js   |  44 ++
 .../unit/components/number-range-widget-test.js |  70 ++
 .../unit/components/popover-widget-test.js      |  36 +
 .../unit/components/progress-widget-test.js     |  40 +
 .../tests/unit/components/query-editor-test.js  |  52 ++
 .../tests/unit/components/select-widget-test.js | 158 ++++
 .../tests/unit/components/tabs-wiget-test.js    | 117 +++
 .../unit/components/typeahead-widget-test.js    |  46 ++
 .../tests/unit/controllers/databases-test.js    | 276 +++++++
 .../tests/unit/controllers/history-test.js      | 117 +++
 .../tests/unit/controllers/index-test.js        | 328 ++++++++
 .../tests/unit/controllers/insert-udfs-test.js  |  68 ++
 .../tests/unit/controllers/messages-test.js     |  53 ++
 .../tests/unit/controllers/open-queries-test.js | 102 +++
 .../tests/unit/controllers/queries-test.js      |  35 +
 .../tests/unit/controllers/settings-test.js     | 136 ++++
 .../tests/unit/controllers/tez-ui-test.js       |  98 +++
 .../tests/unit/controllers/udfs-test.js         |  60 ++
 .../tests/unit/helpers/path-binding-test.js     |  35 +
 .../hive-web/tests/unit/services/notify-test.js | 155 ++++
 .../tests/unit/services/settings-test.js        | 155 ++++
 .../tests/unit/views/visual-explain-test.js     | 106 +++
 .../main/resources/ui/hive-web/vendor/.gitkeep  |   0
 .../vendor/codemirror/codemirror-min.js         |  17 +
 .../hive-web/vendor/codemirror/codemirror.css   | 309 ++++++++
 .../ui/hive-web/vendor/codemirror/show-hint.css |  38 +
 .../ui/hive-web/vendor/codemirror/show-hint.js  | 389 ++++++++++
 .../ui/hive-web/vendor/codemirror/sql-hint.js   | 192 +++++
 .../resources/ui/hive-web/vendor/dagre.min.js   |  27 +
 .../src/main/resources/view.log4j.properties    |  31 +
 .../views/hive-next/src/main/resources/view.xml | 298 ++++++++
 .../ambari/view/hive2/AsyncQueriesTest.java     | 124 ++++
 .../ambari/view/hive2/InactivityTest.java       | 109 +++
 .../apache/ambari/view/hive2/Mocksupport.java   |  94 +++
 .../ambari/view/hive2/SyncQueriesTest.java      | 141 ++++
 contrib/views/pom.xml                           |   1 +
 pom.xml                                         |   2 +
 442 files changed, 36116 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/pom.xml
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/pom.xml b/contrib/views/hive-next/pom.xml
new file mode 100644
index 0000000..0b395e8
--- /dev/null
+++ b/contrib/views/hive-next/pom.xml
@@ -0,0 +1,369 @@
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+-->
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.ambari.contrib.views</groupId>
+  <artifactId>hive-jdbc</artifactId>
+  <version>2.0.0.0-SNAPSHOT</version>
+  <name>Hive</name>
+
+  <parent>
+    <groupId>org.apache.ambari.contrib.views</groupId>
+    <artifactId>ambari-contrib-views</artifactId>
+    <version>2.0.0.0-SNAPSHOT</version>
+  </parent>
+
+  <repositories>
+    <repository>
+      <id>repository.apache.org</id>
+      <name>Apache Snapshot repo</name>
+      <url>https://repository.apache.org/content/groups/snapshots</url>
+    </repository>
+  </repositories>
+
+  <dependencies>
+    <dependency>
+      <groupId>com.jayway.jsonpath</groupId>
+      <artifactId>json-path</artifactId>
+      <version>2.0.0</version>
+    </dependency>
+      <dependency>
+      <groupId>com.google.inject</groupId>
+      <artifactId>guice</artifactId>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.jersey.contribs</groupId>
+      <artifactId>jersey-multipart</artifactId>
+      <version>1.18</version>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-client</artifactId>
+      <version>1.8</version>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-core</artifactId>
+      <version>1.18.1</version>
+    </dependency>
+    <dependency>
+      <groupId>com.sun.jersey</groupId>
+      <artifactId>jersey-json</artifactId>
+      <version>1.9</version>
+    </dependency>
+    <dependency>
+      <groupId>com.googlecode.json-simple</groupId>
+      <artifactId>json-simple</artifactId>
+      <version>1.1.1</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-configuration</groupId>
+      <artifactId>commons-configuration</artifactId>
+      <version>1.6</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-csv</artifactId>
+      <version>1.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-collections4</artifactId>
+      <version>4.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.ambari</groupId>
+      <artifactId>ambari-views</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.google.code.gson</groupId>
+      <artifactId>gson</artifactId>
+      <version>2.2.2</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.servlet</groupId>
+      <artifactId>javax.servlet-api</artifactId>
+      <version>3.0.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.7.5</version>
+    </dependency>
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-simple</artifactId>
+      <version>1.7.5</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-hdfs</artifactId>
+      <version>${hadoop.version}</version>
+        <exclusions>
+            <exclusion>
+                <groupId>tomcat</groupId>
+                <artifactId>jasper-runtime</artifactId>
+            </exclusion>
+        </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-common</artifactId>
+      <version>${hadoop.version}</version>
+        <exclusions>
+            <exclusion>
+                <groupId>tomcat</groupId>
+                <artifactId>jasper-runtime</artifactId>
+            </exclusion>
+        </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-mapreduce-client-common</artifactId>
+      <version>${hadoop.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-mapreduce-client-core</artifactId>
+      <version>${hadoop.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-yarn-client</artifactId>
+      <version>${hadoop.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>javax.ws.rs</groupId>
+      <artifactId>javax.ws.rs-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hive</groupId>
+      <artifactId>hive-jdbc</artifactId>
+      <version>${hive-version}</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-cli</groupId>
+      <artifactId>commons-cli</artifactId>
+      <version>1.2</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-lang</groupId>
+      <artifactId>commons-lang</artifactId>
+      <version>2.2</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.thrift</groupId>
+      <artifactId>libthrift</artifactId>
+      <version>0.9.0</version>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.easymock</groupId>
+      <artifactId>easymock</artifactId>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>com.typesafe.akka</groupId>
+      <artifactId>akka-testkit_2.11</artifactId>
+      <version>2.3.15</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.hadoop</groupId>
+      <artifactId>hadoop-minicluster</artifactId>
+      <version>${hadoop.version}</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.ambari.contrib.views</groupId>
+      <artifactId>ambari-views-utils</artifactId>
+      <version>2.0.0.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-validator</groupId>
+      <artifactId>commons-validator</artifactId>
+      <version>1.4.0</version>
+    </dependency>
+    <dependency>
+      <groupId>commons-io</groupId>
+      <artifactId>commons-io</artifactId>
+      <version>2.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.httpcomponents</groupId>
+      <artifactId>httpclient</artifactId>
+      <version>4.5.1</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.httpcomponents</groupId>
+      <artifactId>httpcore</artifactId>
+      <version>4.4.3</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-csv</artifactId>
+      <version>1.1</version>
+    </dependency>
+    <dependency>
+      <groupId>com.typesafe.akka</groupId>
+      <artifactId>akka-actor_2.11</artifactId>
+      <version>2.3.15</version>
+    </dependency>
+  </dependencies>
+
+  <properties>
+    <ambari.dir>${project.parent.parent.parent.basedir}</ambari.dir>
+    <hive-version>2.1.0-SNAPSHOT</hive-version>
+    <ambari.version>1.3.0.0-SNAPSHOT</ambari.version>
+  </properties>
+  <build>
+    <plugins>
+
+      <!-- Building frontend -->
+      <plugin>
+        <groupId>com.github.eirslett</groupId>
+        <artifactId>frontend-maven-plugin</artifactId>
+        <version>0.0.16</version>
+        <configuration>
+          <nodeVersion>v0.12.2</nodeVersion>
+          <npmVersion>1.4.8</npmVersion>
+          <workingDirectory>src/main/resources/ui/hive-web/</workingDirectory>
+        </configuration>
+        <executions>
+          <execution>
+            <id>install node and npm</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>install-node-and-npm</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>npm install</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>npm</goal>
+            </goals>
+            <configuration>
+              <arguments>install --python="${project.basedir}/../src/main/unix/ambari-python-wrap" --unsafe-perm</arguments>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <artifactId>exec-maven-plugin</artifactId>
+        <groupId>org.codehaus.mojo</groupId>
+        <version>1.3.2</version>
+        <executions>
+          <execution>
+            <id>Hive build</id>
+            <phase>generate-sources</phase>
+            <goals>
+              <goal>exec</goal>
+            </goals>
+            <configuration>
+              <workingDirectory>${basedir}/src/main/resources/ui/hive-web</workingDirectory>
+              <executable>node/node</executable>
+              <arguments>
+                <argument>node_modules/.bin/ember</argument>
+                <argument>build</argument>
+              </arguments>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>3.1</version>
+        <configuration>
+          <source>1.7</source>
+          <target>1.7</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+            <phase>generate-resources</phase>
+            <goals>
+              <goal>copy-dependencies</goal>
+            </goals>
+            <configuration>
+              <outputDirectory>${project.build.directory}/lib</outputDirectory>
+              <includeScope>runtime</includeScope>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+      <plugin>
+       <groupId>org.vafer</groupId>
+       <artifactId>jdeb</artifactId>
+       <version>1.0.1</version>
+       <executions>
+           <execution>
+               <phase>none</phase>
+               <goals>
+                   <goal>jdeb</goal>
+               </goals>
+           </execution>
+       </executions>
+       <configuration>
+           <submodules>false</submodules>
+       </configuration>
+     </plugin>
+    </plugins>
+    <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+        <filtering>false</filtering>
+        <includes>
+          <include>META-INF/**/*</include>
+          <include>view.xml</include>
+          <include>view.log4j.properties</include>
+          <include>application.conf</include>
+        </includes>
+      </resource>
+      <resource>
+        <directory>src/main/resources/ui/hive-web/dist</directory>
+        <filtering>false</filtering>
+      </resource>
+      <resource>
+        <directory>src/main/resources/ui/hive-web/bower_components/polestar</directory>
+        <filtering>false</filtering>
+        <targetPath>polestar</targetPath>
+      </resource>
+      <resource>
+        <directory>src/main/resources/ui/hive-web/bower_components/voyager</directory>
+        <filtering>false</filtering>
+        <targetPath>voyager</targetPath>
+      </resource>
+      <resource>
+        <targetPath>WEB-INF/lib</targetPath>
+        <filtering>false</filtering>
+        <directory>target/lib</directory>
+      </resource>
+    </resources>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/BaseService.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/BaseService.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/BaseService.java
new file mode 100644
index 0000000..773aa55
--- /dev/null
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/BaseService.java
@@ -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.
+ */
+
+package org.apache.ambari.view.hive2;
+
+import org.apache.ambari.view.ViewContext;
+import org.apache.ambari.view.hive2.utils.SharedObjectsFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+
+
+/**
+ * Parent service
+ */
+public class BaseService {
+  @Inject
+  protected ViewContext context;
+
+  protected final static Logger LOG =
+      LoggerFactory.getLogger(BaseService.class);
+
+  private SharedObjectsFactory sharedObjectsFactory;
+  public SharedObjectsFactory getSharedObjectsFactory() {
+    if (sharedObjectsFactory == null) {
+      sharedObjectsFactory = new SharedObjectsFactory(context);
+    }
+    return sharedObjectsFactory;
+  }
+
+  public void setSharedObjectsFactory(SharedObjectsFactory sharedObjectsFactory) {
+    this.sharedObjectsFactory = sharedObjectsFactory;
+  }
+
+  public BaseService() {
+//    Thread.currentThread().setContextClassLoader(null);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionDelegate.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionDelegate.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionDelegate.java
new file mode 100644
index 0000000..918dc68
--- /dev/null
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionDelegate.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.view.hive2;
+
+import com.google.common.base.Optional;
+import org.apache.ambari.view.hive2.actor.message.DDLJob;
+import org.apache.ambari.view.hive2.actor.message.GetColumnMetadataJob;
+import org.apache.ambari.view.hive2.actor.message.HiveJob;
+import org.apache.ambari.view.hive2.internal.HiveResult;
+import org.apache.hive.jdbc.HiveConnection;
+import org.apache.hive.jdbc.HiveStatement;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+public interface ConnectionDelegate {
+  Optional<ResultSet> execute(HiveConnection connection, DDLJob job) throws SQLException;
+  Optional<ResultSet> executeSync(HiveConnection connection, DDLJob job) throws SQLException;
+  Optional<ResultSet> getColumnMetadata(HiveConnection connection, GetColumnMetadataJob job) throws SQLException;
+  Optional<ResultSet> getCurrentResultSet();
+  Optional<HiveStatement> getCurrentStatement();
+  void closeResultSet();
+  void closeStatement();
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java
new file mode 100644
index 0000000..3390b28
--- /dev/null
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.view.hive2;
+
+import com.google.common.base.Function;
+import com.google.common.base.Joiner;
+import com.google.common.collect.FluentIterable;
+import org.apache.ambari.view.ViewContext;
+import org.apache.ambari.view.hive2.client.ConnectionConfig;
+
+import java.util.List;
+
+public class ConnectionFactory {
+
+  private static String ZK_HIVE_DYN_SERVICE_DISCOVERY_KEY = "hive.server2.support.dynamic.service.discovery";
+  private static String ZK_HIVE_NAMESPACE_KEY = "hive.server2.zookeeper.namespace";
+  private static String ZK_HIVE_QUORUM = "hive.zookeeper.quorum";
+
+  private static String AMBARI_HIVE_SERVICE_NAME = "HIVE";
+  private static String AMBARI_HIVESERVER_COMPONENT_NAME = "HIVE_SERVER";
+
+  private static String HIVE_SITE = "hive-site";
+  private static String HIVE_INTERACTIVE_SITE = "hive-interactive-site";
+
+  private static String HIVE_JDBC_URL_KEY = "hive.jdbc.url";
+  private static final String HIVE_SESSION_PARAMS = "hive.session.params";
+
+  private static String BINARY_PORT_KEY = "hive.server2.thrift.port";
+  private static String HTTP_PORT_KEY = "hive.server2.thrift.http.port";
+  private static String HIVE_TRANSPORT_MODE_KEY = "hive.server2.transport.mode";
+  private static String HTTP_PATH_KEY = "hive.server2.thrift.http.path";
+
+
+  public static ConnectionConfig create(ViewContext context) {
+    String jdbcUrl;
+    if (context.getCluster() == null) {
+      jdbcUrl = getConnectFromCustom(context);
+    } else {
+      if (zookeeperConfigured(context)) {
+        jdbcUrl = getFromClusterZookeeperConfig(context);
+      } else {
+        jdbcUrl = getFromHiveConfiguration(context);
+      }
+    }
+
+    String userName = context.getUsername();
+    return new ConnectionConfig(userName, "", jdbcUrl);
+  }
+
+  private static String getFromHiveConfiguration(ViewContext context) {
+    String transportMode = context.getCluster().getConfigurationValue(HIVE_SITE, HIVE_TRANSPORT_MODE_KEY);
+    String binaryPort = context.getCluster().getConfigurationValue(HIVE_SITE, BINARY_PORT_KEY);
+    String httpPort = context.getCluster().getConfigurationValue(HIVE_SITE, HTTP_PORT_KEY);
+    String pathKey = context.getCluster().getConfigurationValue(HIVE_SITE, HTTP_PATH_KEY);
+    List<String> hiveHosts = context.getCluster().getHostsForServiceComponent(AMBARI_HIVE_SERVICE_NAME, AMBARI_HIVESERVER_COMPONENT_NAME);
+    String sessionParams = context.getProperties().get(HIVE_SESSION_PARAMS);
+
+    boolean isBinary = transportMode.equalsIgnoreCase("binary");
+    final String port = isBinary ? binaryPort : httpPort;
+
+    List<String> hostPorts = FluentIterable.from(hiveHosts).transform(new Function<String, String>() {
+      @Override
+      public String apply(String input) {
+        return input + ":" + port;
+      }
+    }).toList();
+
+    String concatHostPorts = Joiner.on(",").join(hostPorts);
+
+    StringBuilder builder = new StringBuilder();
+    builder.append("jdbc:hive2://")
+      .append(concatHostPorts)
+      .append(";")
+      .append(sessionParams);
+
+    if (!isBinary) {
+      builder.append(";").append("transportMode=http;httpPath=").append(pathKey);
+    }
+
+    return builder.toString();
+  }
+
+  private static String getFromClusterZookeeperConfig(ViewContext context) {
+    String quorum = context.getCluster().getConfigurationValue(HIVE_SITE, ZK_HIVE_QUORUM);
+    if (quorum == null) {
+      quorum = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, ZK_HIVE_QUORUM);
+    }
+
+    String namespace = context.getCluster().getConfigurationValue(HIVE_SITE, ZK_HIVE_NAMESPACE_KEY);
+    if (namespace == null) {
+      namespace = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, ZK_HIVE_NAMESPACE_KEY);
+    }
+    return String.format("jdbc:hive2://%s/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=%s", quorum, namespace);
+  }
+
+  private static boolean zookeeperConfigured(ViewContext context) {
+    boolean fromHiveSite = Boolean.valueOf(context.getCluster().getConfigurationValue(HIVE_SITE, ZK_HIVE_DYN_SERVICE_DISCOVERY_KEY));
+    boolean fromHiveInteractiveSite = Boolean.valueOf(context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, ZK_HIVE_DYN_SERVICE_DISCOVERY_KEY));
+    return fromHiveInteractiveSite || fromHiveSite;
+  }
+
+  private static String getConnectFromCustom(ViewContext context) {
+    String jdbcUrl = context.getProperties().get(HIVE_JDBC_URL_KEY);
+    String hiveSessionParams = context.getProperties().get(HIVE_SESSION_PARAMS);
+    return jdbcUrl + ";" + hiveSessionParams;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionSystem.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionSystem.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionSystem.java
new file mode 100644
index 0000000..f026ea6
--- /dev/null
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionSystem.java
@@ -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.
+ */
+
+package org.apache.ambari.view.hive2;
+
+import akka.actor.ActorRef;
+import akka.actor.ActorSystem;
+import akka.actor.Props;
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigFactory;
+import org.apache.ambari.view.ViewContext;
+import org.apache.ambari.view.hive2.actor.DeathWatch;
+import org.apache.ambari.view.hive2.actor.OperationController;
+import org.apache.ambari.view.hive2.internal.ConnectionSupplier;
+import org.apache.ambari.view.hive2.internal.DataStorageSupplier;
+import org.apache.ambari.view.hive2.internal.HdfsApiSupplier;
+
+import java.io.InputStream;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+public class ConnectionSystem {
+
+  private static final String ACTOR_CONF_FILE = "application.conf";
+  private static final String ACTOR_SYSTEM_NAME = "HiveViewActorSystem";
+  private ActorSystem actorSystem = null;
+  private static volatile ConnectionSystem instance = null;
+  private static final Object lock = new Object();
+  private static Map<String, ActorRef> operationControllerMap = new HashMap<>();
+
+  private ConnectionSystem() {
+    this.actorSystem = ActorSystem.create(ACTOR_SYSTEM_NAME);;
+  }
+
+  public static ConnectionSystem getInstance() {
+    if(instance == null) {
+      synchronized (lock) {
+        if(instance == null) {
+          instance = new ConnectionSystem();
+        }
+      }
+    }
+    return instance;
+  }
+
+  private ActorRef createOperationController() {
+    ActorRef deathWatch = actorSystem.actorOf(Props.create(DeathWatch.class));
+    return actorSystem.actorOf(
+      Props.create(OperationController.class, actorSystem,deathWatch,
+        new ConnectionSupplier(), new DataStorageSupplier(), new HdfsApiSupplier()));
+  }
+
+  public ActorSystem getActorSystem() {
+    return actorSystem;
+  }
+
+  /**
+   * Returns one operationController per View Instance
+   * @param context
+   * @return operationController Instance
+   */
+  public ActorRef getOperationController(ViewContext context) {
+    String instanceName = context.getInstanceName();
+    ActorRef ref = operationControllerMap.get(instanceName);
+    if(ref == null) {
+      synchronized (lock) {
+        ref = operationControllerMap.get(instanceName);
+        if(ref == null) {
+          ref = createOperationController();
+          operationControllerMap.put(instanceName, ref);
+        }
+      }
+    }
+    return ref;
+  }
+
+  public void shutdown() {
+    if(!actorSystem.isTerminated()) {
+      actorSystem.shutdown();
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HelpService.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HelpService.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HelpService.java
new file mode 100644
index 0000000..b0316ab
--- /dev/null
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HelpService.java
@@ -0,0 +1,118 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.view.hive2;
+
+import org.apache.ambari.view.ViewContext;
+import org.apache.ambari.view.ViewResourceHandler;
+import org.apache.ambari.view.hive2.resources.files.FileService;
+import org.apache.ambari.view.hive2.resources.jobs.atsJobs.ATSParserFactory;
+import org.apache.ambari.view.hive2.resources.jobs.atsJobs.ATSRequestsDelegateImpl;
+import org.json.simple.JSONObject;
+
+import javax.inject.Inject;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+/**
+ * Help service
+ */
+public class HelpService extends BaseService {
+  @Inject
+  ViewContext context;
+
+  @Inject
+  protected ViewResourceHandler handler;
+
+  /**
+   * Constructor
+   */
+  public HelpService() {
+    super();
+  }
+
+  /**
+   * Version
+   * @return version
+   */
+  @GET
+  @Path("/version")
+  @Produces(MediaType.TEXT_PLAIN)
+  public Response version(){
+    return Response.ok("0.0.1-SNAPSHOT").build();
+  }
+
+  // ================================================================================
+  // Smoke tests
+  // ================================================================================
+
+  /**
+   * HDFS Status
+   * @return status
+   */
+  @GET
+  @Path("/hdfsStatus")
+  @Produces(MediaType.APPLICATION_JSON)
+  public Response hdfsStatus(){
+    FileService.hdfsSmokeTest(context);
+    return getOKResponse();
+  }
+
+  /**
+   * ATS Status
+   * @return status
+   */
+  @GET
+  @Path("/atsStatus")
+  @Produces(MediaType.APPLICATION_JSON)
+  public Response atsStatus() {
+    try {
+      ATSRequestsDelegateImpl atsimpl = new ATSRequestsDelegateImpl(context, ATSParserFactory.getATSUrl(context));
+      atsimpl.checkATSStatus();
+      return getOKResponse();
+    }catch (Exception e){
+      throw new WebApplicationException(e);
+    }
+  }
+
+  private Response getOKResponse() {
+    JSONObject response = new JSONObject();
+    response.put("message", "OK");
+    response.put("trace", null);
+    response.put("status", "200");
+    return Response.ok().entity(response).type(MediaType.APPLICATION_JSON).build();
+  }
+
+  /**
+   * Version
+   * @return version
+   */
+  @GET
+  @Path("/test")
+  @Produces(MediaType.TEXT_PLAIN)
+  public Response testStorage(){
+    TestBean test = new TestBean();
+    test.someData = "hello world";
+    getSharedObjectsFactory().getStorage().store(TestBean.class, test);
+    return Response.ok("OK").build();
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HiveJdbcConnectionDelegate.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HiveJdbcConnectionDelegate.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HiveJdbcConnectionDelegate.java
new file mode 100644
index 0000000..e8d3333
--- /dev/null
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HiveJdbcConnectionDelegate.java
@@ -0,0 +1,144 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.view.hive2;
+
+import com.google.common.base.Optional;
+import org.apache.ambari.view.hive2.actor.message.DDLJob;
+import org.apache.ambari.view.hive2.actor.message.GetColumnMetadataJob;
+import org.apache.ambari.view.hive2.actor.message.HiveJob;
+import org.apache.ambari.view.hive2.actor.message.job.Result;
+import org.apache.ambari.view.hive2.internal.HiveResult;
+import org.apache.hive.jdbc.HiveConnection;
+import org.apache.hive.jdbc.HiveStatement;
+
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+public class HiveJdbcConnectionDelegate implements ConnectionDelegate {
+
+  private ResultSet currentResultSet;
+  private HiveStatement currentStatement;
+  private String atsGuid;
+
+  @Override
+  public Optional<ResultSet> execute(HiveConnection connection, DDLJob job) throws SQLException {
+
+    try {
+      Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
+      currentStatement = (HiveStatement) statement;
+
+      for (String syncStatement : job.getSyncStatements()) {
+        // we don't care about the result
+        // fail all if one fails
+        statement.execute(syncStatement);
+      }
+
+      HiveStatement hiveStatement = (HiveStatement) statement;
+      boolean result = hiveStatement.executeAsync(job.getAsyncStatement());
+      atsGuid = hiveStatement.getYarnATSGuid();
+      if (result) {
+        // query has a result set
+        ResultSet resultSet = hiveStatement.getResultSet();
+        currentResultSet = resultSet;
+        Optional<ResultSet> resultSetOptional = Optional.of(resultSet);
+        return resultSetOptional;
+
+      }
+      return Optional.absent();
+
+    } catch (SQLException e) {
+      // Close the statement on any error
+      currentStatement.close();
+      throw e;
+    }
+  }
+
+  @Override
+  public Optional<ResultSet> executeSync(HiveConnection connection, DDLJob job) throws SQLException {
+    try {
+      Statement statement = connection.createStatement();
+      currentStatement = (HiveStatement) statement;
+
+      boolean hasResultSet = false;
+      for (String syncStatement : job.getStatements()) {
+        // we don't care about the result
+        // fail all if one fails
+        hasResultSet = statement.execute(syncStatement);
+      }
+
+      if (hasResultSet) {
+        ResultSet resultSet = statement.getResultSet();
+        //HiveResult result = new HiveResult(resultSet);
+        return Optional.of(resultSet);
+      } else {
+        return Optional.absent();
+      }
+    } catch (SQLException e) {
+      // Close the statement on any error
+      currentStatement.close();
+      throw e;
+    }
+  }
+
+
+  @Override
+  public Optional<ResultSet> getColumnMetadata(HiveConnection connection, GetColumnMetadataJob job) throws SQLException {
+    DatabaseMetaData metaData = connection.getMetaData();
+    ResultSet resultSet = metaData.getColumns("", job.getSchemaPattern(), job.getTablePattern(), job.getColumnPattern());
+    currentResultSet = resultSet;
+    return Optional.of(resultSet);
+  }
+
+  @Override
+  public Optional<ResultSet> getCurrentResultSet() {
+    return Optional.fromNullable(currentResultSet);
+  }
+
+  @Override
+  public Optional<HiveStatement> getCurrentStatement() {
+    return Optional.fromNullable(currentStatement);
+  }
+
+  @Override
+  public void closeResultSet() {
+
+    try {
+      if (currentResultSet != null) {
+        currentResultSet.close();
+      }
+    } catch (SQLException e) {
+      // Cannot do anything here
+    }
+  }
+
+  @Override
+  public void closeStatement()  {
+    try {
+      if (currentStatement != null) {
+        currentStatement.close();
+      }
+    } catch (SQLException e) {
+      // cannot do anything here
+    }
+  }
+
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HiveViewImpl.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HiveViewImpl.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HiveViewImpl.java
new file mode 100644
index 0000000..695c0ab
--- /dev/null
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HiveViewImpl.java
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.view.hive2;
+
+import org.apache.ambari.view.View;
+import org.apache.ambari.view.ViewDefinition;
+import org.apache.ambari.view.ViewInstanceDefinition;
+import org.apache.ambari.view.hive2.utils.SharedObjectsFactory;
+import org.apache.ambari.view.utils.UserLocal;
+
+
+public class HiveViewImpl implements View {
+  @Override
+  public void onDeploy(ViewDefinition definition) {
+
+  }
+
+  @Override
+  public void onCreate(ViewInstanceDefinition definition) {
+
+  }
+
+  @Override
+  public void onDestroy(ViewInstanceDefinition definition) {
+    SharedObjectsFactory.dropInstanceCache(definition.getInstanceName());
+  }
+
+  @Override
+  public void onUpdate(ViewInstanceDefinition definition) {
+    //drop all cached connection for instance
+    UserLocal.dropInstanceCache(definition.getInstanceName());
+    SharedObjectsFactory.dropInstanceCache(definition.getInstanceName());
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/PropertyValidator.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/PropertyValidator.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/PropertyValidator.java
new file mode 100644
index 0000000..e406366
--- /dev/null
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/PropertyValidator.java
@@ -0,0 +1,98 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.view.hive2;
+
+import org.apache.ambari.view.ViewInstanceDefinition;
+import org.apache.ambari.view.utils.ambari.ValidatorUtils;
+import org.apache.ambari.view.validation.ValidationResult;
+import org.apache.ambari.view.validation.Validator;
+
+public class PropertyValidator implements Validator {
+
+  public static final String WEBHDFS_URL = "webhdfs.url";
+  public static final String HIVE_PORT = "hive.port";
+  public static final String YARN_ATS_URL = "yarn.ats.url";
+  public static final String HIVE_SESSION_PARAMS = "hive.session.params";
+
+  @Override
+  public ValidationResult validateInstance(ViewInstanceDefinition viewInstanceDefinition, ValidationContext validationContext) {
+    return null;
+  }
+
+  @Override
+  public ValidationResult validateProperty(String property, ViewInstanceDefinition viewInstanceDefinition, ValidationContext validationContext) {
+    // Validate non cluster associated properties
+    if (property.equals(HIVE_SESSION_PARAMS)) {
+      String auth = viewInstanceDefinition.getPropertyMap().get(HIVE_SESSION_PARAMS);
+
+      if (auth != null && !auth.isEmpty()) {
+        for(String param : auth.split(";")) {
+          String[] keyvalue = param.split("=");
+          if (keyvalue.length != 2) {
+            return new InvalidPropertyValidationResult(false, "Can not parse session param " + param + " in " + auth);
+          }
+        }
+      }
+    }
+
+    // if associated with cluster, no need to validate associated properties
+    Long cluster = viewInstanceDefinition.getClusterHandle();
+    if (cluster != null) {
+      return ValidationResult.SUCCESS;
+    }
+
+    // Cluster associated properties
+    if (property.equals(WEBHDFS_URL)) {
+      String webhdfsUrl = viewInstanceDefinition.getPropertyMap().get(WEBHDFS_URL);
+      if (!ValidatorUtils.validateHdfsURL(webhdfsUrl)) {
+        return new InvalidPropertyValidationResult(false, "Must be valid URL");
+      }
+    }
+
+    if (property.equals(YARN_ATS_URL)) {
+      String atsUrl = viewInstanceDefinition.getPropertyMap().get(YARN_ATS_URL);
+      if (!ValidatorUtils.validateHttpURL(atsUrl)) {
+        return new InvalidPropertyValidationResult(false, "Must be valid URL");
+      }
+    }
+
+    return ValidationResult.SUCCESS;
+  }
+
+  public static class InvalidPropertyValidationResult implements ValidationResult {
+    private boolean valid;
+    private String detail;
+
+    public InvalidPropertyValidationResult(boolean valid, String detail) {
+      this.valid = valid;
+      this.detail = detail;
+    }
+
+    @Override
+    public boolean isValid() {
+      return valid;
+    }
+
+    @Override
+    public String getDetail() {
+      return detail;
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/TestBean.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/TestBean.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/TestBean.java
new file mode 100644
index 0000000..4b49f64
--- /dev/null
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/TestBean.java
@@ -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.
+ */
+
+package org.apache.ambari.view.hive2;
+
+import org.apache.ambari.view.hive2.persistence.utils.Indexed;
+
+public class TestBean implements Indexed {
+  public String someData;
+  public String id;
+
+  @Override
+  public String getId() {
+    return id;
+  }
+
+  @Override
+  public void setId(String id) {
+    this.id = id;
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/AsyncJdbcConnector.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/AsyncJdbcConnector.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/AsyncJdbcConnector.java
new file mode 100644
index 0000000..2133cd6
--- /dev/null
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/AsyncJdbcConnector.java
@@ -0,0 +1,192 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.view.hive2.actor;
+
+import akka.actor.ActorRef;
+import akka.actor.ActorSystem;
+import akka.actor.PoisonPill;
+import akka.actor.Props;
+import com.google.common.base.Optional;
+import org.apache.ambari.view.ViewContext;
+import org.apache.ambari.view.hive2.actor.message.RegisterActor;
+import org.apache.ambari.view.hive2.persistence.Storage;
+import org.apache.ambari.view.hive2.persistence.utils.ItemNotFound;
+import org.apache.ambari.view.hive2.resources.jobs.viewJobs.Job;
+import org.apache.ambari.view.hive2.resources.jobs.viewJobs.JobImpl;
+import org.apache.ambari.view.hive2.ConnectionDelegate;
+import org.apache.ambari.view.hive2.actor.message.AsyncJob;
+import org.apache.ambari.view.hive2.actor.message.HiveMessage;
+import org.apache.ambari.view.hive2.actor.message.ResultReady;
+import org.apache.ambari.view.hive2.actor.message.job.AsyncExecutionFailed;
+import org.apache.ambari.view.hive2.actor.message.lifecycle.InactivityCheck;
+import org.apache.ambari.view.hive2.actor.message.StartLogAggregation;
+import org.apache.ambari.view.hive2.internal.Either;
+import org.apache.ambari.view.utils.hdfs.HdfsApi;
+import org.apache.hive.jdbc.HiveConnection;
+import org.apache.hive.jdbc.HiveStatement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import scala.concurrent.duration.Duration;
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.UUID;
+import java.util.concurrent.TimeUnit;
+
+public class AsyncJdbcConnector extends JdbcConnector {
+
+  private final Logger LOG = LoggerFactory.getLogger(getClass());
+
+  private ActorRef logAggregator = null;
+  private ActorRef asyncQueryExecutor = null;
+  private ActorRef resultSetActor = null;
+
+
+  public AsyncJdbcConnector(ViewContext viewContext, HdfsApi hdfsApi, ActorSystem system, ActorRef parent,ActorRef deathWatch, ConnectionDelegate connectionDelegate, Storage storage) {
+    super(viewContext, hdfsApi, system, parent,deathWatch, connectionDelegate, storage);
+  }
+
+  @Override
+  protected void handleJobMessage(HiveMessage message) {
+    Object job = message.getMessage();
+    if (job instanceof AsyncJob) {
+      LOG.debug("Executing async job " + message.toString());
+      execute((AsyncJob) job);
+    }
+  }
+
+  @Override
+  protected boolean isAsync() {
+    return true;
+  }
+
+  @Override
+  protected void cleanUpChildren() {
+    if(logAggregator != null && !logAggregator.isTerminated()) {
+      LOG.debug("Sending poison pill to log aggregator");
+      logAggregator.tell(PoisonPill.getInstance(), self());
+    }
+
+    if(asyncQueryExecutor != null && !asyncQueryExecutor.isTerminated()) {
+      LOG.debug("Sending poison pill to Async Query Executor");
+      asyncQueryExecutor.tell(PoisonPill.getInstance(), self());
+    }
+
+    if(resultSetActor != null && !resultSetActor.isTerminated()) {
+      LOG.debug("Sending poison pill to Resultset Actor");
+      resultSetActor.tell(PoisonPill.getInstance(), self());
+    }
+  }
+
+  @Override
+  protected void notifyFailure() {
+    AsyncExecutionFailed failure = new AsyncExecutionFailed(jobId,username,"Cannot connect to hive");
+    parent.tell(failure, self());
+  }
+
+  private void execute(AsyncJob message) {
+    this.executing = true;
+    this.jobId = message.getJobId();
+    updateJobStatus(jobId,Job.JOB_STATE_INITIALIZED);
+    if (connectable == null) {
+      notifyAndCleanUp();
+      return;
+    }
+
+    Optional<HiveConnection> connectionOptional = connectable.getConnection();
+    if (!connectionOptional.isPresent()) {
+      notifyAndCleanUp();
+      return;
+    }
+
+    try {
+      Optional<ResultSet> resultSetOptional = connectionDelegate.execute(connectionOptional.get(), message);
+      Optional<HiveStatement> currentStatement = connectionDelegate.getCurrentStatement();
+      // There should be a result set, which either has a result set, or an empty value
+      // for operations which do not return anything
+
+      logAggregator = getContext().actorOf(
+        Props.create(LogAggregator.class, system, hdfsApi, currentStatement.get(), message.getLogFile())
+        .withDispatcher("akka.actor.misc-dispatcher"), message.getUsername() + ":" + message.getJobId() + "-logAggregator"
+      );
+      deathWatch.tell(new RegisterActor(logAggregator),self());
+
+      updateGuidInJob(jobId, currentStatement.get());
+      updateJobStatus(jobId,Job.JOB_STATE_RUNNING);
+
+      if (resultSetOptional.isPresent()) {
+        // Start a result set aggregator on the same context, a notice to the parent will kill all these as well
+        // tell the result holder to assign the result set for further operations
+        resultSetActor = getContext().actorOf(Props.create(ResultSetIterator.class, self(),
+          resultSetOptional.get(),storage).withDispatcher("akka.actor.result-dispatcher"),
+          "ResultSetActor:ResultSetIterator:JobId:"+ jobId+":" + UUID.randomUUID().toString());
+        deathWatch.tell(new RegisterActor(resultSetActor),self());
+        parent.tell(new ResultReady(jobId,username, Either.<ActorRef, ActorRef>left(resultSetActor)), self());
+
+        // Start a actor to query ATS
+      } else {
+        // Case when this is an Update/query with no results
+        // Wait for operation to complete and add results;
+
+        ActorRef asyncQueryExecutor = getContext().actorOf(
+                Props.create(AsyncQueryExecutor.class, parent, currentStatement.get(),storage,jobId,username)
+                  .withDispatcher("akka.actor.result-dispatcher"),
+                message.getUsername() + ":" + message.getJobId() + "-asyncQueryExecutor");
+        deathWatch.tell(new RegisterActor(asyncQueryExecutor),self());
+        parent.tell(new ResultReady(jobId,username, Either.<ActorRef, ActorRef>right(asyncQueryExecutor)), self());
+
+      }
+      // Start a actor to query log
+      logAggregator.tell(new StartLogAggregation(), self());
+
+
+    } catch (SQLException e) {
+      // update the error on the log
+      AsyncExecutionFailed failure = new AsyncExecutionFailed(message.getJobId(),username,
+              e.getMessage(), e);
+      updateJobStatus(jobId,Job.JOB_STATE_ERROR);
+      parent.tell(failure, self());
+      // Update the operation controller to write an error on tshe right side
+      LOG.error("Caught SQL excpetion for job-"+message,e);
+
+    }
+
+    // Start Inactivity timer to close the statement
+    this.inactivityScheduler = system.scheduler().schedule(
+      Duration.Zero(), Duration.create(15 * 1000, TimeUnit.MILLISECONDS),
+      this.self(), new InactivityCheck(), system.dispatcher(), null);
+  }
+
+  private void notifyAndCleanUp() {
+    updateJobStatus(jobId, Job.JOB_STATE_ERROR);
+    notifyFailure();
+    cleanUp();
+  }
+
+  private void updateJobStatus(String jobId, String jobState) {
+    JobImpl job = null;
+    try {
+      job = storage.load(JobImpl.class, jobId);
+    } catch (ItemNotFound itemNotFound) {
+      itemNotFound.printStackTrace();
+    }
+    job.setStatus(jobState);
+    storage.store(JobImpl.class, job);
+  }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/AsyncQueryExecutor.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/AsyncQueryExecutor.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/AsyncQueryExecutor.java
new file mode 100644
index 0000000..2a1dbb3
--- /dev/null
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/AsyncQueryExecutor.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.view.hive2.actor;
+
+import akka.actor.ActorRef;
+import org.apache.ambari.view.hive2.actor.message.ExecuteQuery;
+import org.apache.ambari.view.hive2.actor.message.HiveMessage;
+import org.apache.ambari.view.hive2.actor.message.job.AsyncExecutionFailed;
+import org.apache.ambari.view.hive2.actor.message.job.ExecutionFailed;
+import org.apache.ambari.view.hive2.actor.message.lifecycle.CleanUp;
+import org.apache.ambari.view.hive2.internal.AsyncExecutionSuccess;
+import org.apache.ambari.view.hive2.persistence.Storage;
+import org.apache.ambari.view.hive2.persistence.utils.ItemNotFound;
+import org.apache.ambari.view.hive2.resources.jobs.viewJobs.Job;
+import org.apache.ambari.view.hive2.resources.jobs.viewJobs.JobImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.sql.SQLException;
+import java.sql.Statement;
+
+public class AsyncQueryExecutor extends HiveActor {
+  private final Logger LOG = LoggerFactory.getLogger(getClass());
+
+  private Statement statement;
+  private final Storage storage;
+  private final String jobId;
+  private final ActorRef parent;
+  private final String userName;
+
+  public AsyncQueryExecutor(ActorRef parent, Statement statement, Storage storage, String jobId,String userName) {
+    this.statement = statement;
+    this.storage = storage;
+    this.jobId = jobId;
+    this.parent = parent;
+    this.userName = userName;
+  }
+
+  @Override
+  public void handleMessage(HiveMessage hiveMessage) {
+    Object message = hiveMessage.getMessage();
+
+    if (message instanceof ExecuteQuery) {
+      executeQuery();
+    }
+
+  }
+
+  private void executeQuery() {
+    JobImpl job = null;
+    try {
+      job = storage.load(JobImpl.class, jobId);
+      statement.getUpdateCount();
+      LOG.info("Job execution successful. Setting status in db.");
+      job.setStatus(Job.JOB_STATE_FINISHED);
+      storage.store(JobImpl.class, job);
+      sender().tell(new AsyncExecutionSuccess(), self());
+
+    } catch (SQLException e) {
+      job.setStatus(Job.JOB_STATE_ERROR);
+      sender().tell(new AsyncExecutionFailed(jobId,userName, e.getMessage(), e), self());
+      storage.store(JobImpl.class, job);
+    } catch (ItemNotFound itemNotFound) {
+      sender().tell(new AsyncExecutionFailed(jobId,userName, "Cannot load job", itemNotFound), self());
+    } finally {
+      // We can clean up this connection here
+      parent.tell(new CleanUp(), self());
+    }
+
+  }
+
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/DeathWatch.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/DeathWatch.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/DeathWatch.java
new file mode 100644
index 0000000..ffca691
--- /dev/null
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/DeathWatch.java
@@ -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.
+ */
+
+package org.apache.ambari.view.hive2.actor;
+
+import akka.actor.ActorRef;
+import akka.actor.Terminated;
+import org.apache.ambari.view.hive2.actor.message.HiveMessage;
+import org.apache.ambari.view.hive2.actor.message.RegisterActor;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Date;
+
+public class DeathWatch extends HiveActor {
+
+    private final static Logger LOG =
+            LoggerFactory.getLogger(DeathWatch.class);
+
+    @Override
+    void handleMessage(HiveMessage hiveMessage) {
+        Object message = hiveMessage.getMessage();
+        if(message instanceof RegisterActor){
+            RegisterActor registerActor = (RegisterActor) message;
+            ActorRef actorRef = registerActor.getActorRef();
+            this.getContext().watch(actorRef);
+            LOG.info("Registered new actor "+ actorRef);
+            LOG.info("Registration for {} at {}", actorRef,new Date());
+        }
+        if(message instanceof Terminated){
+            Terminated terminated = (Terminated) message;
+            ActorRef actor = terminated.actor();
+            LOG.info("Received deathwatch for actor "+ actor);
+            LOG.info("Termination for {} at {}", actor,new Date());
+
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/ambari/blob/9dc382a5/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/GetResultHolder.java
----------------------------------------------------------------------
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/GetResultHolder.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/GetResultHolder.java
new file mode 100644
index 0000000..c2ee5c7
--- /dev/null
+++ b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/GetResultHolder.java
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ambari.view.hive2.actor;
+
+public class GetResultHolder {
+
+    private String jobId;
+    private String userName;
+
+    public GetResultHolder(String jobId, String userName) {
+        this.jobId = jobId;
+        this.userName = userName;
+    }
+
+
+    public String getJobId() {
+        return jobId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    @Override
+    public String toString() {
+        return "GetResultHolder{" +
+                "jobId='" + jobId + '\'' +
+                ", userName='" + userName + '\'' +
+                '}';
+    }
+}


Mime
View raw message