You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by mg...@apache.org on 2018/05/14 10:51:48 UTC
[ambari] branch trunk updated: AMBARI-23821 Remove hive and tez
views from hive and tez page (mgergely)
This is an automated email from the ASF dual-hosted git repository.
mgergely pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push:
new b623f07 AMBARI-23821 Remove hive and tez views from hive and tez page (mgergely)
b623f07 is described below
commit b623f07013199c03481cf758d3a1c10899f89946
Author: Miklos Gergely <mg...@hortonworks.com>
AuthorDate: Fri May 11 11:17:47 2018 +0200
AMBARI-23821 Remove hive and tez views from hive and tez page (mgergely)
---
.../org/apache/ambari/view/hive2/AuthParams.java | 102 -
.../org/apache/ambari/view/hive2/BaseService.java | 54 -
.../ambari/view/hive2/ConnectionDelegate.java | 37 -
.../ambari/view/hive2/ConnectionFactory.java | 167 -
.../apache/ambari/view/hive2/ConnectionSystem.java | 135 -
.../org/apache/ambari/view/hive2/DataMigrator.java | 101 -
.../org/apache/ambari/view/hive2/HelpService.java | 150 -
.../view/hive2/HiveJdbcConnectionDelegate.java | 106 -
.../org/apache/ambari/view/hive2/HiveViewImpl.java | 52 -
.../ambari/view/hive2/PropertyValidator.java | 107 -
.../org/apache/ambari/view/hive2/TestBean.java | 36 -
.../apache/ambari/view/hive2/actor/DeathWatch.java | 55 -
.../apache/ambari/view/hive2/actor/HiveActor.java | 46 -
.../ambari/view/hive2/actor/JdbcConnector.java | 645 ---
.../ambari/view/hive2/actor/LogAggregator.java | 125 -
.../view/hive2/actor/OperationController.java | 408 --
.../ambari/view/hive2/actor/ResultSetIterator.java | 167 -
.../ambari/view/hive2/actor/StatementExecutor.java | 153 -
.../view/hive2/actor/YarnAtsGUIDFetcher.java | 71 -
.../ambari/view/hive2/actor/message/Connect.java | 77 -
.../view/hive2/actor/message/CursorReset.java | 22 -
.../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 -
.../hive2/actor/message/GetColumnMetadataJob.java | 59 -
.../view/hive2/actor/message/GetMoreLogs.java | 22 -
.../ambari/view/hive2/actor/message/HiveJob.java | 48 -
.../view/hive2/actor/message/HiveMessage.java | 53 -
.../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 -
.../hive2/actor/message/ResultInformation.java | 83 -
.../view/hive2/actor/message/ResultNotReady.java | 40 -
.../view/hive2/actor/message/ResultReady.java | 44 -
.../view/hive2/actor/message/RunStatement.java | 73 -
.../view/hive2/actor/message/SQLStatementJob.java | 65 -
.../hive2/actor/message/StartLogAggregation.java | 42 -
.../actor/message/job/AsyncExecutionFailed.java | 46 -
.../view/hive2/actor/message/job/CancelJob.java | 40 -
.../actor/message/job/ExecuteNextStatement.java | 22 -
.../hive2/actor/message/job/ExecutionFailed.java | 31 -
.../view/hive2/actor/message/job/Failure.java | 37 -
.../view/hive2/actor/message/job/FetchFailed.java | 31 -
.../ambari/view/hive2/actor/message/job/Next.java | 22 -
.../view/hive2/actor/message/job/NoMoreItems.java | 35 -
.../view/hive2/actor/message/job/NoResult.java | 21 -
.../view/hive2/actor/message/job/Result.java | 43 -
.../hive2/actor/message/job/ResultSetHolder.java | 33 -
.../actor/message/job/SaveDagInformation.java | 52 -
.../view/hive2/actor/message/job/SaveGuidToDB.java | 46 -
.../hive2/actor/message/job/UpdateYarnAtsGuid.java | 44 -
.../hive2/actor/message/lifecycle/CleanUp.java | 21 -
.../actor/message/lifecycle/DestroyConnector.java | 52 -
.../actor/message/lifecycle/FreeConnector.java | 53 -
.../actor/message/lifecycle/InactivityCheck.java | 21 -
.../hive2/actor/message/lifecycle/KeepAlive.java | 21 -
.../lifecycle/TerminateInactivityCheck.java | 21 -
.../backgroundjobs/BackgroundJobController.java | 113 -
.../backgroundjobs/BackgroundJobException.java | 30 -
.../ambari/view/hive2/client/AsyncJobRunner.java | 38 -
.../view/hive2/client/AsyncJobRunnerImpl.java | 143 -
.../view/hive2/client/ColumnDescription.java | 45 -
.../hive2/client/ColumnDescriptionExtended.java | 74 -
.../view/hive2/client/ColumnDescriptionShort.java | 53 -
.../ambari/view/hive2/client/ConnectionConfig.java | 59 -
.../apache/ambari/view/hive2/client/Cursor.java | 30 -
.../ambari/view/hive2/client/DDLDelegator.java | 38 -
.../ambari/view/hive2/client/DDLDelegatorImpl.java | 255 -
.../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 -
.../hive2/client/HiveClientRuntimeException.java | 25 -
.../view/hive2/client/NonPersistentCursor.java | 156 -
.../ambari/view/hive2/client/PersistentCursor.java | 87 -
.../org/apache/ambari/view/hive2/client/Row.java | 74 -
.../hive2/exceptions/NotConnectedException.java | 28 -
.../view/hive2/internal/AsyncExecutionFailure.java | 23 -
.../view/hive2/internal/AsyncExecutionSuccess.java | 25 -
.../ambari/view/hive2/internal/Connectable.java | 65 -
.../view/hive2/internal/ConnectionException.java | 25 -
.../view/hive2/internal/ConnectionProperties.java | 94 -
.../view/hive2/internal/ConnectionSupplier.java | 37 -
.../view/hive2/internal/ContextSupplier.java | 37 -
.../view/hive2/internal/DataStorageSupplier.java | 42 -
.../view/hive2/internal/DefaultSupplier.java | 62 -
.../apache/ambari/view/hive2/internal/Either.java | 79 -
.../view/hive2/internal/HdfsApiSupplier.java | 71 -
.../view/hive2/internal/HiveConnectionWrapper.java | 152 -
.../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 -
.../view/hive2/internal/SafeViewContext.java | 181 -
.../view/hive2/persistence/DataStoreStorage.java | 140 -
.../view/hive2/persistence/IStorageFactory.java | 23 -
.../hive2/persistence/InstanceKeyValueStorage.java | 132 -
.../view/hive2/persistence/KeyValueStorage.java | 163 -
.../hive2/persistence/LocalKeyValueStorage.java | 69 -
.../hive2/persistence/PersistentConfiguration.java | 52 -
.../ambari/view/hive2/persistence/Storage.java | 77 -
.../utils/ContextConfigurationAdapter.java | 260 -
.../hive2/persistence/utils/FilteringStrategy.java | 32 -
.../view/hive2/persistence/utils/Indexed.java | 36 -
.../view/hive2/persistence/utils/ItemNotFound.java | 43 -
.../utils/OnlyOwnersFilteringStrategy.java | 38 -
.../ambari/view/hive2/persistence/utils/Owned.java | 36 -
.../hive2/persistence/utils/PersonalResource.java | 22 -
.../hive2/persistence/utils/StorageFactory.java | 69 -
.../view/hive2/resources/CRUDResourceManager.java | 131 -
.../view/hive2/resources/IResourceManager.java | 37 -
.../resources/PersonalCRUDResourceManager.java | 99 -
.../hive2/resources/SharedCRUDResourceManager.java | 44 -
.../hive2/resources/browser/ConnectionService.java | 155 -
.../resources/browser/HiveBrowserService.java | 263 -
.../view/hive2/resources/files/FileResource.java | 70 -
.../view/hive2/resources/files/FileService.java | 283 -
.../view/hive2/resources/jobs/Aggregator.java | 391 --
.../hive2/resources/jobs/JobResourceProvider.java | 117 -
.../view/hive2/resources/jobs/JobService.java | 624 --
.../resources/jobs/ModifyNotificationDelegate.java | 23 -
.../jobs/ModifyNotificationInvocationHandler.java | 40 -
.../jobs/NoOperationStatusSetException.java | 23 -
.../hive2/resources/jobs/ProgressRetriever.java | 66 -
.../jobs/ResultsPaginationController.java | 287 -
.../hive2/resources/jobs/atsJobs/ATSParser.java | 248 -
.../resources/jobs/atsJobs/ATSParserFactory.java | 43 -
.../jobs/atsJobs/ATSRequestsDelegate.java | 47 -
.../jobs/atsJobs/ATSRequestsDelegateImpl.java | 175 -
.../hive2/resources/jobs/atsJobs/HiveQueryId.java | 42 -
.../hive2/resources/jobs/atsJobs/IATSParser.java | 39 -
.../hive2/resources/jobs/atsJobs/TezDagId.java | 26 -
.../hive2/resources/jobs/atsJobs/TezVertexId.java | 24 -
.../view/hive2/resources/jobs/rm/RMParser.java | 129 -
.../hive2/resources/jobs/rm/RMParserFactory.java | 48 -
.../resources/jobs/rm/RMRequestsDelegate.java | 31 -
.../resources/jobs/rm/RMRequestsDelegateImpl.java | 99 -
.../jobs/viewJobs/IJobControllerFactory.java | 23 -
.../view/hive2/resources/jobs/viewJobs/Job.java | 131 -
.../resources/jobs/viewJobs/JobController.java | 44 -
.../jobs/viewJobs/JobControllerFactory.java | 40 -
.../resources/jobs/viewJobs/JobControllerImpl.java | 327 --
.../hive2/resources/jobs/viewJobs/JobImpl.java | 335 --
.../hive2/resources/jobs/viewJobs/JobInfo.java | 78 -
.../jobs/viewJobs/JobResourceManager.java | 93 -
.../resources/resources/FileResourceItem.java | 78 -
.../resources/FileResourceResourceManager.java | 65 -
.../resources/FileResourceResourceProvider.java | 110 -
.../resources/resources/FileResourceService.java | 180 -
.../hive2/resources/savedQueries/SavedQuery.java | 96 -
.../savedQueries/SavedQueryResourceManager.java | 162 -
.../savedQueries/SavedQueryResourceProvider.java | 113 -
.../resources/savedQueries/SavedQueryService.java | 267 -
.../ambari/view/hive2/resources/udfs/UDF.java | 87 -
.../hive2/resources/udfs/UDFResourceManager.java | 65 -
.../hive2/resources/udfs/UDFResourceProvider.java | 111 -
.../view/hive2/resources/udfs/UDFService.java | 193 -
.../view/hive2/resources/uploads/CSVParams.java | 74 -
.../resources/uploads/ColumnDescriptionImpl.java | 119 -
.../view/hive2/resources/uploads/HiveFileType.java | 30 -
.../hive2/resources/uploads/TableDataReader.java | 111 -
.../view/hive2/resources/uploads/TableInput.java | 51 -
.../resources/uploads/UploadFromHdfsInput.java | 130 -
.../hive2/resources/uploads/UploadService.java | 582 --
.../resources/uploads/parsers/DataParser.java | 66 -
.../uploads/parsers/EndOfDocumentException.java | 41 -
.../hive2/resources/uploads/parsers/IParser.java | 34 -
.../resources/uploads/parsers/ParseOptions.java | 61 -
.../hive2/resources/uploads/parsers/Parser.java | 162 -
.../resources/uploads/parsers/PreviewData.java | 56 -
.../resources/uploads/parsers/RowIterator.java | 98 -
.../resources/uploads/parsers/RowMapIterator.java | 29 -
.../parsers/csv/commonscsv/CSVIterator.java | 57 -
.../uploads/parsers/csv/commonscsv/CSVParser.java | 88 -
.../parsers/csv/opencsv/OpenCSVIterator.java | 56 -
.../uploads/parsers/csv/opencsv/OpenCSVParser.java | 92 -
.../uploads/parsers/json/JSONIterator.java | 160 -
.../resources/uploads/parsers/json/JSONParser.java | 85 -
.../resources/uploads/parsers/xml/XMLIterator.java | 195 -
.../resources/uploads/parsers/xml/XMLParser.java | 102 -
.../resources/uploads/query/DeleteQueryInput.java | 48 -
.../uploads/query/InsertFromQueryInput.java | 92 -
.../resources/uploads/query/LoadQueryInput.java | 67 -
.../resources/uploads/query/QueryGenerator.java | 142 -
.../hive2/resources/uploads/query/RowFormat.java | 57 -
.../hive2/resources/uploads/query/TableInfo.java | 97 -
.../hive2/utils/BadRequestFormattedException.java | 27 -
.../apache/ambari/view/hive2/utils/Constants.java | 25 -
.../ambari/view/hive2/utils/FilePaginator.java | 127 -
.../view/hive2/utils/HiveActorConfiguration.java | 71 -
.../hive2/utils/HiveClientFormattedException.java | 26 -
.../view/hive2/utils/LoggingOutputStream.java | 85 -
.../utils/MisconfigurationFormattedException.java | 47 -
.../hive2/utils/NotFoundFormattedException.java | 27 -
.../hive2/utils/ResultFetchFormattedException.java | 27 -
.../utils/ResultNotReadyFormattedException.java | 27 -
.../ambari/view/hive2/utils/ServiceCheck.java | 132 -
.../hive2/utils/ServiceFormattedException.java | 105 -
.../view/hive2/utils/SharedObjectsFactory.java | 197 -
.../hive-next/src/main/resources/application.conf | 57 -
.../src/main/resources/ui/hive-web/.bowerrc | 4 -
.../src/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 | 55 -
.../src/main/resources/ui/hive-web/README.md | 14 -
.../ui/hive-web/app/adapters/application.js | 72 -
.../resources/ui/hive-web/app/adapters/database.js | 25 -
.../ui/hive-web/app/adapters/file-upload.js | 30 -
.../resources/ui/hive-web/app/adapters/file.js | 26 -
.../ui/hive-web/app/adapters/service-check.js | 47 -
.../ui/hive-web/app/adapters/upload-table.js | 89 -
.../src/main/resources/ui/hive-web/app/app.js | 34 -
.../resources/ui/hive-web/app/components/.gitkeep | 0
.../app/components/alert-message-widget.js | 35 -
.../hive-web/app/components/collapsible-widget.js | 38 -
.../app/components/column-filter-widget.js | 56 -
.../hive-web/app/components/date-range-widget.js | 98 -
.../ui/hive-web/app/components/expander-widget.js | 36 -
.../ui/hive-web/app/components/extended-input.js | 50 -
.../ui/hive-web/app/components/file-upload.js | 34 -
.../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 -
.../hive-web/app/components/number-range-widget.js | 79 -
.../ui/hive-web/app/components/panel-widget.js | 30 -
.../ui/hive-web/app/components/popover-widget.js | 34 -
.../ui/hive-web/app/components/progress-widget.js | 30 -
.../ui/hive-web/app/components/query-editor.js | 129 -
.../ui/hive-web/app/components/query-settings.js | 55 -
.../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 -
.../ui/hive-web/app/components/typeahead-widget.js | 129 -
.../ui/hive-web/app/components/udf-tr-view.js | 81 -
.../ui/hive-web/app/components/upload-query.js | 31 -
.../app/components/validated-text-field.js | 62 -
.../app/components/visualization-tabs-widget.js | 56 -
.../resources/ui/hive-web/app/controllers/.gitkeep | 0
.../ui/hive-web/app/controllers/application.js | 33 -
.../ui/hive-web/app/controllers/databases.js | 476 --
.../ui/hive-web/app/controllers/history.js | 257 -
.../resources/ui/hive-web/app/controllers/index.js | 790 ---
.../app/controllers/index/history-query/explain.js | 164 -
.../app/controllers/index/history-query/logs.js | 127 -
.../app/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 -
.../hive-web/app/controllers/modal-save-query.js | 42 -
.../ui/hive-web/app/controllers/modal-save.js | 34 -
.../ui/hive-web/app/controllers/open-queries.js | 412 --
.../ui/hive-web/app/controllers/queries.js | 145 -
.../ui/hive-web/app/controllers/query-tabs.js | 189 -
.../ui/hive-web/app/controllers/splash.js | 193 -
.../ui/hive-web/app/controllers/tez-ui.js | 106 -
.../resources/ui/hive-web/app/controllers/udfs.js | 143 -
.../ui/hive-web/app/controllers/upload-table.js | 964 ----
.../ui/hive-web/app/controllers/visual-explain.js | 64 -
.../hive-web/app/controllers/visualization-ui.js | 136 -
.../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 -
.../ui/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 -
.../ui/hive-web/app/helpers/preformatted-string.js | 28 -
.../resources/ui/hive-web/app/helpers/tb-helper.js | 33 -
.../src/main/resources/ui/hive-web/app/index.html | 42 -
.../resources/ui/hive-web/app/initializers/i18n.js | 351 --
.../resources/ui/hive-web/app/mixins/filterable.js | 106 -
.../resources/ui/hive-web/app/mixins/sortable.js | 31 -
.../main/resources/ui/hive-web/app/models/.gitkeep | 0
.../resources/ui/hive-web/app/models/database.js | 25 -
.../ui/hive-web/app/models/file-resource.js | 25 -
.../main/resources/ui/hive-web/app/models/file.js | 26 -
.../main/resources/ui/hive-web/app/models/job.js | 55 -
.../ui/hive-web/app/models/saved-query.js | 29 -
.../main/resources/ui/hive-web/app/models/udf.js | 27 -
.../src/main/resources/ui/hive-web/app/router.js | 53 -
.../main/resources/ui/hive-web/app/routes/.gitkeep | 0
.../ui/hive-web/app/routes/application.js | 77 -
.../resources/ui/hive-web/app/routes/history.js | 29 -
.../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/messages.js | 22 -
.../resources/ui/hive-web/app/routes/queries.js | 40 -
.../resources/ui/hive-web/app/routes/splash.js | 133 -
.../resources/ui/hive-web/app/routes/tez-ui.js | 22 -
.../main/resources/ui/hive-web/app/routes/udfs.js | 36 -
.../ui/hive-web/app/routes/visual-explain.js | 22 -
.../ui/hive-web/app/routes/visualization-ui.js | 22 -
.../ui/hive-web/app/serializers/database.js | 41 -
.../resources/ui/hive-web/app/serializers/file.js | 23 -
.../resources/ui/hive-web/app/services/database.js | 243 -
.../resources/ui/hive-web/app/services/file.js | 59 -
.../resources/ui/hive-web/app/services/history.js | 204 -
.../ui/hive-web/app/services/job-progress.js | 111 -
.../main/resources/ui/hive-web/app/services/job.js | 56 -
.../resources/ui/hive-web/app/services/ldap.js | 59 -
.../resources/ui/hive-web/app/services/notify.js | 113 -
.../resources/ui/hive-web/app/services/session.js | 48 -
.../resources/ui/hive-web/app/services/settings.js | 199 -
.../main/resources/ui/hive-web/app/styles/.gitkeep | 0
.../main/resources/ui/hive-web/app/styles/app.scss | 722 ---
.../ui/hive-web/app/styles/dropdown-submenu.scss | 65 -
.../resources/ui/hive-web/app/styles/mixins.scss | 28 -
.../ui/hive-web/app/styles/notifications.scss | 37 -
.../ui/hive-web/app/styles/query-tabs.scss | 73 -
.../resources/ui/hive-web/app/styles/vars.scss | 21 -
.../resources/ui/hive-web/app/templates/.gitkeep | 0
.../ui/hive-web/app/templates/application.hbs | 45 -
.../ui/hive-web/app/templates/components/.gitkeep | 0
.../templates/components/alert-message-widget.hbs | 28 -
.../templates/components/collapsible-widget.hbs | 33 -
.../templates/components/column-filter-widget.hbs | 42 -
.../app/templates/components/date-range-widget.hbs | 22 -
.../app/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 -
.../templates/components/number-range-widget.hbs | 23 -
.../app/templates/components/panel-widget.hbs | 54 -
.../app/templates/components/popover-widget.hbs | 19 -
.../app/templates/components/progress-widget.hbs | 23 -
.../app/templates/components/query-editor.hbs | 19 -
.../app/templates/components/query-settings.hbs | 70 -
.../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 -
.../templates/components/validated-text-field.hbs | 23 -
.../components/visualization-tabs-widget.hbs | 27 -
.../app/templates/databases-search-results.hbs | 54 -
.../ui/hive-web/app/templates/databases-tree.hbs | 50 -
.../ui/hive-web/app/templates/databases.hbs | 54 -
.../ui/hive-web/app/templates/history.hbs | 67 -
.../resources/ui/hive-web/app/templates/index.hbs | 124 -
.../app/templates/index/history-query/explain.hbs | 27 -
.../app/templates/index/history-query/logs.hbs | 19 -
.../app/templates/index/history-query/results.hbs | 56 -
.../ui/hive-web/app/templates/insert-udfs.hbs | 46 -
.../ui/hive-web/app/templates/loading.hbs | 19 -
.../resources/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 -
.../ui/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 | 27 -
.../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 -
.../resources/ui/hive-web/app/templates/splash.hbs | 127 -
.../resources/ui/hive-web/app/templates/tez-ui.hbs | 31 -
.../resources/ui/hive-web/app/templates/udfs.hbs | 53 -
.../ui/hive-web/app/templates/upload-table.hbs | 296 -
.../ui/hive-web/app/templates/visual-explain.hbs | 93 -
.../ui/hive-web/app/templates/visualization-ui.hbs | 37 -
.../resources/ui/hive-web/app/transforms/date.js | 49 -
.../resources/ui/hive-web/app/utils/constants.js | 231 -
.../resources/ui/hive-web/app/utils/dag-rules.js | 141 -
.../resources/ui/hive-web/app/utils/functions.js | 139 -
.../main/resources/ui/hive-web/app/views/.gitkeep | 0
.../main/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 -
.../main/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 -
.../src/main/resources/ui/hive-web/big_tables.js | 54 -
.../src/main/resources/ui/hive-web/bower.json | 29 -
.../resources/ui/hive-web/config/environment.js | 70 -
.../src/main/resources/ui/hive-web/package.json | 48 -
.../src/main/resources/ui/hive-web/testem.json | 10 -
.../src/main/resources/ui/hive-web/tests/.jshintrc | 74 -
.../resources/ui/hive-web/tests/blanket-options.js | 36 -
.../ui/hive-web/tests/helpers/api-mock.js | 304 -
.../resources/ui/hive-web/tests/helpers/dbclick.js | 26 -
.../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 11435 -> 0 bytes
.../main/resources/ui/hive-web/tests/index.html | 71 -
.../ui/hive-web/tests/integration/database-test.js | 130 -
.../ui/hive-web/tests/integration/history-test.js | 95 -
.../tests/integration/query-editor-test.js | 126 -
.../tests/integration/saved-queries-test.js | 152 -
.../ui/hive-web/tests/integration/tez-ui-test.js | 49 -
.../ui/hive-web/tests/integration/udfs-test.js | 109 -
.../resources/ui/hive-web/tests/test-helper.js | 24 -
.../main/resources/ui/hive-web/tests/unit/.gitkeep | 0
.../ui/hive-web/tests/unit/adapters/application.js | 48 -
.../ui/hive-web/tests/unit/adapters/file.js | 39 -
.../unit/components/alert-message-widget-test.js | 91 -
.../unit/components/collapsible-widget-test.js | 46 -
.../unit/components/column-filter-widget-test.js | 138 -
.../unit/components/date-range-widget-test.js | 132 -
.../tests/unit/components/expander-widget-test.js | 59 -
.../tests/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 -
.../tests/unit/components/popover-widget-test.js | 36 -
.../tests/unit/components/progress-widget-test.js | 40 -
.../tests/unit/components/query-editor-test.js | 52 -
.../tests/unit/components/query-settings-test.js | 136 -
.../tests/unit/components/select-widget-test.js | 158 -
.../tests/unit/components/tabs-wiget-test.js | 117 -
.../tests/unit/components/typeahead-widget-test.js | 46 -
.../tests/unit/components/udf-tr-view-test.js | 122 -
.../tests/unit/controllers/databases-test.js | 276 -
.../tests/unit/controllers/history-test.js | 117 -
.../hive-web/tests/unit/controllers/index-test.js | 328 --
.../tests/unit/controllers/insert-udfs-test.js | 68 -
.../tests/unit/controllers/open-queries-test.js | 102 -
.../tests/unit/controllers/queries-test.js | 35 -
.../hive-web/tests/unit/controllers/tez-ui-test.js | 98 -
.../hive-web/tests/unit/controllers/udfs-test.js | 82 -
.../tests/unit/helpers/path-binding-test.js | 35 -
.../ui/hive-web/tests/unit/routes/messages-test.js | 53 -
.../ui/hive-web/tests/unit/routes/tez-ui-test.js | 49 -
.../tests/unit/routes/visual-explain-test.js | 106 -
.../ui/hive-web/tests/unit/services/notify-test.js | 155 -
.../hive-web/tests/unit/services/settings-test.js | 155 -
.../src/main/resources/ui/hive-web/vendor/.gitkeep | 0
.../ui/hive-web/vendor/browser-pollyfills.js | 213 -
.../hive-web/vendor/codemirror/codemirror-min.js | 17 -
.../ui/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 -
.../main/resources/ui/hive-web/vendor/dagre.min.js | 27 -
.../src/main/resources/ui/hive-web/yarn.lock | 5066 ----------------
.../src/main/resources/view.log4j.properties | 27 -
.../views/hive-next/src/main/resources/view.xml | 354 --
.../ambari/view/hive2/AsyncJobRunnerImplTest.java | 140 -
.../ambari/view/hive2/ConnectionFailuresTest.java | 157 -
.../view/hive2/HiveJdbcConnectionDelegateTest.java | 105 -
.../apache/ambari/view/hive2/JobExecutionTest.java | 116 -
.../ambari/view/hive2/PropertyValidatorTest.java | 113 -
.../ambari/view/hive2/ResultSetIteratorTest.java | 100 -
.../view/hive2/resources/upload/CSVParserTest.java | 275 -
.../hive2/resources/upload/DataParserCSVTest.java | 326 --
.../hive2/resources/upload/DataParserJSONTest.java | 263 -
.../hive2/resources/upload/DataParserXMLTest.java | 295 -
.../hive2/resources/upload/JsonParserTest.java | 146 -
.../hive2/resources/upload/OpenCSVParserTest.java | 313 -
.../view/hive2/resources/upload/OpenCSVTest.java | 245 -
.../hive2/resources/upload/ParseUtilsTest.java | 56 -
.../hive2/resources/upload/QueryGeneratorTest.java | 108 -
.../resources/upload/TableDataReaderTest.java | 127 -
.../view/hive2/resources/upload/XMLParserTest.java | 135 -
.../org/apache/ambari/view/hive20/AuthParams.java | 104 -
.../org/apache/ambari/view/hive20/BaseService.java | 59 -
.../ambari/view/hive20/ConnectionDelegate.java | 41 -
.../ambari/view/hive20/ConnectionFactory.java | 167 -
.../ambari/view/hive20/ConnectionSystem.java | 135 -
.../org/apache/ambari/view/hive20/Constants.java | 25 -
.../apache/ambari/view/hive20/DataMigrator.java | 102 -
.../org/apache/ambari/view/hive20/HelpService.java | 132 -
.../view/hive20/HiveJdbcConnectionDelegate.java | 112 -
.../apache/ambari/view/hive20/HiveViewImpl.java | 57 -
.../ambari/view/hive20/PropertyValidator.java | 107 -
.../org/apache/ambari/view/hive20/TestBean.java | 36 -
.../ambari/view/hive20/actor/DeathWatch.java | 55 -
.../apache/ambari/view/hive20/actor/HiveActor.java | 46 -
.../ambari/view/hive20/actor/JdbcConnector.java | 696 ---
.../ambari/view/hive20/actor/LogAggregator.java | 125 -
.../view/hive20/actor/OperationController.java | 408 --
.../view/hive20/actor/ResultSetIterator.java | 166 -
.../view/hive20/actor/StatementExecutor.java | 169 -
.../view/hive20/actor/YarnAtsGUIDFetcher.java | 71 -
.../ambari/view/hive20/actor/message/Connect.java | 77 -
.../view/hive20/actor/message/CursorReset.java | 22 -
.../view/hive20/actor/message/ExecuteJob.java | 38 -
.../view/hive20/actor/message/ExecuteQuery.java | 23 -
.../view/hive20/actor/message/FetchError.java | 42 -
.../view/hive20/actor/message/FetchResult.java | 42 -
.../hive20/actor/message/GetColumnMetadataJob.java | 59 -
.../actor/message/GetDatabaseMetadataJob.java | 24 -
.../view/hive20/actor/message/GetMoreLogs.java | 22 -
.../ambari/view/hive20/actor/message/HiveJob.java | 48 -
.../view/hive20/actor/message/HiveMessage.java | 53 -
.../view/hive20/actor/message/JobRejected.java | 44 -
.../view/hive20/actor/message/JobSubmitted.java | 38 -
.../actor/message/LogAggregationFinished.java | 21 -
.../view/hive20/actor/message/RegisterActor.java | 34 -
.../view/hive20/actor/message/ResetCursor.java | 22 -
.../hive20/actor/message/ResultInformation.java | 102 -
.../view/hive20/actor/message/ResultNotReady.java | 40 -
.../view/hive20/actor/message/ResultReady.java | 44 -
.../view/hive20/actor/message/RunStatement.java | 73 -
.../view/hive20/actor/message/SQLStatementJob.java | 64 -
.../hive20/actor/message/StartLogAggregation.java | 42 -
.../actor/message/job/AsyncExecutionFailed.java | 46 -
.../actor/message/job/AuthenticationFailed.java | 27 -
.../view/hive20/actor/message/job/CancelJob.java | 40 -
.../actor/message/job/ExecuteNextStatement.java | 22 -
.../hive20/actor/message/job/ExecutionFailed.java | 31 -
.../view/hive20/actor/message/job/Failure.java | 37 -
.../view/hive20/actor/message/job/FetchFailed.java | 31 -
.../ambari/view/hive20/actor/message/job/Next.java | 22 -
.../view/hive20/actor/message/job/NoMoreItems.java | 35 -
.../view/hive20/actor/message/job/NoResult.java | 21 -
.../view/hive20/actor/message/job/Result.java | 58 -
.../hive20/actor/message/job/ResultSetHolder.java | 33 -
.../actor/message/job/SaveDagInformation.java | 52 -
.../hive20/actor/message/job/SaveGuidToDB.java | 46 -
.../actor/message/job/UpdateYarnAtsGuid.java | 44 -
.../hive20/actor/message/lifecycle/CleanUp.java | 21 -
.../actor/message/lifecycle/DestroyConnector.java | 52 -
.../actor/message/lifecycle/FreeConnector.java | 53 -
.../actor/message/lifecycle/InactivityCheck.java | 21 -
.../hive20/actor/message/lifecycle/KeepAlive.java | 21 -
.../lifecycle/TerminateInactivityCheck.java | 21 -
.../backgroundjobs/BackgroundJobController.java | 115 -
.../backgroundjobs/BackgroundJobException.java | 30 -
.../ambari/view/hive20/client/AsyncJobRunner.java | 38 -
.../view/hive20/client/AsyncJobRunnerImpl.java | 143 -
.../view/hive20/client/ColumnDescription.java | 45 -
.../hive20/client/ColumnDescriptionExtended.java | 74 -
.../view/hive20/client/ColumnDescriptionShort.java | 53 -
.../view/hive20/client/ConnectionConfig.java | 59 -
.../apache/ambari/view/hive20/client/Cursor.java | 30 -
.../ambari/view/hive20/client/DDLDelegator.java | 46 -
.../view/hive20/client/DDLDelegatorImpl.java | 313 -
.../hive20/client/DatabaseMetadataWrapper.java | 37 -
.../ambari/view/hive20/client/EmptyCursor.java | 110 -
.../view/hive20/client/HiveAuthCredentials.java | 31 -
.../hive20/client/HiveAuthRequiredException.java | 27 -
.../client/HiveClientAuthRequiredException.java | 25 -
.../view/hive20/client/HiveClientException.java | 25 -
.../hive20/client/HiveClientRuntimeException.java | 25 -
.../view/hive20/client/NonPersistentCursor.java | 156 -
.../view/hive20/client/PersistentCursor.java | 87 -
.../org/apache/ambari/view/hive20/client/Row.java | 74 -
.../hive20/exceptions/NotConnectedException.java | 28 -
.../view/hive20/exceptions/ServiceException.java | 40 -
.../hive20/internal/AsyncExecutionFailure.java | 23 -
.../hive20/internal/AsyncExecutionSuccess.java | 25 -
.../ambari/view/hive20/internal/Connectable.java | 65 -
.../view/hive20/internal/ConnectionException.java | 25 -
.../view/hive20/internal/ConnectionProperties.java | 94 -
.../view/hive20/internal/ConnectionSupplier.java | 37 -
.../view/hive20/internal/ContextSupplier.java | 37 -
.../view/hive20/internal/DataStorageSupplier.java | 42 -
.../view/hive20/internal/DefaultSupplier.java | 60 -
.../apache/ambari/view/hive20/internal/Either.java | 79 -
.../view/hive20/internal/HdfsApiSupplier.java | 71 -
.../hive20/internal/HiveConnectionWrapper.java | 152 -
.../ambari/view/hive20/internal/HiveQuery.java | 71 -
.../ambari/view/hive20/internal/HiveResult.java | 160 -
.../ambari/view/hive20/internal/HiveTask.java | 53 -
.../view/hive20/internal/HiveTaskMessage.java | 118 -
.../view/hive20/internal/SafeViewContext.java | 179 -
.../view/hive20/internal/dto/ColumnInfo.java | 123 -
.../view/hive20/internal/dto/ColumnOrder.java | 54 -
.../view/hive20/internal/dto/ColumnStats.java | 175 -
.../view/hive20/internal/dto/DatabaseInfo.java | 85 -
.../view/hive20/internal/dto/DatabaseResponse.java | 71 -
.../hive20/internal/dto/DetailedTableInfo.java | 124 -
.../ambari/view/hive20/internal/dto/Order.java | 37 -
.../view/hive20/internal/dto/PartitionInfo.java | 44 -
.../ambari/view/hive20/internal/dto/Section.java | 46 -
.../view/hive20/internal/dto/StorageInfo.java | 124 -
.../ambari/view/hive20/internal/dto/TableInfo.java | 69 -
.../ambari/view/hive20/internal/dto/TableMeta.java | 134 -
.../view/hive20/internal/dto/TableResponse.java | 53 -
.../view/hive20/internal/dto/TableStats.java | 111 -
.../ambari/view/hive20/internal/dto/ViewInfo.java | 52 -
.../internal/parsers/AbstractTableMetaParser.java | 177 -
.../hive20/internal/parsers/ColumnInfoParser.java | 97 -
.../parsers/CreateTableStatementParser.java | 38 -
.../parsers/DatabaseMetadataExtractor.java | 46 -
.../internal/parsers/DetailedTableInfoParser.java | 71 -
.../view/hive20/internal/parsers/ParserUtils.java | 52 -
.../internal/parsers/PartitionInfoParser.java | 76 -
.../hive20/internal/parsers/StorageInfoParser.java | 100 -
.../hive20/internal/parsers/TableMetaParser.java | 31 -
.../internal/parsers/TableMetaParserImpl.java | 129 -
.../internal/parsers/TableMetaSectionParser.java | 30 -
.../hive20/internal/parsers/ViewInfoParser.java | 47 -
.../query/generators/AlterTableQueryGenerator.java | 375 --
.../generators/AnalyzeTableQueryGenerator.java | 78 -
.../generators/CreateDatabaseQueryGenerator.java | 44 -
.../generators/CreateTableQueryGenerator.java | 168 -
.../generators/DeleteDatabaseQueryGenerator.java | 48 -
.../generators/DeleteTableQueryGenerator.java | 67 -
.../generators/FetchColumnStatsQueryGenerator.java | 40 -
.../query/generators/InsertFromQueryGenerator.java | 106 -
.../query/generators/QueryGenerationUtils.java | 154 -
.../internal/query/generators/QueryGenerator.java | 26 -
.../generators/RenameTableQueryGenerator.java | 85 -
.../view/hive20/persistence/DataStoreStorage.java | 140 -
.../view/hive20/persistence/IStorageFactory.java | 23 -
.../persistence/InstanceKeyValueStorage.java | 132 -
.../view/hive20/persistence/KeyValueStorage.java | 163 -
.../hive20/persistence/LocalKeyValueStorage.java | 69 -
.../persistence/PersistentConfiguration.java | 52 -
.../ambari/view/hive20/persistence/Storage.java | 77 -
.../utils/ContextConfigurationAdapter.java | 260 -
.../persistence/utils/FilteringStrategy.java | 32 -
.../view/hive20/persistence/utils/Indexed.java | 36 -
.../hive20/persistence/utils/ItemNotFound.java | 43 -
.../utils/OnlyOwnersFilteringStrategy.java | 38 -
.../view/hive20/persistence/utils/Owned.java | 36 -
.../hive20/persistence/utils/PersonalResource.java | 22 -
.../hive20/persistence/utils/StorageFactory.java | 69 -
.../view/hive20/resources/CRUDResourceManager.java | 131 -
.../view/hive20/resources/IResourceManager.java | 37 -
.../resources/PersonalCRUDResourceManager.java | 99 -
.../resources/SharedCRUDResourceManager.java | 44 -
.../resources/browser/ConnectionService.java | 166 -
.../view/hive20/resources/browser/DDLProxy.java | 500 --
.../view/hive20/resources/browser/DDLService.java | 359 --
.../view/hive20/resources/browser/FileService.java | 45 -
.../view/hive20/resources/files/FileResource.java | 70 -
.../view/hive20/resources/files/FileService.java | 282 -
.../view/hive20/resources/jobs/Aggregator.java | 382 --
.../hive20/resources/jobs/JobResourceProvider.java | 117 -
.../view/hive20/resources/jobs/JobService.java | 596 --
.../hive20/resources/jobs/JobServiceInternal.java | 35 -
.../resources/jobs/ModifyNotificationDelegate.java | 23 -
.../jobs/ModifyNotificationInvocationHandler.java | 40 -
.../jobs/NoOperationStatusSetException.java | 23 -
.../hive20/resources/jobs/ProgressRetriever.java | 66 -
.../jobs/ResultsPaginationController.java | 423 --
.../hive20/resources/jobs/atsJobs/ATSParser.java | 248 -
.../resources/jobs/atsJobs/ATSParserFactory.java | 42 -
.../jobs/atsJobs/ATSRequestsDelegate.java | 47 -
.../jobs/atsJobs/ATSRequestsDelegateImpl.java | 175 -
.../hive20/resources/jobs/atsJobs/HiveQueryId.java | 42 -
.../hive20/resources/jobs/atsJobs/IATSParser.java | 39 -
.../hive20/resources/jobs/atsJobs/TezDagId.java | 26 -
.../hive20/resources/jobs/atsJobs/TezVertexId.java | 24 -
.../view/hive20/resources/jobs/rm/RMParser.java | 129 -
.../hive20/resources/jobs/rm/RMParserFactory.java | 48 -
.../resources/jobs/rm/RMRequestsDelegate.java | 31 -
.../resources/jobs/rm/RMRequestsDelegateImpl.java | 99 -
.../jobs/viewJobs/IJobControllerFactory.java | 23 -
.../view/hive20/resources/jobs/viewJobs/Job.java | 131 -
.../resources/jobs/viewJobs/JobController.java | 44 -
.../jobs/viewJobs/JobControllerFactory.java | 40 -
.../resources/jobs/viewJobs/JobControllerImpl.java | 328 --
.../hive20/resources/jobs/viewJobs/JobImpl.java | 339 --
.../hive20/resources/jobs/viewJobs/JobInfo.java | 78 -
.../jobs/viewJobs/JobResourceManager.java | 93 -
.../resources/resources/FileResourceItem.java | 78 -
.../resources/FileResourceResourceManager.java | 65 -
.../resources/FileResourceResourceProvider.java | 110 -
.../resources/resources/FileResourceService.java | 180 -
.../hive20/resources/savedQueries/SavedQuery.java | 96 -
.../savedQueries/SavedQueryResourceManager.java | 141 -
.../savedQueries/SavedQueryResourceProvider.java | 113 -
.../resources/savedQueries/SavedQueryService.java | 267 -
.../view/hive20/resources/settings/Setting.java | 71 -
.../settings/SettingsResourceManager.java | 97 -
.../hive20/resources/settings/SettingsService.java | 145 -
.../view/hive20/resources/system/ServiceCheck.java | 133 -
.../hive20/resources/system/SystemService.java | 77 -
.../resources/system/ranger/RangerException.java | 56 -
.../resources/system/ranger/RangerService.java | 379 --
.../ambari/view/hive20/resources/udfs/UDF.java | 87 -
.../hive20/resources/udfs/UDFResourceManager.java | 65 -
.../hive20/resources/udfs/UDFResourceProvider.java | 111 -
.../view/hive20/resources/udfs/UDFService.java | 193 -
.../view/hive20/resources/uploads/CSVParams.java | 74 -
.../resources/uploads/ColumnDescriptionImpl.java | 119 -
.../hive20/resources/uploads/HiveFileType.java | 30 -
.../hive20/resources/uploads/TableDataReader.java | 112 -
.../resources/uploads/UploadFromHdfsInput.java | 132 -
.../hive20/resources/uploads/UploadService.java | 571 --
.../resources/uploads/parsers/DataParser.java | 66 -
.../uploads/parsers/EndOfDocumentException.java | 41 -
.../hive20/resources/uploads/parsers/IParser.java | 32 -
.../resources/uploads/parsers/ParseOptions.java | 61 -
.../hive20/resources/uploads/parsers/Parser.java | 162 -
.../resources/uploads/parsers/PreviewData.java | 65 -
.../resources/uploads/parsers/RowIterator.java | 98 -
.../resources/uploads/parsers/RowMapIterator.java | 29 -
.../parsers/csv/commonscsv/CSVIterator.java | 57 -
.../uploads/parsers/csv/commonscsv/CSVParser.java | 88 -
.../parsers/csv/opencsv/OpenCSVIterator.java | 56 -
.../uploads/parsers/csv/opencsv/OpenCSVParser.java | 92 -
.../uploads/parsers/json/JSONIterator.java | 160 -
.../resources/uploads/parsers/json/JSONParser.java | 85 -
.../resources/uploads/parsers/xml/XMLIterator.java | 195 -
.../resources/uploads/parsers/xml/XMLParser.java | 102 -
.../resources/uploads/query/DeleteQueryInput.java | 48 -
.../uploads/query/InsertFromQueryInput.java | 115 -
.../resources/uploads/query/LoadQueryInput.java | 67 -
.../view/hive20/utils/AuthorizationChecker.java | 74 -
.../hive20/utils/BadRequestFormattedException.java | 27 -
.../ambari/view/hive20/utils/FilePaginator.java | 127 -
.../view/hive20/utils/HiveActorConfiguration.java | 71 -
.../hive20/utils/HiveClientFormattedException.java | 26 -
.../view/hive20/utils/LoggingOutputStream.java | 85 -
.../utils/MisconfigurationFormattedException.java | 47 -
.../hive20/utils/NotFoundFormattedException.java | 27 -
.../utils/ResultFetchFormattedException.java | 27 -
.../utils/ResultNotReadyFormattedException.java | 27 -
.../hive20/utils/ServiceFormattedException.java | 105 -
.../view/hive20/utils/SharedObjectsFactory.java | 197 -
.../utils/UniqueConstraintViolationException.java | 31 -
.../hive20/src/main/resources/application.conf | 57 -
.../views/hive20/src/main/resources/ui/.bowerrc | 4 -
.../hive20/src/main/resources/ui/.editorconfig | 20 -
.../views/hive20/src/main/resources/ui/.ember-cli | 27 -
.../views/hive20/src/main/resources/ui/.gitignore | 18 -
.../views/hive20/src/main/resources/ui/.jshintrc | 34 -
.../views/hive20/src/main/resources/ui/.travis.yml | 40 -
.../hive20/src/main/resources/ui/.watchmanconfig | 21 -
.../views/hive20/src/main/resources/ui/README.md | 28 -
.../main/resources/ui/app/adapters/application.js | 92 -
.../src/main/resources/ui/app/adapters/auth.js | 27 -
.../src/main/resources/ui/app/adapters/database.js | 34 -
.../src/main/resources/ui/app/adapters/ddl.js | 26 -
.../resources/ui/app/adapters/file-resource.js | 25 -
.../resources/ui/app/adapters/file-uploader.js | 28 -
.../main/resources/ui/app/adapters/hdfs-viewer.js | 27 -
.../src/main/resources/ui/app/adapters/job.js | 80 -
.../src/main/resources/ui/app/adapters/query.js | 54 -
.../src/main/resources/ui/app/adapters/ranger.js | 27 -
.../main/resources/ui/app/adapters/saved-query.js | 25 -
.../resources/ui/app/adapters/service-check.js | 47 -
.../main/resources/ui/app/adapters/table-info.js | 37 -
.../src/main/resources/ui/app/adapters/table.js | 83 -
.../src/main/resources/ui/app/adapters/udf.js | 31 -
.../main/resources/ui/app/adapters/upload-table.js | 93 -
.../views/hive20/src/main/resources/ui/app/app.js | 36 -
.../src/main/resources/ui/app/breakpoints.js | 23 -
.../src/main/resources/ui/app/components/.gitkeep | 0
.../ui/app/components/alert-message-display.js | 45 -
.../resources/ui/app/components/alert-message.js | 32 -
.../resources/ui/app/components/column-item.js | 72 -
.../resources/ui/app/components/confirm-dialog.js | 46 -
.../ui/app/components/create-database-form.js | 59 -
.../resources/ui/app/components/create-table.js | 180 -
.../ui/app/components/csv-format-params.js | 76 -
.../ui/app/components/database-search-bar.js | 78 -
.../ui/app/components/edit-setting-item.js | 111 -
.../main/resources/ui/app/components/edit-table.js | 220 -
.../resources/ui/app/components/export-result.js | 54 -
.../ui/app/components/fileresource-item.js | 70 -
.../ui/app/components/hdfs-viewer-modal.js | 51 -
.../resources/ui/app/components/info-dialog.js | 38 -
.../main/resources/ui/app/components/job-item.js | 91 -
.../resources/ui/app/components/jobs-browser.js | 101 -
.../resources/ui/app/components/list-filter.js | 48 -
.../main/resources/ui/app/components/list-group.js | 23 -
.../main/resources/ui/app/components/list-item.js | 29 -
.../app/components/multiple-database-search-bar.js | 117 -
.../ui/app/components/notification-message.js | 30 -
.../resources/ui/app/components/property-item.js | 44 -
.../resources/ui/app/components/query-editor.js | 112 -
.../ui/app/components/query-result-log.js | 28 -
.../ui/app/components/query-result-table.js | 150 -
.../resources/ui/app/components/radio-button.js | 39 -
.../ui/app/components/service-check-entry.js | 50 -
.../resources/ui/app/components/setting-item.js | 32 -
.../resources/ui/app/components/setting-list.js | 37 -
.../resources/ui/app/components/simple-table.js | 22 -
.../ui/app/components/table-advanced-settings.js | 177 -
.../resources/ui/app/components/table-columns.js | 53 -
.../ui/app/components/table-properties.js | 40 -
.../ui/app/components/table-rename-form.js | 63 -
.../ui/app/components/table-statistics.js | 172 -
.../main/resources/ui/app/components/tabs-item.js | 43 -
.../main/resources/ui/app/components/tabs-pane.js | 27 -
.../ui/app/components/top-application-bar.js | 24 -
.../main/resources/ui/app/components/udf-edit.js | 40 -
.../main/resources/ui/app/components/udf-item.js | 212 -
.../main/resources/ui/app/components/udf-new.js | 41 -
.../ui/app/components/upload-table-source.js | 48 -
.../resources/ui/app/components/upload-table.js | 61 -
.../ui/app/components/validated-text-field.js | 62 -
.../ui/app/components/visual-explain-detail.js | 31 -
.../resources/ui/app/components/visual-explain.js | 85 -
.../resources/ui/app/configs/create-table-tabs.js | 48 -
.../src/main/resources/ui/app/configs/datatypes.js | 34 -
.../resources/ui/app/configs/edit-table-tabs.js | 48 -
.../main/resources/ui/app/configs/file-format.js | 28 -
.../src/main/resources/ui/app/configs/helpers.js | 163 -
.../resources/ui/app/configs/hive-parameters.js | 93 -
.../ui/app/configs/non-printable-escape-chars.js | 53 -
.../main/resources/ui/app/configs/result-tabs.js | 48 -
.../ui/app/configs/service-check-status.js | 19 -
.../resources/ui/app/configs/table-level-tabs.js | 72 -
.../resources/ui/app/configs/top-level-tabs.js | 67 -
.../src/main/resources/ui/app/controllers/.gitkeep | 0
.../resources/ui/app/controllers/application.js | 31 -
.../src/main/resources/ui/app/controllers/jobs.js | 38 -
.../main/resources/ui/app/controllers/messages.js | 30 -
.../main/resources/ui/app/controllers/password.js | 44 -
.../main/resources/ui/app/controllers/queries.js | 22 -
.../resources/ui/app/controllers/saved-query.js | 22 -
.../resources/ui/app/controllers/savedqueries.js | 24 -
.../resources/ui/app/controllers/service-check.js | 57 -
.../src/main/resources/ui/app/controllers/udfs.js | 24 -
.../main/resources/ui/app/controllers/udfs/new.js | 23 -
.../src/main/resources/ui/app/helpers/.gitkeep | 0
.../ui/app/helpers/alert-message-context-class.js | 27 -
.../ui/app/helpers/alert-message-icon-class.js | 37 -
.../main/resources/ui/app/helpers/extract-value.js | 27 -
.../resources/ui/app/helpers/format-column-size.js | 39 -
.../main/resources/ui/app/helpers/shorten-text.js | 32 -
.../src/main/resources/ui/app/helpers/to-json.js | 25 -
.../hive20/src/main/resources/ui/app/index.html | 43 -
.../main/resources/ui/app/initializers/.gitkeep | 0
.../resources/ui/app/initializers/responsive.js | 33 -
.../resources/ui/app/locales/en/translations.js | 105 -
.../src/main/resources/ui/app/mixins/ui-logger.js | 42 -
.../src/main/resources/ui/app/models/.gitkeep | 0
.../src/main/resources/ui/app/models/alert.js | 28 -
.../src/main/resources/ui/app/models/column.js | 131 -
.../src/main/resources/ui/app/models/database.js | 25 -
.../main/resources/ui/app/models/file-resource.js | 25 -
.../src/main/resources/ui/app/models/file.js | 26 -
.../hive20/src/main/resources/ui/app/models/job.js | 56 -
.../main/resources/ui/app/models/saved-query.js | 29 -
.../src/main/resources/ui/app/models/setting.js | 25 -
.../src/main/resources/ui/app/models/table-info.js | 31 -
.../main/resources/ui/app/models/table-property.js | 54 -
.../src/main/resources/ui/app/models/table.js | 26 -
.../hive20/src/main/resources/ui/app/models/udf.js | 26 -
.../src/main/resources/ui/app/models/worksheet.js | 47 -
.../hive20/src/main/resources/ui/app/resolver.js | 21 -
.../hive20/src/main/resources/ui/app/router.js | 79 -
.../src/main/resources/ui/app/routes/.gitkeep | 0
.../main/resources/ui/app/routes/application.js | 54 -
.../resources/ui/app/routes/databases-error.js | 27 -
.../src/main/resources/ui/app/routes/databases.js | 162 -
.../ui/app/routes/databases/database-error.js | 27 -
.../resources/ui/app/routes/databases/database.js | 25 -
.../ui/app/routes/databases/database/index.js | 27 -
.../app/routes/databases/database/tables-error.js | 27 -
.../ui/app/routes/databases/database/tables.js | 109 -
.../app/routes/databases/database/tables/index.js | 28 -
.../databases/database/tables/new-database.js | 65 -
.../ui/app/routes/databases/database/tables/new.js | 116 -
.../databases/database/tables/table-error.js | 27 -
.../app/routes/databases/database/tables/table.js | 121 -
.../routes/databases/database/tables/table/auth.js | 27 -
.../databases/database/tables/table/columns.js | 33 -
.../routes/databases/database/tables/table/ddl.js | 22 -
.../databases/database/tables/table/details.js | 22 -
.../routes/databases/database/tables/table/edit.js | 83 -
.../databases/database/tables/table/index.js | 25 -
.../databases/database/tables/table/partitions.js | 22 -
.../databases/database/tables/table/rename.js | 80 -
.../databases/database/tables/table/stats.js | 22 -
.../databases/database/tables/table/storage.js | 22 -
.../database/tables/table/table-meta-router.js | 27 -
.../routes/databases/database/tables/table/view.js | 22 -
.../databases/database/tables/upload-table.js | 782 ---
.../resources/ui/app/routes/databases/index.js | 27 -
.../resources/ui/app/routes/databases/newtable.js | 30 -
.../src/main/resources/ui/app/routes/index.js | 26 -
.../src/main/resources/ui/app/routes/jobs.js | 82 -
.../src/main/resources/ui/app/routes/messages.js | 32 -
.../resources/ui/app/routes/messages/message.js | 31 -
.../src/main/resources/ui/app/routes/password.js | 41 -
.../src/main/resources/ui/app/routes/queries.js | 31 -
.../main/resources/ui/app/routes/queries/index.js | 32 -
.../main/resources/ui/app/routes/queries/new.js | 49 -
.../main/resources/ui/app/routes/queries/query.js | 747 ---
.../ui/app/routes/queries/query/loading.js | 24 -
.../resources/ui/app/routes/queries/query/log.js | 104 -
.../ui/app/routes/queries/query/results.js | 112 -
.../ui/app/routes/queries/query/tez-ui.js | 45 -
.../ui/app/routes/queries/query/visual-explain.js | 57 -
.../main/resources/ui/app/routes/savedqueries.js | 140 -
.../main/resources/ui/app/routes/service-check.js | 62 -
.../src/main/resources/ui/app/routes/settings.js | 98 -
.../src/main/resources/ui/app/routes/udfs.js | 78 -
.../src/main/resources/ui/app/routes/udfs/new.js | 201 -
.../main/resources/ui/app/serializers/database.js | 25 -
.../src/main/resources/ui/app/serializers/file.js | 23 -
.../src/main/resources/ui/app/serializers/table.js | 22 -
.../resources/ui/app/services/alert-messages.js | 156 -
.../main/resources/ui/app/services/auto-refresh.js | 149 -
.../resources/ui/app/services/file-resource.js | 33 -
.../src/main/resources/ui/app/services/jobs.js | 103 -
.../main/resources/ui/app/services/ldap-auth.js | 35 -
.../src/main/resources/ui/app/services/query.js | 72 -
.../resources/ui/app/services/saved-queries.js | 84 -
.../resources/ui/app/services/service-check.js | 169 -
.../resources/ui/app/services/stats-service.js | 63 -
.../resources/ui/app/services/table-operations.js | 250 -
.../resources/ui/app/services/tez-view-info.js | 92 -
.../src/main/resources/ui/app/services/udf.js | 65 -
.../src/main/resources/ui/app/styles/app.scss | 1024 ----
.../ui/app/styles/bootstrap-overrides.scss | 81 -
.../src/main/resources/ui/app/styles/fonts.scss | 31 -
.../ui/app/styles/power-select-overrides.scss | 24 -
.../resources/ui/app/templates/application.hbs | 52 -
.../resources/ui/app/templates/components/.gitkeep | 0
.../templates/components/alert-message-display.hbs | 34 -
.../ui/app/templates/components/alert-message.hbs | 34 -
.../ui/app/templates/components/column-item.hbs | 127 -
.../ui/app/templates/components/confirm-dialog.hbs | 39 -
.../templates/components/create-database-form.hbs | 31 -
.../ui/app/templates/components/create-table.hbs | 63 -
.../app/templates/components/csv-format-params.hbs | 138 -
.../templates/components/database-search-bar.hbs | 57 -
.../app/templates/components/edit-setting-item.hbs | 42 -
.../ui/app/templates/components/edit-table.hbs | 60 -
.../ui/app/templates/components/export-result.hbs | 46 -
.../app/templates/components/fileresource-item.hbs | 32 -
.../app/templates/components/hdfs-viewer-modal.hbs | 50 -
.../ui/app/templates/components/info-dialog.hbs | 38 -
.../ui/app/templates/components/job-item.hbs | 33 -
.../ui/app/templates/components/jobs-browser.hbs | 102 -
.../ui/app/templates/components/list-filter.hbs | 33 -
.../ui/app/templates/components/list-group.hbs | 22 -
.../ui/app/templates/components/list-item.hbs | 22 -
.../components/multiple-database-search-bar.hbs | 43 -
.../templates/components/notification-message.hbs | 48 -
.../ui/app/templates/components/property-item.hbs | 47 -
.../ui/app/templates/components/query-editor.hbs | 21 -
.../app/templates/components/query-result-log.hbs | 23 -
.../templates/components/query-result-table.hbs | 109 -
.../ui/app/templates/components/radio-button.hbs | 19 -
.../templates/components/service-check-entry.hbs | 47 -
.../ui/app/templates/components/setting-item.hbs | 28 -
.../ui/app/templates/components/setting-list.hbs | 41 -
.../ui/app/templates/components/simple-table.hbs | 42 -
.../components/table-advanced-settings.hbs | 221 -
.../ui/app/templates/components/table-columns.hbs | 44 -
.../app/templates/components/table-properties.hbs | 41 -
.../app/templates/components/table-rename-form.hbs | 31 -
.../app/templates/components/table-statistics.hbs | 174 -
.../ui/app/templates/components/tabs-item.hbs | 24 -
.../ui/app/templates/components/tabs-pane.hbs | 21 -
.../templates/components/top-application-bar.hbs | 33 -
.../ui/app/templates/components/udf-edit.hbs | 85 -
.../ui/app/templates/components/udf-item.hbs | 74 -
.../ui/app/templates/components/udf-new.hbs | 78 -
.../templates/components/upload-table-source.hbs | 112 -
.../ui/app/templates/components/upload-table.hbs | 61 -
.../templates/components/validated-text-field.hbs | 23 -
.../templates/components/visual-explain-detail.hbs | 32 -
.../ui/app/templates/components/visual-explain.hbs | 42 -
.../resources/ui/app/templates/databases-error.hbs | 19 -
.../ui/app/templates/databases-loading.hbs | 21 -
.../main/resources/ui/app/templates/databases.hbs | 72 -
.../ui/app/templates/databases/database-error.hbs | 19 -
.../ui/app/templates/databases/database.hbs | 19 -
.../templates/databases/database/tables-error.hbs | 19 -
.../databases/database/tables-loading.hbs | 24 -
.../ui/app/templates/databases/database/tables.hbs | 46 -
.../databases/database/tables/new-database.hbs | 47 -
.../templates/databases/database/tables/new.hbs | 46 -
.../databases/database/tables/table-error.hbs | 19 -
.../databases/database/tables/table-loading.hbs | 21 -
.../templates/databases/database/tables/table.hbs | 76 -
.../databases/database/tables/table/auth-error.hbs | 35 -
.../database/tables/table/auth-loading.hbs | 23 -
.../databases/database/tables/table/auth.hbs | 66 -
.../databases/database/tables/table/columns.hbs | 44 -
.../databases/database/tables/table/ddl.hbs | 21 -
.../databases/database/tables/table/details.hbs | 65 -
.../databases/database/tables/table/edit.hbs | 45 -
.../databases/database/tables/table/partitions.hbs | 38 -
.../databases/database/tables/table/rename.hbs | 46 -
.../databases/database/tables/table/stats.hbs | 19 -
.../databases/database/tables/table/storage.hbs | 64 -
.../databases/database/tables/table/view.hbs | 40 -
.../databases/database/tables/upload-table.hbs | 45 -
.../resources/ui/app/templates/jobs-loading.hbs | 20 -
.../src/main/resources/ui/app/templates/jobs.hbs | 24 -
.../main/resources/ui/app/templates/messages.hbs | 50 -
.../ui/app/templates/messages/message.hbs | 19 -
.../main/resources/ui/app/templates/password.hbs | 48 -
.../main/resources/ui/app/templates/queries.hbs | 37 -
.../resources/ui/app/templates/queries/query.hbs | 172 -
.../ui/app/templates/queries/query/loading.hbs | 21 -
.../ui/app/templates/queries/query/log.hbs | 35 -
.../ui/app/templates/queries/query/results.hbs | 55 -
.../ui/app/templates/queries/query/tez-ui.hbs | 32 -
.../app/templates/queries/query/visual-explain.hbs | 40 -
.../ui/app/templates/savedqueries-loading.hbs | 21 -
.../resources/ui/app/templates/savedqueries.hbs | 100 -
.../resources/ui/app/templates/service-check.hbs | 52 -
.../ui/app/templates/settings-loading.hbs | 21 -
.../main/resources/ui/app/templates/settings.hbs | 32 -
.../src/main/resources/ui/app/templates/tables.hbs | 19 -
.../resources/ui/app/templates/udfs-loading.hbs | 21 -
.../src/main/resources/ui/app/templates/udfs.hbs | 78 -
.../main/resources/ui/app/templates/udfs/new.hbs | 30 -
.../src/main/resources/ui/app/transforms/date.js | 50 -
.../src/main/resources/ui/app/utils/constants.js | 64 -
.../resources/ui/app/utils/hdfs-picker-config.js | 32 -
.../ui/app/utils/hive-explainer/enhancer.js | 37 -
.../ui/app/utils/hive-explainer/fallback.js | 33 -
.../resources/ui/app/utils/hive-explainer/index.js | 32 -
.../ui/app/utils/hive-explainer/processor.js | 425 --
.../ui/app/utils/hive-explainer/renderer-force.js | 326 --
.../ui/app/utils/hive-explainer/renderer.js | 589 --
.../ui/app/utils/hive-explainer/transformer.js | 569 --
.../views/hive20/src/main/resources/ui/bower.json | 15 -
.../src/main/resources/ui/config/environment.js | 78 -
.../src/main/resources/ui/ember-cli-build.js | 74 -
.../hive20/src/main/resources/ui/package.json | 67 -
.../public/fonts/roboto/roboto-v15-latin-300.eot | Bin 16205 -> 0 bytes
.../public/fonts/roboto/roboto-v15-latin-300.svg | 314 -
.../public/fonts/roboto/roboto-v15-latin-300.ttf | Bin 32664 -> 0 bytes
.../public/fonts/roboto/roboto-v15-latin-300.woff | Bin 18520 -> 0 bytes
.../public/fonts/roboto/roboto-v15-latin-300.woff2 | Bin 14524 -> 0 bytes
.../fonts/roboto/roboto-v15-latin-regular.eot | Bin 16227 -> 0 bytes
.../fonts/roboto/roboto-v15-latin-regular.svg | 308 -
.../fonts/roboto/roboto-v15-latin-regular.ttf | Bin 32652 -> 0 bytes
.../fonts/roboto/roboto-v15-latin-regular.woff | Bin 18520 -> 0 bytes
.../fonts/roboto/roboto-v15-latin-regular.woff2 | Bin 14584 -> 0 bytes
.../views/hive20/src/main/resources/ui/testem.js | 31 -
.../hive20/src/main/resources/ui/tests/.jshintrc | 53 -
.../main/resources/ui/tests/helpers/destroy-app.js | 23 -
.../resources/ui/tests/helpers/flash-message.js | 24 -
.../ui/tests/helpers/module-for-acceptance.js | 41 -
.../main/resources/ui/tests/helpers/resolver.js | 29 -
.../main/resources/ui/tests/helpers/responsive.js | 76 -
.../main/resources/ui/tests/helpers/start-app.js | 36 -
.../hive20/src/main/resources/ui/tests/index.html | 51 -
.../main/resources/ui/tests/integration/.gitkeep | 0
.../src/main/resources/ui/tests/test-helper.js | 28 -
.../src/main/resources/ui/tests/unit/.gitkeep | 0
.../hive20/src/main/resources/ui/vendor/.gitkeep | 0
.../main/resources/ui/vendor/browser-pollyfills.js | 213 -
.../views/hive20/src/main/resources/ui/yarn.lock | 6032 --------------------
.../src/main/resources/view.log4j.properties | 27 -
contrib/views/hive20/src/main/resources/view.xml | 406 --
.../ambari/view/hive20/AsyncJobRunnerImplTest.java | 138 -
.../ambari/view/hive20/ConnectionFailuresTest.java | 157 -
.../hive20/HiveJdbcConnectionDelegateTest.java | 105 -
.../ambari/view/hive20/JobExecutionTest.java | 116 -
.../ambari/view/hive20/PropertyValidatorTest.java | 113 -
.../ambari/view/hive20/ResultSetIteratorTest.java | 100 -
.../hive20/internal/parsers/ParserUtilsTest.java | 66 -
.../generators/AlterTableQueryGeneratorTest.java | 235 -
.../AnalyzeTableQueryGeneratorSpecTest.groovy | 196 -
.../generators/CreateTableQueryGeneratorTest.java | 110 -
.../DeleteDatabaseQueryGeneratorSpecTest.groovy | 65 -
.../InsertFromQueryGeneratorSpecTest.groovy | 69 -
.../RenameTableQueryGeneratorSpecTest.groovy | 104 -
.../hive20/resources/upload/CSVParserTest.java | 275 -
.../hive20/resources/upload/DataParserCSVTest.java | 327 --
.../resources/upload/DataParserJSONTest.java | 264 -
.../hive20/resources/upload/DataParserXMLTest.java | 295 -
.../hive20/resources/upload/JsonParserTest.java | 146 -
.../hive20/resources/upload/OpenCSVParserTest.java | 313 -
.../view/hive20/resources/upload/OpenCSVTest.java | 245 -
.../hive20/resources/upload/ParseUtilsTest.java | 56 -
.../resources/upload/TableDataReaderTest.java | 128 -
.../hive20/resources/upload/XMLParserTest.java | 135 -
.../resources/uploads/UploadServiceTest.java | 60 -
.../HIVE20_ENVIRONMENT.postman_environment.json | 16 -
.../rest/postman/hive20.postman_collection.json | 566 --
contrib/views/pom.xml | 3 -
contrib/views/tez/readme.md | 90 -
.../ambari/view/tez/ConfigurationService.java | 50 -
.../apache/ambari/view/tez/PropertyService.java | 83 -
.../org/apache/ambari/view/tez/ProxyServlet.java | 130 -
.../org/apache/ambari/view/tez/SettingService.java | 47 -
.../org/apache/ambari/view/tez/ViewController.java | 64 -
.../apache/ambari/view/tez/ViewControllerImpl.java | 110 -
.../org/apache/ambari/view/tez/ViewStatus.java | 44 -
.../view/tez/exceptions/TezWebAppException.java | 104 -
.../ambari/view/tez/rest/AtsProxyResource.java | 52 -
.../ambari/view/tez/rest/BaseProxyResource.java | 89 -
.../view/tez/rest/BaseRedirectionResource.java | 59 -
.../ambari/view/tez/rest/RMProxyResource.java | 52 -
.../ambari/view/tez/rest/RMRedirectResource.java | 51 -
.../ambari/view/tez/rest/ViewStatusResource.java | 46 -
.../apache/ambari/view/tez/utils/ProxyHelper.java | 106 -
.../views/tez/src/main/resources/WEB-INF/web.xml | 37 -
.../main/resources/ui/ambari-scripts/init-view.js | 302 -
.../tez/src/main/resources/view.log4j.properties | 27 -
contrib/views/tez/src/main/resources/view.xml | 102 -
.../ambari/view/tez/utils/ProxyHelperTest.java | 71 -
1101 files changed, 103981 deletions(-)
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/AuthParams.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/AuthParams.java
deleted file mode 100644
index 53077e3..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/AuthParams.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/**
- * 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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.commons.lang3.StringUtils;
-import org.apache.hadoop.security.UserGroupInformation;
-
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Holds session parameters pulled from the
- * view context
- */
-public class AuthParams {
- private static final String HIVE_SESSION_PARAMS = "hive.session.params";
- private Map<String, String> sessionParams = new HashMap<>();
- private final ViewContext context;
-
- public AuthParams(ViewContext context) {
- sessionParams = parseSessionParams(context.getProperties().get(HIVE_SESSION_PARAMS));
- this.context = context;
- }
-
- /**
- * Returns a map created by parsing the parameters in view context
- * @param params session parameters as string
- * @return parsed session parameters
- */
- private Map<String, String> parseSessionParams(String params) {
- Map<String, String> sessions = new HashMap<>();
- if (StringUtils.isEmpty(params))
- return sessions;
- String[] splits = params.split(";");
- for (String split : splits) {
- String[] paramSplit = split.trim().split("=");
- if ("auth".equals(paramSplit[0]) || "proxyuser".equals(paramSplit[0])) {
- sessions.put(paramSplit[0], paramSplit[1]);
- }
- }
- return Collections.unmodifiableMap(sessions);
- }
-
- /**
- * Gets the proxy user
- * @return User and group information
- * @throws IOException
- */
- public UserGroupInformation getProxyUser() throws IOException {
- UserGroupInformation ugi;
- String proxyuser = null;
- if(context.getCluster() != null) {
- proxyuser = context.getCluster().getConfigurationValue("cluster-env","ambari_principal_name");
- }
-
- if(StringUtils.isEmpty(proxyuser)) {
- if (sessionParams.containsKey("proxyuser")) {
- ugi = UserGroupInformation.createRemoteUser(sessionParams.get("proxyuser"));
- } else {
- ugi = UserGroupInformation.getCurrentUser();
- }
- } else {
- ugi = UserGroupInformation.createRemoteUser(proxyuser);
- }
- ugi.setAuthenticationMethod(getAuthenticationMethod());
- return ugi;
- }
-
- /**
- * Get the Authentication method
- * @return
- */
- private UserGroupInformation.AuthenticationMethod getAuthenticationMethod() {
- UserGroupInformation.AuthenticationMethod authMethod;
- if (sessionParams.containsKey("auth") && !StringUtils.isEmpty(sessionParams.get("auth"))) {
- String authName = sessionParams.get("auth");
- authMethod = UserGroupInformation.AuthenticationMethod.valueOf(authName.toUpperCase());
- } else {
- authMethod = UserGroupInformation.AuthenticationMethod.SIMPLE;
- }
- return authMethod;
- }
-}
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
deleted file mode 100644
index 773aa55..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/BaseService.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- * 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);
- }
-}
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
deleted file mode 100644
index bb1fde8..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionDelegate.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.GetColumnMetadataJob;
-import org.apache.hive.jdbc.HiveConnection;
-import org.apache.hive.jdbc.HiveStatement;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-public interface ConnectionDelegate {
- HiveStatement createStatement(HiveConnection connection) throws SQLException;
- Optional<ResultSet> execute(String statement) throws SQLException;
- Optional<ResultSet> execute(HiveConnection connection, String statement) throws SQLException;
- ResultSet getColumnMetadata(HiveConnection connection, GetColumnMetadataJob job) throws SQLException;
- void cancel() throws SQLException;
- void closeResultSet();
- void closeStatement();
-}
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
deleted file mode 100644
index d333459..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionFactory.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * 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.base.Optional;
-import com.google.common.base.Strings;
-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 final String ZK_HIVE_DYN_SERVICE_DISCOVERY_KEY = "hive.server2.support.dynamic.service.discovery";
- private static final String ZK_HIVE_NAMESPACE_KEY = "hive.server2.zookeeper.namespace";
- private static final String ZK_HIVE_QUORUM = "hive.zookeeper.quorum";
-
- private static final String AMBARI_HIVE_SERVICE_NAME = "HIVE";
- private static final String AMBARI_HIVESERVER_COMPONENT_NAME = "HIVE_SERVER";
-
- private static final String HIVE_SITE = "hive-site";
- private static final String HIVE_INTERACTIVE_SITE = "hive-interactive-site";
-
- private static final String HIVE_JDBC_URL_KEY = "hive.jdbc.url";
- private static final String HIVE_SESSION_PARAMS = "hive.session.params";
- private static final String HIVE_LDAP_CONFIG = "hive.ldap.configured";
-
- private static final String BINARY_PORT_KEY = "hive.server2.thrift.port";
- private static final String HIVE_AUTH_MODE = "hive.server2.authentication";
- private static final String HTTP_PORT_KEY = "hive.server2.thrift.http.port";
- private static final String HIVE_TRANSPORT_MODE_KEY = "hive.server2.transport.mode";
- private static final String HTTP_PATH_KEY = "hive.server2.thrift.http.path";
- private static final String HS2_PROXY_USER = "hive.server2.proxy.user";
- private static final String USE_HIVE_INTERACTIVE_MODE = "use.hive.interactive.mode";
-
- public static boolean isLdapEnabled(ViewContext context){
- if (context.getCluster() == null) {
- return context.getProperties().get(HIVE_LDAP_CONFIG).equalsIgnoreCase("true");
- }
- return context.getCluster().getConfigurationValue(HIVE_SITE,HIVE_AUTH_MODE).equalsIgnoreCase("ldap");
- }
-
- 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();
- if(isLdapEnabled(context)){
- Optional<String> opPassword = ConnectionSystem.getInstance().getPassword(context);
- if(opPassword.isPresent()){
- return new ConnectionConfig(userName, opPassword.get(), jdbcUrl);
- }
- }
- return new ConnectionConfig(userName, "", jdbcUrl);
- }
-
-
- private static String getFromHiveConfiguration(ViewContext context) {
- boolean useLLAP = Boolean.valueOf(context.getProperties().get(USE_HIVE_INTERACTIVE_MODE));
- 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);
- if (useLLAP) {
- binaryPort = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, BINARY_PORT_KEY);
- httpPort = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_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);
- if(!Strings.isNullOrEmpty(sessionParams)) {
- builder.append(";").append(sessionParams);
- }
-
- if (!isBinary) {
- builder.append(";").append("transportMode=http;httpPath=").append(pathKey);
- }
-
- return builder.toString();
- }
-
- private static String getFromClusterZookeeperConfig(ViewContext context) {
- boolean useLLAP = Boolean.valueOf(context.getProperties().get(USE_HIVE_INTERACTIVE_MODE));
- String quorum = context.getCluster().getConfigurationValue(HIVE_SITE, ZK_HIVE_QUORUM);
-
- String namespace = context.getCluster().getConfigurationValue(HIVE_SITE, ZK_HIVE_NAMESPACE_KEY);
- if (useLLAP) {
- namespace = context.getCluster().getConfigurationValue(HIVE_INTERACTIVE_SITE, ZK_HIVE_NAMESPACE_KEY);
- }
-
- String sessionParams = context.getProperties().get(HIVE_SESSION_PARAMS);
-
- String formatted = String.format("jdbc:hive2://%s/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=%s", quorum, namespace);
- if (Strings.isNullOrEmpty(sessionParams)) {
- sessionParams = "";
- }
-
- if (!sessionParams.contains(HS2_PROXY_USER)) {
- if (!sessionParams.isEmpty()) {
- sessionParams += ";";
- }
- sessionParams = sessionParams + HS2_PROXY_USER + "=" + context.getUsername();
- }
-
- if (sessionParams.isEmpty()) {
- return formatted;
- }
- return formatted + ";" + sessionParams;
- }
-
- 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;
- }
-}
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
deleted file mode 100644
index 4ec3332..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/ConnectionSystem.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * 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.Inbox;
-import akka.actor.PoisonPill;
-import akka.actor.Props;
-import com.google.common.base.Optional;
-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 org.apache.ambari.view.hive2.internal.SafeViewContext;
-import org.apache.parquet.Strings;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-public class ConnectionSystem {
-
- 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, Map<String, ActorRef>> operationControllerMap = new ConcurrentHashMap<>();
-
- // credentials map stores usernames and passwords
- private static Map<String, String> credentialsMap = new ConcurrentHashMap<>();
-
- private ConnectionSystem() {
- ClassLoader classLoader = getClass().getClassLoader();
- Config config = ConfigFactory.load(classLoader);
- this.actorSystem = ActorSystem.create(ACTOR_SYSTEM_NAME, config, classLoader);
- }
-
- public static ConnectionSystem getInstance() {
- if (instance == null) {
- synchronized (lock) {
- if (instance == null) {
- instance = new ConnectionSystem();
- }
- }
- }
- return instance;
- }
-
- private ActorRef createOperationController(ViewContext context) {
- ActorRef deathWatch = actorSystem.actorOf(Props.create(DeathWatch.class));
- return actorSystem.actorOf(
- Props.create(OperationController.class, actorSystem, deathWatch, context,
- new ConnectionSupplier(), new DataStorageSupplier(), new HdfsApiSupplier()));
- }
-
- public ActorSystem getActorSystem() {
- return actorSystem;
- }
-
- /**
- * Returns one operationController per View Instance
- *
- * @param viewContext
- * @return operationController Instance
- */
- public synchronized ActorRef getOperationController(ViewContext viewContext) {
- SafeViewContext context = new SafeViewContext(viewContext);
- String instanceName = context.getInstanceName();
- ActorRef ref = null;
- Map<String, ActorRef> stringActorRefMap = operationControllerMap.get(instanceName);
- if (stringActorRefMap != null) {
- ref = stringActorRefMap.get(context.getUsername());
- }
- if (ref == null) {
- ref = createOperationController(context);
- if (stringActorRefMap == null) {
- stringActorRefMap = new HashMap<>();
- stringActorRefMap.put(context.getUsername(), ref);
- operationControllerMap.put(instanceName, stringActorRefMap);
- } else {
- stringActorRefMap.put(context.getUsername(), ref);
- }
- }
- return ref;
- }
-
- public synchronized void persistCredentials(String user,String password){
- if(!Strings.isNullOrEmpty(password)){
- credentialsMap.put(user,password);
- }
- }
-
-
- public synchronized Optional<String> getPassword(ViewContext viewContext){
- String pass = credentialsMap.get(viewContext.getUsername());
- return Optional.fromNullable(pass);
- }
-
- public void removeOperationControllerFromCache(String viewInstanceName) {
- Map<String, ActorRef> refs = operationControllerMap.remove(viewInstanceName);
- if (refs != null) {
- for (ActorRef ref : refs.values()) {
- Inbox inbox = Inbox.create(getActorSystem());
- inbox.send(ref, PoisonPill.getInstance());
- }
- }
- }
-
- public void shutdown() {
- if (!actorSystem.isTerminated()) {
- actorSystem.shutdown();
- }
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/DataMigrator.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/DataMigrator.java
deleted file mode 100644
index b33df65..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/DataMigrator.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * 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.migration.ViewDataMigrationContext;
-import org.apache.ambari.view.migration.ViewDataMigrationException;
-import org.apache.ambari.view.migration.ViewDataMigrator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.inject.Inject;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Data migrator that maps persistence entities names
- * from Hive 1 to entities of Hive 2.
- */
-public class DataMigrator implements ViewDataMigrator {
- private final static Logger LOG =
- LoggerFactory.getLogger(DataMigrator.class);
-
- /**
- * The view context of target migration instance.
- */
- @Inject
- private ViewContext viewContext;
-
- /**
- * The migration context.
- */
- @Inject
- private ViewDataMigrationContext migrationContext;
-
- private static final Map<String, Class> hive1EntitiesMapping;
- static
- {
- hive1EntitiesMapping = new HashMap<>();
- hive1EntitiesMapping.put("org.apache.ambari.view.hive.resources.jobs.viewJobs.JobImpl",
- org.apache.ambari.view.hive2.resources.jobs.viewJobs.JobImpl.class);
- hive1EntitiesMapping.put("org.apache.ambari.view.hive.resources.savedQueries.SavedQuery",
- org.apache.ambari.view.hive2.resources.savedQueries.SavedQuery.class);
- hive1EntitiesMapping.put("org.apache.ambari.view.hive.resources.udfs.UDF",
- org.apache.ambari.view.hive2.resources.udfs.UDF.class);
- hive1EntitiesMapping.put("org.apache.ambari.view.hive.resources.resources.FileResourceItem",
- org.apache.ambari.view.hive2.resources.resources.FileResourceItem.class);
- hive1EntitiesMapping.put("org.apache.ambari.view.hive.TestBean",
- org.apache.ambari.view.hive2.TestBean.class);
- }
-
- @Override
- public boolean beforeMigration() throws ViewDataMigrationException {
- return isHive1();
- }
-
- @Override
- public void afterMigration() throws ViewDataMigrationException {
- }
-
- @Override
- public void migrateEntity(Class originEntityClass, Class currentEntityClass) throws ViewDataMigrationException {
- if (isHive1()) {
- currentEntityClass = hive1EntitiesMapping.get(originEntityClass.getCanonicalName());
- if (currentEntityClass == null) {
- LOG.debug("Mapping was not found for class " + originEntityClass.getCanonicalName());
- return;
- }
-
- migrationContext.copyAllObjects(originEntityClass, currentEntityClass);
-
- } else {
- LOG.warn("Unknown migration policy for class");
- }
- }
-
- @Override
- public void migrateInstanceData() throws ViewDataMigrationException {
- migrationContext.copyAllInstanceData();
- }
-
- private boolean isHive1() {
- return migrationContext.getOriginDataVersion() < 1;
- }
-}
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
deleted file mode 100644
index ec01739..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HelpService.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/**
- * 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.apache.ambari.view.hive2.utils.ServiceCheck;
-import org.apache.ambari.view.hive2.utils.ServiceFormattedException;
-import org.apache.ambari.view.utils.hdfs.HdfsApiException;
-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;
-import java.io.IOException;
-
-/**
- * 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();
- }
-
- /**
- * HomeDirectory Status
- * @return status
- */
- @GET
- @Path("/userhomeStatus")
- @Produces(MediaType.APPLICATION_JSON)
- public Response userhomeStatus (){
- FileService.userhomeSmokeTest(context);
- return getOKResponse();
- }
-
-
- /**
- * ATS Status
- * @return status
- */
- @GET
- @Path("/atsStatus")
- @Produces(MediaType.APPLICATION_JSON)
- public Response atsStatus() {
- try {
- ATSRequestsDelegateImpl atsimpl = new ATSRequestsDelegateImpl(context, new ATSParserFactory(context).getATSUrl());
- atsimpl.checkATSStatus();
- return getOKResponse();
- }catch (IOException e){
- throw new WebApplicationException(e);
- }
- }
-
- @GET
- @Path("/service-check-policy")
- public Response getServiceCheckList(){
- ServiceCheck serviceCheck = new ServiceCheck(context);
- try {
- ServiceCheck.Policy policy = serviceCheck.getServiceCheckPolicy();
- JSONObject policyJson = new JSONObject();
- policyJson.put("serviceCheckPolicy", policy);
- return Response.ok(policyJson).build();
- } catch (HdfsApiException e) {
- LOG.error("Error occurred while generating service check policy : ", e);
- throw new ServiceFormattedException(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();
- }
-}
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
deleted file mode 100644
index bd2b9ba..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HiveJdbcConnectionDelegate.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * 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.GetColumnMetadataJob;
-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;
-
- @Override
- public HiveStatement createStatement(HiveConnection connection) throws SQLException {
- Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
- currentStatement = (HiveStatement) statement;
- return currentStatement;
- }
-
- @Override
- public Optional<ResultSet> execute(String statement) throws SQLException {
- if (currentStatement == null) {
- throw new SQLException("Statement not created. Cannot execute Hive queries");
- }
-
- boolean hasResultSet = currentStatement.execute(statement);
-
- if (hasResultSet) {
- ResultSet resultSet = currentStatement.getResultSet();
- currentResultSet = resultSet;
- return Optional.of(resultSet);
- } else {
- return Optional.absent();
- }
- }
-
- @Override
- public Optional<ResultSet> execute(HiveConnection connection, String sqlStatement) throws SQLException {
- createStatement(connection);
- return execute(sqlStatement);
- }
-
-
- @Override
- public 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 resultSet;
- }
-
- @Override
- public void cancel() throws SQLException {
- if (currentStatement != null) {
- currentStatement.cancel();
- }
- }
-
- @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
- }
- }
-
-
-}
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
deleted file mode 100644
index ca8202e..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/HiveViewImpl.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * 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());
- ConnectionSystem.getInstance().removeOperationControllerFromCache(definition.getInstanceName());
- }
-
- @Override
- public void onUpdate(ViewInstanceDefinition definition) {
- //drop all cached connection for instance
- UserLocal.dropInstanceCache(definition.getInstanceName());
- SharedObjectsFactory.dropInstanceCache(definition.getInstanceName());
- ConnectionSystem.getInstance().removeOperationControllerFromCache(definition.getInstanceName());
- }
-}
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
deleted file mode 100644
index ad59e34..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/PropertyValidator.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/**
- * 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.ClusterType;
-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";
- public static final String USE_HIVE_INTERACTIVE_MODE = "use.hive.interactive.mode";
-
- @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 (property.equals(USE_HIVE_INTERACTIVE_MODE)) {
- String value = viewInstanceDefinition.getPropertyMap().get(USE_HIVE_INTERACTIVE_MODE);
- if (!("true".equalsIgnoreCase(value) || "false".equalsIgnoreCase(value))) {
- return new InvalidPropertyValidationResult(false, "Must be 'true' or 'false'");
- }
- }
-
- // if associated with cluster(local or remote), no need to validate associated properties
- ClusterType clusterType = viewInstanceDefinition.getClusterType();
- if (clusterType == ClusterType.LOCAL_AMBARI || clusterType == ClusterType.REMOTE_AMBARI) {
- 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;
- }
- }
-
-}
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
deleted file mode 100644
index 4b49f64..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/TestBean.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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;
- }
-}
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
deleted file mode 100644
index d72eb29..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/DeathWatch.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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
- public 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());
- }else if(message instanceof Terminated){
- Terminated terminated = (Terminated) message;
- ActorRef actor = terminated.actor();
- LOG.info("Received terminate for actor "+ actor);
- LOG.info("Termination for {} at {}", actor,new Date());
-
- }else{
- LOG.info("received unknown message : {}", hiveMessage);
- }
-
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/HiveActor.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/HiveActor.java
deleted file mode 100644
index a71ca5c..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/HiveActor.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.UntypedActor;
-import org.apache.ambari.view.hive2.actor.message.HiveMessage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class HiveActor extends UntypedActor {
-
- private static final Logger LOG = LoggerFactory.getLogger(HiveActor.class);
-
- @Override
- final public void onReceive(Object message) throws Exception {
- HiveMessage hiveMessage = new HiveMessage(message);
- if (LOG.isDebugEnabled()) {
- LOG.debug("Received message: " + message.getClass().getName() + ", generated id: " + hiveMessage.getId() +
- " sent by: " + sender() + ", recieved by" + self());
- }
-
- handleMessage(hiveMessage);
-
- if (LOG.isDebugEnabled()) {
- LOG.debug("Message submitted: " + hiveMessage.getId());
- }
- }
-
- public abstract void handleMessage(HiveMessage hiveMessage);
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/JdbcConnector.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/JdbcConnector.java
deleted file mode 100644
index f7746d9..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/JdbcConnector.java
+++ /dev/null
@@ -1,645 +0,0 @@
-/*
- * 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.Cancellable;
-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.AuthParams;
-import org.apache.ambari.view.hive2.ConnectionDelegate;
-import org.apache.ambari.view.hive2.actor.message.Connect;
-import org.apache.ambari.view.hive2.actor.message.FetchError;
-import org.apache.ambari.view.hive2.actor.message.FetchResult;
-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.HiveMessage;
-import org.apache.ambari.view.hive2.actor.message.ResultInformation;
-import org.apache.ambari.view.hive2.actor.message.ResultNotReady;
-import org.apache.ambari.view.hive2.actor.message.RunStatement;
-import org.apache.ambari.view.hive2.actor.message.SQLStatementJob;
-import org.apache.ambari.view.hive2.actor.message.job.CancelJob;
-import org.apache.ambari.view.hive2.actor.message.job.ExecuteNextStatement;
-import org.apache.ambari.view.hive2.actor.message.job.ExecutionFailed;
-import org.apache.ambari.view.hive2.actor.message.job.Failure;
-import org.apache.ambari.view.hive2.actor.message.job.NoResult;
-import org.apache.ambari.view.hive2.actor.message.job.ResultSetHolder;
-import org.apache.ambari.view.hive2.actor.message.job.SaveDagInformation;
-import org.apache.ambari.view.hive2.actor.message.job.SaveGuidToDB;
-import org.apache.ambari.view.hive2.actor.message.lifecycle.CleanUp;
-import org.apache.ambari.view.hive2.actor.message.lifecycle.DestroyConnector;
-import org.apache.ambari.view.hive2.actor.message.lifecycle.FreeConnector;
-import org.apache.ambari.view.hive2.actor.message.lifecycle.InactivityCheck;
-import org.apache.ambari.view.hive2.actor.message.lifecycle.KeepAlive;
-import org.apache.ambari.view.hive2.actor.message.lifecycle.TerminateInactivityCheck;
-import org.apache.ambari.view.hive2.internal.Connectable;
-import org.apache.ambari.view.hive2.internal.ConnectionException;
-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.utils.HiveActorConfiguration;
-import org.apache.ambari.view.utils.hdfs.HdfsApi;
-import org.apache.hive.jdbc.HiveConnection;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import scala.concurrent.duration.Duration;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayDeque;
-import java.util.Queue;
-import java.util.UUID;
-import java.util.concurrent.TimeUnit;
-
-
-/**
- * Wraps one Jdbc connection per user, per instance. This is used to delegate execute the statements and
- * creates child actors to delegate the ResultSet extraction, YARN/ATS querying for ExecuteJob info and Log Aggregation
- */
-public class JdbcConnector extends HiveActor {
-
- private static final Logger LOG = LoggerFactory.getLogger(JdbcConnector.class);
-
- public static final String SUFFIX = "validating the login";
-
- /**
- * Interval for maximum inactivity allowed
- */
- private final static long MAX_INACTIVITY_INTERVAL = 5 * 60 * 1000;
-
- /**
- * Interval for maximum inactivity allowed before termination
- */
- private static final long MAX_TERMINATION_INACTIVITY_INTERVAL = 10 * 60 * 1000;
-
- private static final long MILLIS_IN_SECOND = 1000L;
-
- private final Storage storage;
-
- /**
- * Keeps track of the timestamp when the last activity has happened. This is
- * used to calculate the inactivity period and take lifecycle decisions based
- * on it.
- */
- private long lastActivityTimestamp;
-
- /**
- * Akka scheduler to tick at an interval to deal with inactivity of this actor
- */
- private Cancellable inactivityScheduler;
-
- /**
- * Akka scheduler to tick at an interval to deal with the inactivity after which
- * the actor should be killed and connection should be released
- */
- private Cancellable terminateActorScheduler;
-
- private Connectable connectable = null;
- private final ActorRef deathWatch;
- private final ConnectionDelegate connectionDelegate;
- private final ActorRef parent;
- private ActorRef statementExecutor = null;
- private final HdfsApi hdfsApi;
- private final AuthParams authParams;
-
- /**
- * true if the actor is currently executing any job.
- */
- private boolean executing = false;
- private HiveJob.Type executionType = HiveJob.Type.SYNC;
-
- /**
- * Returns the timeout configurations.
- */
- private final HiveActorConfiguration actorConfiguration;
- private String username;
- private Optional<String> jobId = Optional.absent();
- private Optional<String> logFile = Optional.absent();
- private int statementsCount = 0;
-
- private ActorRef commandSender = null;
-
- private ActorRef resultSetIterator = null;
- private boolean isFailure = false;
- private Failure failure = null;
- private boolean isCancelCalled = false;
-
- /**
- * For every execution, this will hold the statements that are left to execute
- */
- private Queue<String> statementQueue = new ArrayDeque<>();
-
- public JdbcConnector(ViewContext viewContext, ActorRef parent, ActorRef deathWatch, HdfsApi hdfsApi,
- ConnectionDelegate connectionDelegate, Storage storage) {
- this.hdfsApi = hdfsApi;
- this.parent = parent;
- this.deathWatch = deathWatch;
- this.connectionDelegate = connectionDelegate;
- this.storage = storage;
- this.lastActivityTimestamp = System.currentTimeMillis();
- resultSetIterator = null;
-
- authParams = new AuthParams(viewContext);
- actorConfiguration = new HiveActorConfiguration(viewContext);
- }
-
- @Override
- public void handleMessage(HiveMessage hiveMessage) {
- Object message = hiveMessage.getMessage();
- if (message instanceof InactivityCheck) {
- checkInactivity();
- } else if (message instanceof TerminateInactivityCheck) {
- checkTerminationInactivity();
- } else if (message instanceof KeepAlive) {
- keepAlive();
- } else if (message instanceof CleanUp) {
- cleanUp();
- } else {
- handleNonLifecycleMessage(hiveMessage);
- }
- }
-
- private void handleNonLifecycleMessage(HiveMessage hiveMessage) {
- Object message = hiveMessage.getMessage();
- keepAlive();
- if (message instanceof Connect) {
- connect((Connect) message);
- } else if (message instanceof SQLStatementJob) {
- runStatementJob((SQLStatementJob) message);
- } else if (message instanceof GetColumnMetadataJob) {
- runGetMetaData((GetColumnMetadataJob) message);
- } else if (message instanceof ExecuteNextStatement) {
- executeNextStatement();
- } else if (message instanceof ResultInformation) {
- gotResultBack((ResultInformation) message);
- } else if (message instanceof CancelJob) {
- cancelJob((CancelJob) message);
- } else if (message instanceof FetchResult) {
- fetchResult((FetchResult) message);
- } else if (message instanceof FetchError) {
- fetchError((FetchError) message);
- } else if (message instanceof SaveGuidToDB) {
- saveGuid((SaveGuidToDB) message);
- } else if (message instanceof SaveDagInformation) {
- saveDagInformation((SaveDagInformation) message);
- } else {
- unhandled(message);
- }
- }
-
- private void fetchError(FetchError message) {
- if (isFailure) {
- sender().tell(Optional.of(failure), self());
- return;
- }
- sender().tell(Optional.absent(), self());
- }
-
- private void fetchResult(FetchResult message) {
- if (isFailure) {
- sender().tell(failure, self());
- return;
- }
-
- if (executing) {
- sender().tell(new ResultNotReady(jobId.get(), username), self());
- return;
- }
- sender().tell(Optional.fromNullable(resultSetIterator), self());
- }
-
- private void cancelJob(CancelJob message) {
- if (!executing || connectionDelegate == null) {
- LOG.error("Cannot cancel job for user as currently the job is not running or started. JobId: {}", message.getJobId());
- return;
- }
- LOG.info("Cancelling job for user. JobId: {}, user: {}", message.getJobId(), username);
- try {
- isCancelCalled = true;
- connectionDelegate.cancel();
- } catch (SQLException e) {
- LOG.error("Failed to cancel job. JobId: {}. {}", message.getJobId(), e);
- }
- }
-
- private void gotResultBack(ResultInformation message) {
- Optional<Failure> failureOptional = message.getFailure();
- if (failureOptional.isPresent()) {
- Failure failure = failureOptional.get();
- processFailure(failure);
- return;
- }
- if (statementQueue.size() == 0) {
- // This is the last resultSet
- processResult(message.getResultSet());
- } else {
- self().tell(new ExecuteNextStatement(), self());
- }
- }
-
- private void processCancel() {
- executing = false;
- if (isAsync() && jobId.isPresent()) {
- LOG.error("Job canceled by user for JobId: {}", jobId.get());
- updateJobStatus(jobId.get(), Job.JOB_STATE_CANCELED);
- }
- }
-
- private void processFailure(Failure failure) {
- executing = false;
- isFailure = true;
- this.failure = failure;
- if (isAsync() && jobId.isPresent()) {
- stopStatementExecutor();
- if(isCancelCalled) {
- processCancel();
- return;
- }
- updateJobStatus(jobId.get(), Job.JOB_STATE_ERROR);
- } else {
- // Send for sync execution
- commandSender.tell(new ExecutionFailed(failure.getMessage(), failure.getError()), self());
- cleanUpWithTermination();
- }
- }
-
- private void stopStatementExecutor() {
- if (statementExecutor != null) {
- statementExecutor.tell(PoisonPill.getInstance(), ActorRef.noSender());
- statementExecutor = null;
- }
- }
-
- private void processResult(Optional<ResultSet> resultSetOptional) {
- executing = false;
- stopStatementExecutor();
-
- LOG.info("Finished processing SQL statements for Job id : {}", jobId.or("SYNC JOB"));
- if (isAsync() && jobId.isPresent()) {
- updateJobStatus(jobId.get(), Job.JOB_STATE_FINISHED);
- }
-
- if (resultSetOptional.isPresent()) {
- ActorRef resultSetActor = getContext().actorOf(Props.create(ResultSetIterator.class, self(),
- resultSetOptional.get(), isAsync()).withDispatcher("akka.actor.result-dispatcher"),
- "ResultSetIterator:" + UUID.randomUUID().toString());
- resultSetIterator = resultSetActor;
- if (!isAsync()) {
- commandSender.tell(new ResultSetHolder(resultSetActor), self());
- }
- } else {
- resultSetIterator = null;
- if (!isAsync()) {
- commandSender.tell(new NoResult(), self());
- }
- }
- }
-
- private void executeNextStatement() {
- if (statementQueue.isEmpty()) {
- jobExecutionCompleted();
- return;
- }
-
- int index = statementsCount - statementQueue.size();
- String statement = statementQueue.poll();
- if (statementExecutor == null) {
- statementExecutor = getStatementExecutor();
- }
-
- if (isAsync()) {
- statementExecutor.tell(new RunStatement(index, statement, jobId.get(), true, logFile.get(), true), self());
- } else {
- statementExecutor.tell(new RunStatement(index, statement), self());
- }
- }
-
- private void runStatementJob(SQLStatementJob message) {
- executing = true;
- jobId = message.getJobId();
- logFile = message.getLogFile();
- executionType = message.getType();
- commandSender = getSender();
-
- resetToInitialState();
-
- if (!checkConnection()) return;
-
- for (String statement : message.getStatements()) {
- statementQueue.add(statement);
- }
- statementsCount = statementQueue.size();
-
- if (isAsync() && jobId.isPresent()) {
- updateJobStatus(jobId.get(), Job.JOB_STATE_RUNNING);
- startInactivityScheduler();
- }
- self().tell(new ExecuteNextStatement(), self());
- }
-
- public boolean checkConnection() {
- if (connectable == null) {
- notifyConnectFailure(new SQLException("Hive connection is not created"));
- return false;
- }
-
- Optional<HiveConnection> connectionOptional = connectable.getConnection();
- if (!connectionOptional.isPresent()) {
- SQLException sqlException = connectable.isUnauthorized() ? new SQLException("Hive Connection not Authorized", "AUTHFAIL")
- : new SQLException("Hive connection is not created");
- notifyConnectFailure(sqlException);
- return false;
- }
- return true;
- }
-
- private void runGetMetaData(GetColumnMetadataJob message) {
- if (!checkConnection()) return;
- resetToInitialState();
- executing = true;
- executionType = message.getType();
- commandSender = getSender();
- statementExecutor = getStatementExecutor();
- statementExecutor.tell(message, self());
- }
-
- private ActorRef getStatementExecutor() {
- return getContext().actorOf(Props.create(StatementExecutor.class, hdfsApi, storage, connectable.getConnection().get(), connectionDelegate)
- .withDispatcher("akka.actor.result-dispatcher"),
- "StatementExecutor:" + UUID.randomUUID().toString());
- }
-
- private boolean isAsync() {
- return executionType == HiveJob.Type.ASYNC;
- }
-
- private void notifyConnectFailure(Exception ex) {
- executing = false;
- isFailure = true;
- this.failure = new Failure("Cannot connect to hive", ex);
- if (isAsync()) {
- updateJobStatus(jobId.get(), Job.JOB_STATE_ERROR);
-
- if(ex instanceof ConnectionException){
- ConnectionException connectionException = (ConnectionException) ex;
- Throwable cause = connectionException.getCause();
- if(cause instanceof SQLException){
- SQLException sqlException = (SQLException) cause;
- if(isLoginError(sqlException))
- return;
- }
- }
-
- } else {
- sender().tell(new ExecutionFailed("Cannot connect to hive"), ActorRef.noSender());
- }
- // Do not clean up in case of failed authorizations
- // The failure is bubbled to the user for requesting credentials
-
- if (!(ex instanceof SQLException) || !((SQLException) ex).getSQLState().equals("AUTHFAIL")) {
- cleanUpWithTermination();
- }
- }
-
- private boolean isLoginError(SQLException ce) {
- return ce.getCause().getMessage().toLowerCase().endsWith(SUFFIX);
- }
-
- private void keepAlive() {
- lastActivityTimestamp = System.currentTimeMillis();
- }
-
- private void jobExecutionCompleted() {
- // Set is executing as false so that the inactivity checks can finish cleanup
- // after timeout
- LOG.info("Job execution completed for user: {}. Results are ready to be fetched", username);
- this.executing = false;
- }
-
- protected Optional<String> getUsername() {
- return Optional.fromNullable(username);
- }
-
- private void connect(Connect message) {
- username = message.getUsername();
- jobId = message.getJobId();
- executionType = message.getType();
- // check the connectable
- if (connectable == null) {
- connectable = message.getConnectable(authParams);
- }
- // make the connectable to Hive
- try {
- if (!connectable.isOpen()) {
- connectable.connect();
- }
- } catch (ConnectionException e) {
- LOG.error("Failed to create a hive connection. {}", e);
- // set up job failure
- // notify parent about job failure
- notifyConnectFailure(e);
- return;
- }
- startTerminateInactivityScheduler();
- }
-
- private void updateJobStatus(String jobid, final String status) {
- new JobSaver(jobid) {
- @Override
- protected void update(JobImpl job) {
- job.setStatus(status);
- job.setDuration(getUpdatedDuration(job.getDateSubmitted()));
- }
- }.save();
- LOG.info("Stored job status for Job id: {} as '{}'", jobid, status);
- }
-
- private void saveGuid(final SaveGuidToDB message) {
- new JobSaver(message.getJobId()) {
- @Override
- protected void update(JobImpl job) {
- job.setGuid(message.getGuid());
- }
- }.save();
- LOG.info("Stored GUID for Job id: {} as '{}'", message.getJobId(), message.getGuid());
- }
-
- private void saveDagInformation(final SaveDagInformation message) {
- if(message.getDagId() == null &&
- message.getDagName() == null &&
- message.getApplicationId() == null) {
- LOG.error("Cannot save Dag Information for job Id: {} as all the properties are null.", message.getJobId());
- return;
- }
- new JobSaver(message.getJobId()) {
-
- @Override
- protected void update(JobImpl job) {
- if (message.getApplicationId() != null) {
- job.setApplicationId(message.getApplicationId());
- }
- if (message.getDagId() != null) {
- job.setDagId(message.getDagId());
- }
- if(message.getDagName() != null) {
- job.setDagName(message.getDagName());
- }
- }
- }.save();
- LOG.info("Store Dag Information for job. Job id: {}, dagName: {}, dagId: {}, applicationId: {}", message.getJobId(), message.getDagName(), message.getDagId(), message.getApplicationId());
- }
-
- private Long getUpdatedDuration(Long dateSubmitted) {
- return (System.currentTimeMillis() / MILLIS_IN_SECOND) - (dateSubmitted / MILLIS_IN_SECOND);
- }
-
-
- private void checkInactivity() {
- LOG.debug("Inactivity check, executing status: {}", executing);
- if (executing) {
- keepAlive();
- return;
- }
- long current = System.currentTimeMillis();
- if ((current - lastActivityTimestamp) > actorConfiguration.getInactivityTimeout(MAX_INACTIVITY_INTERVAL)) {
- // Stop all the sub-actors created
- cleanUp();
- }
- }
-
- private void checkTerminationInactivity() {
- LOG.debug("Termination check, executing status: {}", executing);
- if (executing) {
- keepAlive();
- return;
- }
-
- long current = System.currentTimeMillis();
- if ((current - lastActivityTimestamp) > actorConfiguration.getTerminationTimeout(MAX_TERMINATION_INACTIVITY_INTERVAL)) {
- cleanUpWithTermination();
- }
- }
-
- private void cleanUp() {
- if (jobId.isPresent()) {
- LOG.debug("{} :: Cleaning up resources for inactivity for jobId: {}", self().path().name(), jobId.get());
- } else {
- LOG.debug("{} ::Cleaning up resources with inactivity for Sync execution.", self().path().name());
- }
- this.executing = false;
- cleanUpStatementAndResultSet();
- stopInactivityScheduler();
- parent.tell(new FreeConnector(username, jobId.orNull(), isAsync()), self());
- }
-
- private void cleanUpWithTermination() {
- this.executing = false;
- LOG.debug("{} :: Cleaning up resources with inactivity for execution.", self().path().name());
- cleanUpStatementAndResultSet();
-
- stopInactivityScheduler();
- stopTerminateInactivityScheduler();
- parent.tell(new DestroyConnector(username, jobId.orNull(), isAsync()), this.self());
- self().tell(PoisonPill.getInstance(), ActorRef.noSender());
- }
-
-
- private void cleanUpStatementAndResultSet() {
- connectionDelegate.closeStatement();
- connectionDelegate.closeResultSet();
- }
-
- private void startTerminateInactivityScheduler() {
- this.terminateActorScheduler = getContext().system().scheduler().schedule(
- Duration.Zero(), Duration.create(60 * 1000, TimeUnit.MILLISECONDS),
- this.getSelf(), new TerminateInactivityCheck(), getContext().dispatcher(), null);
- }
-
- private void stopTerminateInactivityScheduler() {
- if (!(terminateActorScheduler == null || terminateActorScheduler.isCancelled())) {
- terminateActorScheduler.cancel();
- }
- }
-
- private void startInactivityScheduler() {
- if (inactivityScheduler != null) {
- inactivityScheduler.cancel();
- }
- inactivityScheduler = getContext().system().scheduler().schedule(
- Duration.Zero(), Duration.create(15 * 1000, TimeUnit.MILLISECONDS),
- this.self(), new InactivityCheck(), getContext().dispatcher(), null);
- }
-
- private void stopInactivityScheduler() {
- if (!(inactivityScheduler == null || inactivityScheduler.isCancelled())) {
- inactivityScheduler.cancel();
- }
- }
-
- private void resetToInitialState() {
- isFailure = false;
- failure = null;
- resultSetIterator = null;
- isCancelCalled = false;
- statementQueue = new ArrayDeque<>();
- }
-
- @Override
- public void postStop() throws Exception {
- stopInactivityScheduler();
- stopTerminateInactivityScheduler();
-
- if (connectable.isOpen()) {
- connectable.disconnect();
- }
- }
-
- /**
- * Saves the job to database.
- */
- private abstract class JobSaver {
- private final String jobId;
-
- JobSaver(String jobId) {
- this.jobId = jobId;
- }
-
- public void save() {
- try {
- JobImpl job = storage.load(JobImpl.class, jobId);
- update(job);
- storage.store(JobImpl.class, job);
- } catch (ItemNotFound itemNotFound) {
- itemNotFound(jobId);
- }
- }
-
- /**
- * Override to handle Not found exception
- */
- private void itemNotFound(String jobId) {
- // Nothing to do
- }
-
- protected abstract void update(JobImpl job);
- }
-}
\ No newline at end of file
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/LogAggregator.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/LogAggregator.java
deleted file mode 100644
index 69b4a56..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/LogAggregator.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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.Cancellable;
-import com.google.common.base.Joiner;
-import org.apache.ambari.view.hive2.actor.message.GetMoreLogs;
-import org.apache.ambari.view.hive2.actor.message.HiveMessage;
-import org.apache.ambari.view.hive2.actor.message.LogAggregationFinished;
-import org.apache.ambari.view.hive2.actor.message.StartLogAggregation;
-import org.apache.ambari.view.utils.hdfs.HdfsApi;
-import org.apache.ambari.view.utils.hdfs.HdfsApiException;
-import org.apache.ambari.view.utils.hdfs.HdfsUtil;
-import org.apache.commons.lang.StringUtils;
-import org.apache.hive.jdbc.HiveStatement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import scala.concurrent.duration.Duration;
-
-import java.sql.SQLException;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Reads the logs for a ExecuteJob from the Statement and writes them into hdfs.
- */
-public class LogAggregator extends HiveActor {
-
- private final Logger LOG = LoggerFactory.getLogger(getClass());
-
- public static final int AGGREGATION_INTERVAL = 5 * 1000;
- private final HdfsApi hdfsApi;
- private HiveStatement statement;
- private final String logFile;
-
- private Cancellable moreLogsScheduler;
- private ActorRef parent;
- private boolean hasStartedFetching = false;
- private boolean shouldFetchMore = true;
- private String allLogs = "";
-
- public LogAggregator(HdfsApi hdfsApi, String logFile) {
- this.hdfsApi = hdfsApi;
- this.logFile = logFile;
- }
-
- @Override
- public void handleMessage(HiveMessage hiveMessage) {
- Object message = hiveMessage.getMessage();
- if (message instanceof StartLogAggregation) {
- start((StartLogAggregation) message);
- }
-
- if (message instanceof GetMoreLogs) {
- try {
- getMoreLogs();
- } catch (SQLException e) {
- LOG.error("SQL Error while getting logs. Tried writing to: {}. Exception: {}", logFile, e);
- } catch (HdfsApiException e) {
- LOG.warn("HDFS Error while getting writing logs to {}. Exception: {}", logFile, e);
- }
- }
- }
-
- private void start(StartLogAggregation message) {
- this.statement = message.getHiveStatement();
- parent = this.getSender();
- hasStartedFetching = false;
- shouldFetchMore = true;
- String logTitle = "Logs for Query '" + message.getStatement() + "'";
- String repeatSeperator = StringUtils.repeat("=", logTitle.length());
- allLogs += String.format("\n\n%s\n%s\n%s\n", repeatSeperator, logTitle, repeatSeperator);
-
- if (!(moreLogsScheduler == null || moreLogsScheduler.isCancelled())) {
- moreLogsScheduler.cancel();
- }
- this.moreLogsScheduler = getContext().system().scheduler().schedule(
- Duration.Zero(), Duration.create(AGGREGATION_INTERVAL, TimeUnit.MILLISECONDS),
- this.getSelf(), new GetMoreLogs(), getContext().dispatcher(), null);
- }
-
- private void getMoreLogs() throws SQLException, HdfsApiException {
- List<String> logs = statement.getQueryLog();
- if (logs.size() > 0 && shouldFetchMore) {
- allLogs = allLogs + "\n" + Joiner.on("\n").skipNulls().join(logs);
- HdfsUtil.putStringToFile(hdfsApi, logFile, allLogs);
- if(!statement.hasMoreLogs()) {
- shouldFetchMore = false;
- }
- } else {
- // Cancel the timer only when log fetching has been started
- if(!shouldFetchMore) {
- moreLogsScheduler.cancel();
- parent.tell(new LogAggregationFinished(), ActorRef.noSender());
- }
- }
- }
-
- @Override
- public void postStop() throws Exception {
- if (moreLogsScheduler != null && !moreLogsScheduler.isCancelled()) {
- moreLogsScheduler.cancel();
- }
-
- }
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/OperationController.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/OperationController.java
deleted file mode 100644
index c8c8a6c..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/OperationController.java
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * 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.Props;
-import com.google.common.base.Optional;
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.hive2.ConnectionDelegate;
-import org.apache.ambari.view.hive2.actor.message.Connect;
-import org.apache.ambari.view.hive2.actor.message.ExecuteJob;
-import org.apache.ambari.view.hive2.actor.message.FetchError;
-import org.apache.ambari.view.hive2.actor.message.FetchResult;
-import org.apache.ambari.view.hive2.actor.message.HiveJob;
-import org.apache.ambari.view.hive2.actor.message.HiveMessage;
-import org.apache.ambari.view.hive2.actor.message.JobRejected;
-import org.apache.ambari.view.hive2.actor.message.RegisterActor;
-import org.apache.ambari.view.hive2.actor.message.SQLStatementJob;
-import org.apache.ambari.view.hive2.actor.message.job.CancelJob;
-import org.apache.ambari.view.hive2.actor.message.job.FetchFailed;
-import org.apache.ambari.view.hive2.actor.message.job.SaveDagInformation;
-import org.apache.ambari.view.hive2.actor.message.lifecycle.DestroyConnector;
-import org.apache.ambari.view.hive2.actor.message.lifecycle.FreeConnector;
-import org.apache.ambari.view.hive2.internal.ContextSupplier;
-import org.apache.ambari.view.hive2.persistence.Storage;
-import org.apache.ambari.view.hive2.utils.LoggingOutputStream;
-import org.apache.ambari.view.utils.hdfs.HdfsApi;
-import org.apache.commons.collections4.MapUtils;
-import org.apache.commons.collections4.map.HashedMap;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Queue;
-import java.util.Set;
-import java.util.UUID;
-
-/**
- * Router actor to control the operations. This delegates the operations to underlying child actors and
- * store the state for them.
- */
-public class OperationController extends HiveActor {
-
- private static final Logger LOG = LoggerFactory.getLogger(OperationController.class);
-
- private final ActorSystem system;
- private final ActorRef deathWatch;
- private final ContextSupplier<ConnectionDelegate> connectionSupplier;
- private final ContextSupplier<Storage> storageSupplier;
- private final ContextSupplier<Optional<HdfsApi>> hdfsApiSupplier;
-
- /**
- * Store the connection per user which are currently not working
- */
- private final Map<String, Queue<ActorRef>> asyncAvailableConnections;
-
- /**
- * Store the connection per user which are currently not working
- */
- private final Map<String, Queue<ActorRef>> syncAvailableConnections;
-
-
- /**
- * Store the connection per user/per job which are currently working.
- */
- private final Map<String, Map<String, ActorRef>> asyncBusyConnections;
-
- /**
- * Store the connection per user which will be used to execute sync jobs
- * like fetching databases, tables etc.
- */
- private final Map<String, Set<ActorRef>> syncBusyConnections;
-
-
- private final ViewContext context;
-
- public OperationController(ActorSystem system,
- ActorRef deathWatch,
- ViewContext context,
- ContextSupplier<ConnectionDelegate> connectionSupplier,
- ContextSupplier<Storage> storageSupplier,
- ContextSupplier<Optional<HdfsApi>> hdfsApiSupplier) {
- this.system = system;
- this.deathWatch = deathWatch;
- this.context = context;
- this.connectionSupplier = connectionSupplier;
- this.storageSupplier = storageSupplier;
- this.hdfsApiSupplier = hdfsApiSupplier;
- this.asyncAvailableConnections = new HashMap<>();
- this.syncAvailableConnections = new HashMap<>();
- this.asyncBusyConnections = new HashedMap<>();
- this.syncBusyConnections = new HashMap<>();
- }
-
- @Override
- public void handleMessage(HiveMessage hiveMessage) {
- Object message = hiveMessage.getMessage();
-
- if (message instanceof ExecuteJob) {
- ExecuteJob job = (ExecuteJob) message;
- if (job.getJob().getType() == HiveJob.Type.ASYNC) {
- sendJob(job.getConnect(), (SQLStatementJob) job.getJob());
- } else if (job.getJob().getType() == HiveJob.Type.SYNC) {
- sendSyncJob(job.getConnect(), job.getJob());
- }
- }
-
- if (message instanceof CancelJob) {
- cancelJob((CancelJob) message);
- }
-
- if (message instanceof FetchResult) {
- fetchResultActorRef((FetchResult) message);
- }
-
- if (message instanceof FetchError) {
- fetchError((FetchError) message);
- }
-
- if (message instanceof FreeConnector) {
- freeConnector((FreeConnector) message);
- }
-
- if (message instanceof DestroyConnector) {
- destroyConnector((DestroyConnector) message);
- }
-
- if (message instanceof SaveDagInformation) {
- saveDagInformation((SaveDagInformation) message);
- }
- }
-
- private void cancelJob(CancelJob message) {
- String jobId = message.getJobId();
- String username = message.getUsername();
- ActorRef actorRef = asyncBusyConnections.get(username).get(jobId);
- if (actorRef != null) {
- actorRef.tell(message, sender());
- } else {
- String msg = String.format("Cannot cancel job. Job with id: %s for instance: %s has either not started or has expired.", message.getJobId(), context.getInstanceName());
- LOG.error(msg);
- sender().tell(new FetchFailed(msg), self());
- }
- }
-
- private void saveDagInformation(SaveDagInformation message) {
- ActorRef jdbcConnection = asyncBusyConnections.get(context.getUsername()).get(message.getJobId());
- if(jdbcConnection != null) {
- jdbcConnection.tell(message, sender());
- } else {
- String msg = String.format("Cannot update Dag Information for job. Job with id: %s for instance: %s has either not started or has expired.", message.getJobId(), context.getInstanceName());
- LOG.error(msg);
- }
- }
-
- private void fetchError(FetchError message) {
- String jobId = message.getJobId();
- String username = message.getUsername();
- ActorRef actorRef = asyncBusyConnections.get(username).get(jobId);
- if (actorRef != null) {
- actorRef.tell(message, sender());
- } else {
- String msg = String.format("Cannot fetch error for job. Job with id: %s for instance: %s has either not started or has expired.", message.getJobId(), context.getInstanceName());
- LOG.error(msg);
- sender().tell(new FetchFailed(msg), self());
- }
- }
-
- private void fetchResultActorRef(FetchResult message) {
- String username = message.getUsername();
- String jobId = message.getJobId();
- ActorRef actorRef = asyncBusyConnections.get(username).get(jobId);
- if (actorRef != null) {
- actorRef.tell(message, sender());
- } else {
- String msg = String.format("Cannot fetch result for job. Job with id: %s for instance: %s has either not started or has expired.", message.getJobId(), context.getInstanceName());
- LOG.error(msg);
- sender().tell(new FetchFailed(msg), self());
- }
- }
-
- private void sendJob(Connect connect, SQLStatementJob job) {
- String username = job.getUsername();
- String jobId = job.getJobId().get();
- ActorRef subActor = null;
- // Check if there is available actors to process this
- subActor = getActorRefFromAsyncPool(username);
- if (subActor == null) {
- Optional<HdfsApi> hdfsApiOptional = hdfsApiSupplier.get(context);
- if (!hdfsApiOptional.isPresent()) {
- sender().tell(new JobRejected(username, jobId, "Failed to connect to Hive."), self());
- return;
- }
- HdfsApi hdfsApi = hdfsApiOptional.get();
-
- subActor = system.actorOf(
- Props.create(JdbcConnector.class, context, self(),
- deathWatch, hdfsApi, connectionSupplier.get(context),
- storageSupplier.get(context)).withDispatcher("akka.actor.jdbc-connector-dispatcher"),
- UUID.randomUUID().toString() + ":asyncjdbcConnector");
- deathWatch.tell(new RegisterActor(subActor), self());
- }
-
- if (asyncBusyConnections.containsKey(username)) {
- Map<String, ActorRef> actors = asyncBusyConnections.get(username);
- if (!actors.containsKey(jobId)) {
- actors.put(jobId, subActor);
- } else {
- // Reject this as with the same jobId one connection is already in progress.
- sender().tell(new JobRejected(username, jobId, "Existing job in progress with same jobId."), ActorRef.noSender());
- }
- } else {
- Map<String, ActorRef> actors = new HashMap<>();
- actors.put(jobId, subActor);
- asyncBusyConnections.put(username, actors);
- }
-
- // set up the connect with ExecuteJob id for terminations
- subActor.tell(connect, self());
- subActor.tell(job, self());
-
- }
-
- private ActorRef getActorRefFromSyncPool(String username) {
- return getActorRefFromPool(syncAvailableConnections, username);
- }
-
- private ActorRef getActorRefFromAsyncPool(String username) {
- return getActorRefFromPool(asyncAvailableConnections, username);
- }
-
- private ActorRef getActorRefFromPool(Map<String, Queue<ActorRef>> pool, String username) {
- ActorRef subActor = null;
- if (pool.containsKey(username)) {
- Queue<ActorRef> availableActors = pool.get(username);
- if (availableActors.size() != 0) {
- subActor = availableActors.poll();
- }
- } else {
- pool.put(username, new LinkedList<ActorRef>());
- }
- return subActor;
- }
-
- private void sendSyncJob(Connect connect, HiveJob job) {
- String username = job.getUsername();
- ActorRef subActor = null;
- // Check if there is available actors to process this
- subActor = getActorRefFromSyncPool(username);
-
- if (subActor == null) {
- Optional<HdfsApi> hdfsApiOptional = hdfsApiSupplier.get(context);
- if (!hdfsApiOptional.isPresent()) {
- sender().tell(new JobRejected(username, ExecuteJob.SYNC_JOB_MARKER, "Failed to connect to HDFS."), ActorRef.noSender());
- return;
- }
- HdfsApi hdfsApi = hdfsApiOptional.get();
-
- subActor = system.actorOf(
- Props.create(JdbcConnector.class, context, self(),
- deathWatch, hdfsApi, connectionSupplier.get(context),
- storageSupplier.get(context)).withDispatcher("akka.actor.jdbc-connector-dispatcher"),
- UUID.randomUUID().toString() + ":syncjdbcConnector");
- deathWatch.tell(new RegisterActor(subActor), self());
- }
-
- if (syncBusyConnections.containsKey(username)) {
- Set<ActorRef> actors = syncBusyConnections.get(username);
- actors.add(subActor);
- } else {
- LinkedHashSet<ActorRef> actors = new LinkedHashSet<>();
- actors.add(subActor);
- syncBusyConnections.put(username, actors);
- }
-
- // Termination requires that the ref is known in case of sync jobs
- subActor.tell(connect, sender());
- subActor.tell(job, sender());
- }
-
-
- private void destroyConnector(DestroyConnector message) {
- ActorRef sender = getSender();
- if (message.isForAsync()) {
- removeFromAsyncBusyPool(message.getUsername(), message.getJobId());
- removeFromASyncAvailable(message.getUsername(), sender);
- } else {
- removeFromSyncBusyPool(message.getUsername(), sender);
- removeFromSyncAvailable(message.getUsername(), sender);
- }
- logMaps();
- }
-
- private void freeConnector(FreeConnector message) {
- ActorRef sender = getSender();
- if (message.isForAsync()) {
- LOG.info("About to free connector for job {} and user {}", message.getJobId(), message.getUsername());
- Optional<ActorRef> refOptional = removeFromAsyncBusyPool(message.getUsername(), message.getJobId());
- if (refOptional.isPresent()) {
- addToAsyncAvailable(message.getUsername(), refOptional.get());
- }
- return;
- }
-
- // Was a sync job, remove from sync pool
- LOG.info("About to free sync connector for user {}", message.getUsername());
- Optional<ActorRef> refOptional = removeFromSyncBusyPool(message.getUsername(), sender);
- if (refOptional.isPresent()) {
- addToSyncAvailable(message.getUsername(), refOptional.get());
- }
-
-
- logMaps();
-
- }
-
- private void logMaps() {
- LOG.debug("Pool status");
- LoggingOutputStream out = new LoggingOutputStream(LOG, LoggingOutputStream.LogLevel.DEBUG);
- MapUtils.debugPrint(new PrintStream(out), "Busy Async connections", asyncBusyConnections);
- MapUtils.debugPrint(new PrintStream(out), "Available Async connections", asyncAvailableConnections);
- MapUtils.debugPrint(new PrintStream(out), "Busy Sync connections", syncBusyConnections);
- MapUtils.debugPrint(new PrintStream(out), "Available Sync connections", syncAvailableConnections);
- try {
- out.close();
- } catch (IOException e) {
- LOG.warn("Cannot close Logging output stream, this may lead to leaks");
- }
- }
-
- private Optional<ActorRef> removeFromSyncBusyPool(String userName, ActorRef refToFree) {
- if (syncBusyConnections.containsKey(userName)) {
- Set<ActorRef> actorRefs = syncBusyConnections.get(userName);
- actorRefs.remove(refToFree);
- }
- return Optional.of(refToFree);
- }
-
- private Optional<ActorRef> removeFromAsyncBusyPool(String username, String jobId) {
- ActorRef ref = null;
- if (asyncBusyConnections.containsKey(username)) {
- Map<String, ActorRef> actors = asyncBusyConnections.get(username);
- if (actors.containsKey(jobId)) {
- ref = actors.get(jobId);
- actors.remove(jobId);
- }
- }
- return Optional.fromNullable(ref);
- }
-
- private void addToAsyncAvailable(String username, ActorRef actor) {
- addToAvailable(asyncAvailableConnections, username, actor);
- }
-
- private void addToSyncAvailable(String username, ActorRef actor) {
- addToAvailable(syncAvailableConnections, username, actor);
- }
-
- private void addToAvailable(Map<String, Queue<ActorRef>> pool, String username, ActorRef actor) {
- if (!pool.containsKey(username)) {
- pool.put(username, new LinkedList<ActorRef>());
- }
-
- Queue<ActorRef> availableActors = pool.get(username);
- availableActors.add(actor);
- }
-
- private void removeFromASyncAvailable(String username, ActorRef sender) {
- removeFromAvailable(asyncAvailableConnections, username, sender);
- }
-
- private void removeFromSyncAvailable(String username, ActorRef sender) {
- removeFromAvailable(syncAvailableConnections, username, sender);
- }
-
- private void removeFromAvailable(Map<String, Queue<ActorRef>> pool, String username, ActorRef sender) {
- if (!pool.containsKey(username)) {
- return;
- }
- Queue<ActorRef> actors = pool.get(username);
- actors.remove(sender);
- }
-
-}
-
-
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java
deleted file mode 100644
index 5a2eed8..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/ResultSetIterator.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * 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 com.google.common.collect.Lists;
-import org.apache.ambari.view.hive2.actor.message.CursorReset;
-import org.apache.ambari.view.hive2.actor.message.HiveMessage;
-import org.apache.ambari.view.hive2.actor.message.ResetCursor;
-import org.apache.ambari.view.hive2.actor.message.job.FetchFailed;
-import org.apache.ambari.view.hive2.actor.message.job.Next;
-import org.apache.ambari.view.hive2.actor.message.job.NoMoreItems;
-import org.apache.ambari.view.hive2.actor.message.job.Result;
-import org.apache.ambari.view.hive2.actor.message.lifecycle.CleanUp;
-import org.apache.ambari.view.hive2.actor.message.lifecycle.KeepAlive;
-import org.apache.ambari.view.hive2.client.ColumnDescription;
-import org.apache.ambari.view.hive2.client.ColumnDescriptionShort;
-import org.apache.ambari.view.hive2.client.Row;
-import org.apache.ambari.view.hive2.persistence.Storage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.util.List;
-
-public class ResultSetIterator extends HiveActor {
- private final Logger LOG = LoggerFactory.getLogger(getClass());
-
- private static final int DEFAULT_BATCH_SIZE = 100;
- public static final String NULL = "NULL";
-
- private final ActorRef parent;
- private final ResultSet resultSet;
- private final int batchSize;
-
- private List<ColumnDescription> columnDescriptions;
- private int columnCount;
- boolean async = false;
- private boolean metaDataFetched = false;
-
- public ResultSetIterator(ActorRef parent, ResultSet resultSet, int batchSize, boolean isAsync) {
- this.parent = parent;
- this.resultSet = resultSet;
- this.batchSize = batchSize;
- this.async = isAsync;
- }
-
- public ResultSetIterator(ActorRef parent, ResultSet resultSet) {
- this(parent, resultSet, DEFAULT_BATCH_SIZE, true);
- }
-
- public ResultSetIterator(ActorRef parent, ResultSet resultSet, boolean isAsync) {
- this(parent, resultSet, DEFAULT_BATCH_SIZE, isAsync);
- }
-
- @Override
- public void handleMessage(HiveMessage hiveMessage) {
- sendKeepAlive();
- Object message = hiveMessage.getMessage();
- if (message instanceof Next) {
- getNext();
- }
- if (message instanceof ResetCursor) {
- resetResultSet();
- }
-
- if (message instanceof KeepAlive) {
- sendKeepAlive();
- }
- }
-
- private void resetResultSet() {
- try {
- resultSet.beforeFirst();
- sender().tell(new CursorReset(), self());
- } catch (SQLException e) {
- LOG.error("Failed to reset the cursor", e);
- sender().tell(new FetchFailed("Failed to reset the cursor", e), self());
- cleanUpResources();
- }
- }
-
- private void sendKeepAlive() {
- LOG.debug("Sending a keep alive to {}", parent);
- parent.tell(new KeepAlive(), self());
- }
-
- private void getNext() {
- List<Row> rows = Lists.newArrayList();
- if (!metaDataFetched) {
- try {
- initialize();
- } catch (SQLException ex) {
- LOG.error("Failed to fetch metadata for the ResultSet", ex);
- sender().tell(new FetchFailed("Failed to get metadata for ResultSet", ex), self());
- cleanUpResources();
- }
- }
- int index = 0;
- try {
- // check batchsize first becaue resultSet.next() fetches the new row as well before returning true/false.
- while (index < batchSize && resultSet.next()) {
- index++;
- rows.add(getRowFromResultSet(resultSet));
- }
-
- if (index == 0) {
- // We have hit end of resultSet
- sender().tell(new NoMoreItems(columnDescriptions), self());
- if(!async) {
- cleanUpResources();
- }
- } else {
- Result result = new Result(rows, columnDescriptions);
- sender().tell(result, self());
- }
-
- } catch (SQLException ex) {
- LOG.error("Failed to fetch next batch for the Resultset", ex);
- sender().tell(new FetchFailed("Failed to fetch next batch for the Resultset", ex), self());
- cleanUpResources();
- }
- }
-
- private void cleanUpResources() {
- parent.tell(new CleanUp(), self());
- }
-
- private Row getRowFromResultSet(ResultSet resultSet) throws SQLException {
- Object[] values = new Object[columnCount];
- for (int i = 0; i < columnCount; i++) {
- values[i] = resultSet.getObject(i + 1);
- }
- return new Row(values);
- }
-
- private void initialize() throws SQLException {
- metaDataFetched = true;
- ResultSetMetaData metaData = resultSet.getMetaData();
- columnCount = metaData.getColumnCount();
- columnDescriptions = Lists.newArrayList();
- for (int i = 1; i <= columnCount; i++) {
- String columnName = metaData.getColumnName(i);
- String typeName = metaData.getColumnTypeName(i);
- ColumnDescription description = new ColumnDescriptionShort(columnName, typeName, i);
- columnDescriptions.add(description);
- }
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/StatementExecutor.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/StatementExecutor.java
deleted file mode 100644
index 6cdee81..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/StatementExecutor.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * 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.Props;
-import com.google.common.base.Optional;
-import org.apache.ambari.view.hive2.ConnectionDelegate;
-import org.apache.ambari.view.hive2.actor.message.GetColumnMetadataJob;
-import org.apache.ambari.view.hive2.actor.message.HiveMessage;
-import org.apache.ambari.view.hive2.actor.message.ResultInformation;
-import org.apache.ambari.view.hive2.actor.message.RunStatement;
-import org.apache.ambari.view.hive2.actor.message.StartLogAggregation;
-import org.apache.ambari.view.hive2.actor.message.job.Failure;
-import org.apache.ambari.view.hive2.actor.message.job.UpdateYarnAtsGuid;
-import org.apache.ambari.view.hive2.persistence.Storage;
-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 java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.UUID;
-
-/**
- * Executes a single statement and returns the ResultSet if the statements generates ResultSet.
- * Also, starts logAggregation and YarnAtsGuidFetcher if they are required.
- */
-public class StatementExecutor extends HiveActor {
-
- private final Logger LOG = LoggerFactory.getLogger(getClass());
-
- private final HdfsApi hdfsApi;
- private final HiveConnection connection;
- protected final Storage storage;
- private final ConnectionDelegate connectionDelegate;
- private ActorRef logAggregator;
- private ActorRef guidFetcher;
-
-
- public StatementExecutor(HdfsApi hdfsApi, Storage storage, HiveConnection connection, ConnectionDelegate connectionDelegate) {
- this.hdfsApi = hdfsApi;
- this.storage = storage;
- this.connection = connection;
- this.connectionDelegate = connectionDelegate;
- }
-
- @Override
- public void handleMessage(HiveMessage hiveMessage) {
- Object message = hiveMessage.getMessage();
- if (message instanceof RunStatement) {
- runStatement((RunStatement) message);
- } else if (message instanceof GetColumnMetadataJob) {
- getColumnMetaData((GetColumnMetadataJob) message);
- }
- }
-
- private void runStatement(RunStatement message) {
- try {
- HiveStatement statement = connectionDelegate.createStatement(connection);
- if (message.shouldStartLogAggregation()) {
- startLogAggregation(statement, message.getStatement(), message.getLogFile().get());
- }
-
- if (message.shouldStartGUIDFetch() && message.getJobId().isPresent()) {
- startGUIDFetch(message.getId(), statement, message.getJobId().get());
- }
- LOG.info("Statement executor is executing statement: {}, Statement id: {}, JobId: {}", message.getStatement(), message.getId(), message.getJobId().or("SYNC JOB"));
- Optional<ResultSet> resultSetOptional = connectionDelegate.execute(message.getStatement());
- LOG.info("Finished executing statement: {}, Statement id: {}, JobId: {}", message.getStatement(), message.getId(), message.getJobId().or("SYNC JOB"));
-
- if (resultSetOptional.isPresent()) {
- sender().tell(new ResultInformation(message.getId(), resultSetOptional.get()), self());
- } else {
- sender().tell(new ResultInformation(message.getId()), self());
- }
- } catch (SQLException e) {
- LOG.error("Failed to execute statement: {}. {}", message.getStatement(), e);
- sender().tell(new ResultInformation(message.getId(), new Failure("Failed to execute statement: " + message.getStatement(), e)), self());
- } finally {
- stopGUIDFetch();
- }
- }
-
- private void startGUIDFetch(int statementId, HiveStatement statement, String jobId) {
- if (guidFetcher == null) {
- guidFetcher = getContext().actorOf(Props.create(YarnAtsGUIDFetcher.class, sender())
- .withDispatcher("akka.actor.misc-dispatcher"), "YarnAtsGUIDFetcher:" + UUID.randomUUID().toString());
- }
- LOG.info("Fetching guid for Job Id: {}", jobId);
- guidFetcher.tell(new UpdateYarnAtsGuid(statementId, statement, jobId), self());
- }
-
- private void stopGUIDFetch() {
- if (guidFetcher != null) {
- getContext().stop(guidFetcher);
- }
- guidFetcher = null;
- }
-
- private void startLogAggregation(HiveStatement statement, String sqlStatement, String logFile) {
- if (logAggregator == null) {
- logAggregator = getContext().actorOf(
- Props.create(LogAggregator.class, hdfsApi, logFile)
- .withDispatcher("akka.actor.misc-dispatcher"), "LogAggregator:" + UUID.randomUUID().toString());
- }
- LOG.info("Fetching query logs for statement: {}", sqlStatement);
- logAggregator.tell(new StartLogAggregation(sqlStatement, statement), getSelf());
- }
-
- private void stopLogAggregation() {
- if (logAggregator != null) {
- getContext().stop(logAggregator);
- }
- logAggregator = null;
- }
-
- @Override
- public void postStop() throws Exception {
- stopLogAggregation();
- }
-
- private void getColumnMetaData(GetColumnMetadataJob message) {
- try {
- ResultSet resultSet = connectionDelegate.getColumnMetadata(connection, message);
- sender().tell(new ResultInformation(-1, resultSet), self());
- } catch (SQLException e) {
- LOG.error("Failed to get column metadata for databasePattern: {}, tablePattern: {}, ColumnPattern {}. {}",
- message.getSchemaPattern(), message.getTablePattern(), message.getColumnPattern(), e);
- sender().tell(new ResultInformation(-1,
- new Failure("Failed to get column metadata for databasePattern: " + message.getSchemaPattern() +
- ", tablePattern: " + message.getTablePattern() + ", ColumnPattern: " + message.getColumnPattern(), e)), self());
- }
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/YarnAtsGUIDFetcher.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/YarnAtsGUIDFetcher.java
deleted file mode 100644
index e6c8084..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/YarnAtsGUIDFetcher.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.HiveMessage;
-import org.apache.ambari.view.hive2.actor.message.job.SaveGuidToDB;
-import org.apache.ambari.view.hive2.actor.message.job.UpdateYarnAtsGuid;
-import org.apache.hive.jdbc.HiveStatement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import scala.concurrent.duration.Duration;
-
-import java.util.concurrent.TimeUnit;
-
-
-/**
- * Queries YARN/ATS time to time to fetch the status of the ExecuteJob and updates database
- */
-public class YarnAtsGUIDFetcher extends HiveActor {
-
- private final Logger LOG = LoggerFactory.getLogger(getClass());
-
- private final ActorRef jdbcConnectorActor;
-
- public YarnAtsGUIDFetcher(ActorRef jdbcConnectorActor) {
- this.jdbcConnectorActor = jdbcConnectorActor;
- }
-
- @Override
- public void handleMessage(HiveMessage hiveMessage) {
- Object message = hiveMessage.getMessage();
- if(message instanceof UpdateYarnAtsGuid) {
- updateGuid((UpdateYarnAtsGuid) message);
- }
- }
-
- private void updateGuid(UpdateYarnAtsGuid message) {
- HiveStatement statement = message.getStatement();
- String jobId = message.getJobId();
- String yarnAtsGuid = statement.getYarnATSGuid();
-
- LOG.info("Fetched guid: {}, for job id: {}", yarnAtsGuid, jobId);
-
- // If ATS GUID is not yet generated, we will retry after 1 second
- if(yarnAtsGuid == null) {
- LOG.info("Retrying to fetch guid");
- getContext().system().scheduler()
- .scheduleOnce(Duration.create(1, TimeUnit.SECONDS), getSelf(), message, getContext().dispatcher(), null);
- } else {
- jdbcConnectorActor.tell(new SaveGuidToDB(message.getStatementId(), yarnAtsGuid, jobId), self());
- LOG.info("Message send to save GUID for Statement Id: {}, Job id: {}, Guid: {}", message.getStatementId(), message.getJobId(), yarnAtsGuid);
- }
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/Connect.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/Connect.java
deleted file mode 100644
index 360125b..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/Connect.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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.message;
-
-import com.google.common.base.Optional;
-import org.apache.ambari.view.hive2.AuthParams;
-import org.apache.ambari.view.hive2.internal.Connectable;
-import org.apache.ambari.view.hive2.internal.HiveConnectionWrapper;
-
-/**
- * Connect message to be sent to the Connection Actor with the connection parameters
- */
-public class Connect {
-
- private final HiveJob.Type type;
- private final String jobId;
- private final String username;
- private final String password;
- private final String jdbcUrl;
-
-
- private Connect(HiveJob.Type type, String jobId, String username, String password, String jdbcUrl) {
- this.type = type;
- this.jobId = jobId;
- this.username = username;
- this.password = password;
- this.jdbcUrl = jdbcUrl;
- }
-
- public Connect(String jobId, String username, String password, String jdbcUrl) {
- this(HiveJob.Type.ASYNC, jobId, username, password, jdbcUrl);
- }
-
- public Connect(String username, String password, String jdbcUrl) {
- this(HiveJob.Type.SYNC, null, username, password, jdbcUrl);
- }
-
- public Connectable getConnectable(AuthParams authParams){
- return new HiveConnectionWrapper(getJdbcUrl(),username,password, authParams);
- }
-
- public String getUsername() {
- return username;
- }
-
- public String getPassword() {
- return password;
- }
-
- public String getJdbcUrl() {
- return jdbcUrl;
- }
-
- public HiveJob.Type getType() {
- return type;
- }
-
- public Optional<String> getJobId() {
- return Optional.fromNullable(jobId);
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/CursorReset.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/CursorReset.java
deleted file mode 100644
index d805754..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/CursorReset.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.message;
-
-public class CursorReset {
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ExecuteJob.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ExecuteJob.java
deleted file mode 100644
index d4d8a1b..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ExecuteJob.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.message;
-
-public class ExecuteJob {
- public final static String SYNC_JOB_MARKER = "SYNC";
- private final Connect connect;
- private final HiveJob job;
-
- public ExecuteJob(Connect connect, HiveJob job) {
- this.connect = connect;
- this.job = job;
- }
-
- public Connect getConnect() {
- return connect;
- }
-
- public HiveJob getJob() {
- return job;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ExecuteQuery.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ExecuteQuery.java
deleted file mode 100644
index b3d1599..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ExecuteQuery.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.message;
-
-public class ExecuteQuery {
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/FetchError.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/FetchError.java
deleted file mode 100644
index c78dc43..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/FetchError.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.message;
-
-/**
- *
- * Fetch the result for
- *
- */
-public class FetchError {
- private final String jobId;
- private final String username;
-
- public FetchError(String jobId, String username) {
- this.jobId = jobId;
- this.username = username;
- }
-
- public String getJobId() {
- return jobId;
- }
-
- public String getUsername() {
- return username;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/FetchResult.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/FetchResult.java
deleted file mode 100644
index 6b2ac42..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/FetchResult.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.message;
-
-/**
- *
- * Fetch the result for
- *
- */
-public class FetchResult {
- private final String jobId;
- private final String username;
-
- public FetchResult(String jobId, String username) {
- this.jobId = jobId;
- this.username = username;
- }
-
- public String getJobId() {
- return jobId;
- }
-
- public String getUsername() {
- return username;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/GetColumnMetadataJob.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/GetColumnMetadataJob.java
deleted file mode 100644
index 9d2e9cc..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/GetColumnMetadataJob.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.message;
-
-public class GetColumnMetadataJob extends HiveJob {
- private final String schemaPattern;
- private final String tablePattern;
- private final String columnPattern;
-
- public GetColumnMetadataJob(String username,
- String schemaPattern, String tablePattern, String columnPattern) {
- super(Type.SYNC, username);
- this.schemaPattern = schemaPattern;
- this.tablePattern = tablePattern;
- this.columnPattern = columnPattern;
- }
-
- public GetColumnMetadataJob(String username,
- String tablePattern, String columnPattern) {
- this(username, "*", tablePattern, columnPattern);
- }
-
- public GetColumnMetadataJob(String username,
- String columnPattern) {
- this(username, "*", "*", columnPattern);
- }
-
- public GetColumnMetadataJob(String username) {
- this(username, "*", "*", "*");
- }
-
- public String getSchemaPattern() {
- return schemaPattern;
- }
-
- public String getTablePattern() {
- return tablePattern;
- }
-
- public String getColumnPattern() {
- return columnPattern;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/GetMoreLogs.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/GetMoreLogs.java
deleted file mode 100644
index 6e084ee..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/GetMoreLogs.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.message;
-
-
-public class GetMoreLogs {}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/HiveJob.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/HiveJob.java
deleted file mode 100644
index 74400e2..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/HiveJob.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.message;
-
-public abstract class HiveJob {
-
- private final String username;
- private final Type type;
-
- public HiveJob(Type type, String username) {
- this.type = type;
- this.username = username;
- }
-
- public String getUsername() {
- return username;
- }
-
-
-
-
- public Type getType() {
- return type;
- }
-
-
- public enum Type {
- SYNC,
- ASYNC
- }
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/HiveMessage.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/HiveMessage.java
deleted file mode 100644
index 28533c7..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/HiveMessage.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.message;
-
-
-import java.util.UUID;
-
-/**
- * Message wrapper, Each message has a unique ID
- */
-public class HiveMessage {
-
- private String id = UUID.randomUUID().toString();
-
- private Object message;
-
- public HiveMessage(Object message) {
- this.message = message;
- }
-
-
- public Object getMessage() {
- return message;
- }
-
- public String getId() {
- return id;
- }
-
- @Override
- public String toString() {
- return "HiveMessage{" +
- "message=" + message +
- ", id='" + id + '\'' +
- '}';
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/JobRejected.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/JobRejected.java
deleted file mode 100644
index 4f9aab8..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/JobRejected.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.message;
-
-public class JobRejected {
-
- private final String username;
- private final String jobId;
- private final String message;
-
- public JobRejected(String username, String jobId, String message) {
- this.username = username;
- this.jobId = jobId;
- this.message = message;
- }
-
- public String getUsername() {
- return username;
- }
-
- public String getJobId() {
- return jobId;
- }
-
- public String getMessage() {
- return message;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/JobSubmitted.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/JobSubmitted.java
deleted file mode 100644
index bc8df2a..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/JobSubmitted.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.message;
-
-public class JobSubmitted {
-
- private final String username;
- private final String jobId;
-
- public JobSubmitted(String username, String jobId) {
- this.username = username;
- this.jobId = jobId;
- }
-
- public String getUsername() {
- return username;
- }
-
- public String getJobId() {
- return jobId;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/LogAggregationFinished.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/LogAggregationFinished.java
deleted file mode 100644
index bfe37b5..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/LogAggregationFinished.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.message;
-
-public class LogAggregationFinished {}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/RegisterActor.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/RegisterActor.java
deleted file mode 100644
index 9988252..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/RegisterActor.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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.message;
-
-import akka.actor.ActorRef;
-
-public class RegisterActor {
-
- private ActorRef actorRef;
-
- public RegisterActor(ActorRef actorRef) {
- this.actorRef = actorRef;
- }
-
- public ActorRef getActorRef() {
- return actorRef;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ResetCursor.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ResetCursor.java
deleted file mode 100644
index 53276d3..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ResetCursor.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.message;
-
-public class ResetCursor {
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ResultInformation.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ResultInformation.java
deleted file mode 100644
index bf1d21e..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ResultInformation.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * 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.message;
-
-import com.google.common.base.Optional;
-import org.apache.ambari.view.hive2.actor.message.job.Failure;
-
-import java.sql.ResultSet;
-
-/**
- * Message used to send execution complete message.
- * It may contain a ResultSet if the execution returns a ResultSet.
- */
-public class ResultInformation {
- /**
- * Execution id to identify the result correspondence of the result with the request
- */
- private final int id;
-
- /**
- * If the execution returns a ResultSet then this will refer to the ResultSet
- */
- private final ResultSet resultSet;
-
- private final Failure failure;
-
- private final boolean cancelled;
-
- private ResultInformation(int id, ResultSet resultSet, Failure failure, boolean cancelled) {
- this.id = id;
- this.resultSet = resultSet;
- this.failure = failure;
- this.cancelled = cancelled;
- }
-
- public ResultInformation(int id, ResultSet resultSet) {
- this(id, resultSet, null, false);
- }
-
- public ResultInformation(int id) {
- this(id, null, null, false);
- }
-
- public ResultInformation(int id, Failure failure) {
- this(id, null, failure, false);
- }
-
- public ResultInformation(int id, boolean cancelled) {
- this(id, null, null, cancelled);
- }
-
- public int getId() {
- return id;
- }
-
- public Optional<ResultSet> getResultSet() {
- return Optional.fromNullable(resultSet);
- }
-
- public Optional<Failure> getFailure() {
- return Optional.fromNullable(failure);
- }
-
- public boolean isCancelled() {
- return cancelled;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ResultNotReady.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ResultNotReady.java
deleted file mode 100644
index 6678d68..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ResultNotReady.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.message;
-
-/**
- * In case of a async execution, this is used to tell that the result has not completed and is not ready to be
- * returned back
- */
-public class ResultNotReady {
- private final String jobId;
- private final String username;
- public ResultNotReady(String jobId, String username) {
- this.jobId = jobId;
- this.username = username;
- }
-
- public String getJobId() {
- return jobId;
- }
-
- public String getUsername() {
- return username;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ResultReady.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ResultReady.java
deleted file mode 100644
index cb54cbd..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/ResultReady.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.message;
-
-import akka.actor.ActorRef;
-import com.google.common.base.Optional;
-
-/**
- * Fetch the result for
- */
-public class ResultReady extends FetchResult {
- private final ActorRef result;
-
-
- public ResultReady(String jobId, String username, ActorRef result) {
- super(jobId, username);
- this.result = result;
- }
-
- public ResultReady(String jobId, String username) {
- this(jobId, username, null);
- }
-
- public Optional<ActorRef> getResult() {
- return Optional.fromNullable(result);
- }
-}
-
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/RunStatement.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/RunStatement.java
deleted file mode 100644
index 8679c44..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/RunStatement.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.message;
-
-import com.google.common.base.Optional;
-
-/**
- * Message sent by JdbcConnector to StatementExecutor to run a statement
- */
-public class RunStatement {
- /**
- * This is the execution id meant to identify the executing statement sequence
- */
- private final int id;
- private final String statement;
- private final String logFile;
- private final String jobId;
- private final boolean startLogAggregation;
- private final boolean startGUIDFetch;
-
- public RunStatement(int id, String statement, String jobId, boolean startLogAggregation, String logFile, boolean startGUIDFetch) {
- this.id = id;
- this.statement = statement;
- this.jobId = jobId;
- this.logFile = logFile;
- this.startLogAggregation = startLogAggregation;
- this.startGUIDFetch = startGUIDFetch;
- }
-
- public RunStatement(int id, String statement) {
- this(id, statement, null, false, null, false);
- }
-
- public int getId() {
- return id;
- }
-
- public String getStatement() {
- return statement;
- }
-
- public Optional<String> getLogFile() {
- return Optional.fromNullable(logFile);
- }
-
- public boolean shouldStartLogAggregation() {
- return startLogAggregation;
- }
-
- public boolean shouldStartGUIDFetch() {
- return startGUIDFetch;
- }
-
- public Optional<String> getJobId() {
- return Optional.fromNullable(jobId);
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/SQLStatementJob.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/SQLStatementJob.java
deleted file mode 100644
index 03483d0..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/SQLStatementJob.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.message;
-
-import com.google.common.base.Optional;
-import org.apache.ambari.view.ViewContext;
-import org.apache.commons.lang.StringUtils;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-
-public class SQLStatementJob extends HiveJob {
-
- public static final String SEMICOLON = ";";
- private String[] statements;
-
- private final String jobId;
- private final String logFile;
-
- public SQLStatementJob(Type type, String[] statements, String username, String jobId, String logFile) {
- super(type, username);
- this.statements = new String[statements.length];
- this.jobId = jobId;
- this.logFile = logFile;
- for (int i = 0; i < statements.length; i++) {
- this.statements[i] = clean(statements[i]);
- }
- }
- public SQLStatementJob(Type type, String[] statements, String username) {
- this(type, statements, username, null, null);
- }
-
- private String clean(String statement) {
- return StringUtils.trim(statement);
- }
-
- public Collection<String> getStatements() {
- return Arrays.asList(statements);
- }
-
- public Optional<String> getJobId() {
- return Optional.fromNullable(jobId);
- }
-
- public Optional<String> getLogFile() {
- return Optional.fromNullable(logFile);
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/StartLogAggregation.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/StartLogAggregation.java
deleted file mode 100644
index 48fbced..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/StartLogAggregation.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.message;
-
-import org.apache.hive.jdbc.HiveStatement;
-
-public class StartLogAggregation {
- private String statement;
- private HiveStatement hiveStatement;
-
- public StartLogAggregation() {
- }
-
- public StartLogAggregation(String statement, HiveStatement hiveStatement) {
- this.statement = statement;
- this.hiveStatement = hiveStatement;
- }
-
- public HiveStatement getHiveStatement() {
- return hiveStatement;
- }
-
- public String getStatement() {
- return statement;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/AsyncExecutionFailed.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/AsyncExecutionFailed.java
deleted file mode 100644
index 514d9cd..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/AsyncExecutionFailed.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.message.job;
-
-public class AsyncExecutionFailed extends ExecutionFailed {
- private final String jobId;
- private final String username;
-
- public AsyncExecutionFailed(String jobId,String username, String message, Throwable error) {
- super(message, error);
- this.jobId = jobId;
- this.username = username;
- }
-
- public AsyncExecutionFailed(String jobId,String username, String message) {
- super(message);
- this.jobId = jobId;
- this.username = username;
- }
-
-
-
- public String getJobId() {
- return jobId;
- }
-
- public String getUsername() {
- return username;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/CancelJob.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/CancelJob.java
deleted file mode 100644
index ddaff19..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/CancelJob.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.message.job;
-
-/**
- * Message to cancel the currently running job. This is used for stopping execution of a job from api
- */
-public class CancelJob {
- private final String jobId;
- private final String username;
-
- public CancelJob(String jobId, String username) {
- this.jobId = jobId;
- this.username = username;
- }
-
- public String getJobId() {
- return jobId;
- }
-
- public String getUsername() {
- return username;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/ExecuteNextStatement.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/ExecuteNextStatement.java
deleted file mode 100644
index ff40aab..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/ExecuteNextStatement.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.message.job;
-
-public class ExecuteNextStatement {
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/ExecutionFailed.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/ExecutionFailed.java
deleted file mode 100644
index dcbf79f..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/ExecutionFailed.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.message.job;
-
-public class ExecutionFailed extends Failure {
-
- public ExecutionFailed(String message, Throwable error) {
- super(message, error);
- }
-
- public ExecutionFailed(String message) {
- super(message, new Exception(message));
- }
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/Failure.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/Failure.java
deleted file mode 100644
index af1e69d..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/Failure.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.message.job;
-
-public class Failure {
- private final Throwable error;
- private final String message;
-
- public Failure(String message, Throwable error) {
- this.message = message;
- this.error = error;
- }
-
- public Throwable getError() {
- return error;
- }
-
- public String getMessage() {
- return message;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/FetchFailed.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/FetchFailed.java
deleted file mode 100644
index 10a2d4e..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/FetchFailed.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.message.job;
-
-public class FetchFailed extends Failure{
-
- public FetchFailed(String message, Throwable error) {
- super(message, error);
- }
-
- public FetchFailed(String message) {
- this(message, new Exception(message));
- }
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/Next.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/Next.java
deleted file mode 100644
index bfdc1ea..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/Next.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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.message.job;
-
-public class Next {
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoMoreItems.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoMoreItems.java
deleted file mode 100644
index 71a6e87..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoMoreItems.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.message.job;
-
-import java.util.List;
-
-import org.apache.ambari.view.hive2.client.ColumnDescription;
-
-public class NoMoreItems {
- private final List<ColumnDescription> columns;
-
- public NoMoreItems(List<ColumnDescription> columns) {
- this.columns = columns;
- }
-
- public List<ColumnDescription> getColumns() {
- return columns;
- }
-}
\ No newline at end of file
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoResult.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoResult.java
deleted file mode 100644
index 02833e6..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/NoResult.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.message.job;
-
-public class NoResult {}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/Result.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/Result.java
deleted file mode 100644
index df1d52e..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/Result.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.message.job;
-
-import com.google.common.collect.ImmutableList;
-import org.apache.ambari.view.hive2.client.ColumnDescription;
-import org.apache.ambari.view.hive2.client.Row;
-
-import java.util.List;
-
-public class Result {
- private final List<ColumnDescription> columns;
- private final List<Row> rows;
-
- public Result(List<Row> rows, List<ColumnDescription> columns) {
- this.rows = ImmutableList.copyOf(rows);
- this.columns = columns;
- }
-
- public List<Row> getRows() {
- return rows;
- }
-
- public List<ColumnDescription> getColumns() {
- return columns;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/ResultSetHolder.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/ResultSetHolder.java
deleted file mode 100644
index a54214f..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/ResultSetHolder.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.message.job;
-
-import akka.actor.ActorRef;
-
-public class ResultSetHolder {
- private final ActorRef iterator;
-
- public ResultSetHolder(ActorRef iterator) {
- this.iterator = iterator;
- }
-
- public ActorRef getIterator() {
- return iterator;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/SaveDagInformation.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/SaveDagInformation.java
deleted file mode 100644
index 187bb67..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/SaveDagInformation.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.message.job;
-
-/**
- * Message to save the Dag Information like the dagName, dagId and ApplicationId
- */
-public class SaveDagInformation {
- private final String jobId;
- private final String dagName;
- private final String dagId;
- private final String applicationId;
-
- public SaveDagInformation(String jobId, String dagName, String dagId, String applicationId) {
- this.jobId = jobId;
- this.dagName = dagName;
- this.dagId = dagId;
- this.applicationId = applicationId;
- }
-
- public String getJobId() {
- return jobId;
- }
-
- public String getDagName() {
- return dagName;
- }
-
- public String getDagId() {
- return dagId;
- }
-
- public String getApplicationId() {
- return applicationId;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/SaveGuidToDB.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/SaveGuidToDB.java
deleted file mode 100644
index c447d0b..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/SaveGuidToDB.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.message.job;
-
-/**
- * Message to ask JdbcConnector for job to update the GUID for the current statement in the database for the job.
- */
-public class SaveGuidToDB {
- private final int statementId;
- private final String guid;
- private final String jobId;
-
- public SaveGuidToDB(int statementId, String guid, String jobId) {
- this.statementId = statementId;
- this.guid = guid;
- this.jobId = jobId;
- }
-
- public int getStatementId() {
- return statementId;
- }
-
- public String getGuid() {
- return guid;
- }
-
- public String getJobId() {
- return jobId;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/UpdateYarnAtsGuid.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/UpdateYarnAtsGuid.java
deleted file mode 100644
index 1998a2a..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/job/UpdateYarnAtsGuid.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.message.job;
-
-import org.apache.hive.jdbc.HiveStatement;
-
-public class UpdateYarnAtsGuid {
- private final int statementId;
- private final HiveStatement statement;
- private final String jobId;
- public UpdateYarnAtsGuid(int statementId, HiveStatement statement, String jobId) {
- this.statementId = statementId;
- this.statement = statement;
- this.jobId = jobId;
- }
-
- public int getStatementId() {
- return statementId;
- }
-
- public HiveStatement getStatement() {
- return statement;
- }
-
- public String getJobId() {
- return jobId;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/CleanUp.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/CleanUp.java
deleted file mode 100644
index 33dce72..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/CleanUp.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.message.lifecycle;
-
-public class CleanUp {}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/DestroyConnector.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/DestroyConnector.java
deleted file mode 100644
index 29a56a2..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/DestroyConnector.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.message.lifecycle;
-
-public class DestroyConnector {
- private final String username;
- private final String jobId;
- private final boolean forAsync;
-
- public DestroyConnector(String username, String jobId, boolean forAsync) {
- this.username = username;
- this.jobId = jobId;
- this.forAsync = forAsync;
- }
-
- public String getUsername() {
- return username;
- }
-
- public String getJobId() {
- return jobId;
- }
-
- public boolean isForAsync() {
- return forAsync;
- }
-
- @Override
- public String toString() {
- return "DestroyConnector{" +
- "username='" + username + '\'' +
- ", jobId='" + jobId + '\'' +
- ", forAsync=" + forAsync +
- '}';
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/FreeConnector.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/FreeConnector.java
deleted file mode 100644
index bfd7b3b..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/FreeConnector.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.message.lifecycle;
-
-public class FreeConnector {
-
- private final String username;
- private final String jobId;
- private final boolean forAsync;
-
- public FreeConnector(String username, String jobId, boolean forAsync) {
- this.username = username;
- this.jobId = jobId;
- this.forAsync = forAsync;
- }
-
- public String getUsername() {
- return username;
- }
-
- public String getJobId() {
- return jobId;
- }
-
- public boolean isForAsync() {
- return forAsync;
- }
-
- @Override
- public String toString() {
- return "FreeConnector{" +
- "username='" + username + '\'' +
- ", jobId='" + jobId + '\'' +
- ", forAsync=" + forAsync +
- '}';
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/InactivityCheck.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/InactivityCheck.java
deleted file mode 100644
index ead3cb7..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/InactivityCheck.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.message.lifecycle;
-
-public class InactivityCheck {}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/KeepAlive.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/KeepAlive.java
deleted file mode 100644
index 565a6ae..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/KeepAlive.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.message.lifecycle;
-
-public class KeepAlive {}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/TerminateInactivityCheck.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/TerminateInactivityCheck.java
deleted file mode 100644
index 0096ced..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/actor/message/lifecycle/TerminateInactivityCheck.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.message.lifecycle;
-
-public class TerminateInactivityCheck {}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/backgroundjobs/BackgroundJobController.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/backgroundjobs/BackgroundJobController.java
deleted file mode 100644
index 72fb6b3..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/backgroundjobs/BackgroundJobController.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/**
- * 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.backgroundjobs;
-
-import org.apache.ambari.view.ViewContext;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class BackgroundJobController {
- private ViewContext context;
-
- protected BackgroundJobController(ViewContext context) {
- this.context = context;
- }
-
- private static Map<String, BackgroundJobController> viewSingletonObjects = new HashMap<String, BackgroundJobController>();
- public static BackgroundJobController getInstance(ViewContext context) {
- if (!viewSingletonObjects.containsKey(context.getInstanceName()))
- viewSingletonObjects.put(context.getInstanceName(), new BackgroundJobController(context));
- return viewSingletonObjects.get(context.getInstanceName());
- }
-
- private Map<String, BackgroundJob> jobs = new HashMap<String, BackgroundJob>();
- public void startJob(final String key, Runnable runnable) {
- if (jobs.containsKey(key)) {
- try {
- interrupt(key);
- jobs.get(key).getJobThread().join();
- } catch (InterruptedException ignored) {
- } catch (BackgroundJobException e) {
- }
- }
- Thread t = new Thread(runnable);
- t.setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
- @Override
- public void uncaughtException(Thread t, Throwable e) {
- if (e instanceof BackgroundJobException) {
- jobs.get(key).setJobException((BackgroundJobException) e);
- }
- }
- });
- jobs.put(key, new BackgroundJob(t));
- t.start();
- }
-
- public Thread.State state(String key) {
- if (!jobs.containsKey(key)) {
- return Thread.State.TERMINATED;
- }
-
- Thread.State state = jobs.get(key).getJobThread().getState();
-
- if (state == Thread.State.TERMINATED) {
- jobs.remove(key);
- }
-
- return state;
- }
-
- public boolean interrupt(String key) {
- if (!jobs.containsKey(key)) {
- return false;
- }
-
- jobs.get(key).getJobThread().interrupt();
- return true;
- }
-
- public boolean isInterrupted(String key) {
- if (state(key) == Thread.State.TERMINATED) {
- return true;
- }
-
- return jobs.get(key).getJobThread().isInterrupted();
- }
-
- class BackgroundJob {
-
- private Thread jobThread;
- private BackgroundJobException jobException;
-
- public BackgroundJob(Thread jobThread) {
- this.jobThread = jobThread;
- }
-
- public Thread getJobThread() {
- if(jobException != null) throw jobException;
- return jobThread;
- }
-
- public void setJobException(BackgroundJobException exception) {
- this.jobException = exception;
- }
- }
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/backgroundjobs/BackgroundJobException.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/backgroundjobs/BackgroundJobException.java
deleted file mode 100644
index 3830dda..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/backgroundjobs/BackgroundJobException.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * 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.backgroundjobs;
-
-public class BackgroundJobException extends RuntimeException {
-
- public BackgroundJobException(Throwable cause) {
- super(cause);
- }
-
- public BackgroundJobException(String message, Throwable cause) {
- super(message, cause);
- }
-}
\ No newline at end of file
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/AsyncJobRunner.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/AsyncJobRunner.java
deleted file mode 100644
index 421df8e..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/AsyncJobRunner.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.client;
-
-import com.google.common.base.Optional;
-import org.apache.ambari.view.hive2.actor.message.SQLStatementJob;
-import org.apache.ambari.view.hive2.actor.message.job.Failure;
-import org.apache.ambari.view.hive2.resources.jobs.viewJobs.Job;
-
-public interface AsyncJobRunner {
-
- void submitJob(ConnectionConfig connectionConfig, SQLStatementJob asyncJob, Job job);
-
- void cancelJob(String jobId, String username);
-
- Optional<NonPersistentCursor> getCursor(String jobId, String username);
-
- Optional<NonPersistentCursor> resetAndGetCursor(String jobId, String username);
-
- Optional<Failure> getError(String jobId, String username);
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/AsyncJobRunnerImpl.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/AsyncJobRunnerImpl.java
deleted file mode 100644
index 82e3df5..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/AsyncJobRunnerImpl.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * 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.client;
-
-import akka.actor.ActorRef;
-import akka.actor.ActorSystem;
-import akka.actor.Inbox;
-import com.google.common.base.Optional;
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.hive2.actor.message.Connect;
-import org.apache.ambari.view.hive2.actor.message.CursorReset;
-import org.apache.ambari.view.hive2.actor.message.ExecuteJob;
-import org.apache.ambari.view.hive2.actor.message.FetchError;
-import org.apache.ambari.view.hive2.actor.message.FetchResult;
-import org.apache.ambari.view.hive2.actor.message.ResetCursor;
-import org.apache.ambari.view.hive2.actor.message.ResultNotReady;
-import org.apache.ambari.view.hive2.actor.message.SQLStatementJob;
-import org.apache.ambari.view.hive2.actor.message.job.CancelJob;
-import org.apache.ambari.view.hive2.actor.message.job.Failure;
-import org.apache.ambari.view.hive2.actor.message.job.FetchFailed;
-import org.apache.ambari.view.hive2.internal.ConnectionException;
-import org.apache.ambari.view.hive2.resources.jobs.viewJobs.Job;
-import org.apache.ambari.view.hive2.utils.ResultFetchFormattedException;
-import org.apache.ambari.view.hive2.utils.ResultNotReadyFormattedException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import scala.concurrent.duration.Duration;
-
-import java.sql.SQLException;
-import java.util.concurrent.TimeUnit;
-
-public class AsyncJobRunnerImpl implements AsyncJobRunner {
-
- private final Logger LOG = LoggerFactory.getLogger(getClass());
-
- private final ActorRef controller;
- private final ActorSystem system;
- private final ViewContext context;
-
- public AsyncJobRunnerImpl(ViewContext context, ActorRef controller, ActorSystem system) {
- this.context = context;
- this.controller = controller;
- this.system = system;
- }
-
-
- @Override
- public void submitJob(ConnectionConfig config, SQLStatementJob job, Job jobp) {
- Connect connect = config.createConnectMessage(jobp.getId());
- ExecuteJob executeJob = new ExecuteJob(connect, job);
- controller.tell(executeJob, ActorRef.noSender());
- }
-
- @Override
- public void cancelJob(String jobId, String username) {
- controller.tell(new CancelJob(jobId, username), ActorRef.noSender());
- }
-
- @Override
- public Optional<NonPersistentCursor> getCursor(String jobId, String username) {
- Inbox inbox = Inbox.create(system);
- inbox.send(controller, new FetchResult(jobId, username));
- Object receive = inbox.receive(Duration.create(1, TimeUnit.MINUTES));
- if(receive instanceof ResultNotReady) {
- String errorString = "Result not ready for job: " + jobId + ", username: " + username + ". Try after sometime.";
- LOG.info(errorString);
- throw new ResultNotReadyFormattedException(errorString, new Exception(errorString));
- } else if(receive instanceof Failure) {
- Failure failure = (Failure) receive;
- throw new ResultFetchFormattedException(failure.getMessage(), failure.getError());
- } else {
- Optional<ActorRef> iterator = (Optional<ActorRef>) receive;
- if(iterator.isPresent()) {
- return Optional.of(new NonPersistentCursor(context, system, iterator.get()));
- } else {
- return Optional.absent();
- }
- }
- }
-
- @Override
- public Optional<NonPersistentCursor> resetAndGetCursor(String jobId, String username) {
- Inbox inbox = Inbox.create(system);
- inbox.send(controller, new FetchResult(jobId, username));
- Object receive = inbox.receive(Duration.create(1, TimeUnit.MINUTES));
- if(receive instanceof ResultNotReady) {
- String errorString = "Result not ready for job: " + jobId + ", username: " + username + ". Try after sometime.";
- LOG.info(errorString);
- throw new ResultNotReadyFormattedException(errorString, new Exception(errorString));
- } else if(receive instanceof Failure) {
- Failure failure = (Failure) receive;
- throw new ResultFetchFormattedException(failure.getMessage(), failure.getError());
- } else {
- Optional<ActorRef> iterator = (Optional<ActorRef>) receive;
- if(iterator.isPresent()) {
- inbox.send(iterator.get(), new ResetCursor());
- Object resetResult = inbox.receive(Duration.create(1, TimeUnit.MINUTES));
- if (resetResult instanceof CursorReset) {
- return Optional.of(new NonPersistentCursor(context, system, iterator.get()));
- } else {
- return Optional.absent();
- }
- } else {
- return Optional.absent();
- }
- }
- }
-
- @Override
- public Optional<Failure> getError(String jobId, String username) {
- Inbox inbox = Inbox.create(system);
- inbox.send(controller, new FetchError(jobId, username));
- Object receive = inbox.receive(Duration.create(1, TimeUnit.MINUTES));
- if(receive instanceof FetchFailed){
- FetchFailed fetchFailed = (FetchFailed) receive;
- return Optional.of(new Failure(fetchFailed.getMessage(), getExceptionForRetry()));
- }
- Optional<Failure> result = (Optional<Failure>) receive;
- return result;
- }
-
- private ConnectionException getExceptionForRetry() {
- return new ConnectionException(new SQLException("Cannot connect"),"Connection attempt failed, Please retry");
- }
-
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/ColumnDescription.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/ColumnDescription.java
deleted file mode 100644
index c8dead6..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/ColumnDescription.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * 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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.client;
-
-public interface ColumnDescription {
- enum DataTypes {
- TINYINT, //
- SMALLINT, //
- INT, //
- BIGINT, //
- BOOLEAN, //
- FLOAT, //
- DOUBLE, //
- STRING, //
- BINARY, // -- (Note: Available in Hive 0.8.0 and later)
- TIMESTAMP, // -- (Note: Available in Hive 0.8.0 and later)
- DECIMAL, // -- (Note: Available in Hive 0.11.0 and later)
- // DECIMAL,(precision, scale)Â -- (Note: Available in Hive 0.13.0 and later) Not included.
- DATE, // -- (Note: Available in Hive 0.12.0 and later)
- VARCHAR, // -- (Note: Available in Hive 0.12.0 and later)
- CHAR, // -- (Note: Available in Hive 0.13.0 and later)
- }
-
- String getName();
-
- String getType();
-
- int getPosition();
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/ColumnDescriptionExtended.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/ColumnDescriptionExtended.java
deleted file mode 100644
index b2f1e5e..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/ColumnDescriptionExtended.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * 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
- * <p>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p>
- * 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.client;
-
-public class ColumnDescriptionExtended implements ColumnDescription {
- private String name;
- private String type;
- private int position;
- private String comment;
- private boolean partitioned;
- private boolean sortedBy;
- private boolean clusteredBy;
-
- public ColumnDescriptionExtended(String name, String type, String comment, boolean partitioned,
- boolean sortedBy, boolean clusteredBy, int position) {
- this.name = name;
- this.type = type;
- this.comment = comment;
- this.partitioned = partitioned;
- this.sortedBy = sortedBy;
- this.clusteredBy = clusteredBy;
- this.position = position;
- }
-
- public ColumnDescription createShortColumnDescription() {
- return new ColumnDescriptionShort(getName(), getType(), getPosition());
- }
-
- public String getName() {
- return name;
- }
-
- public String getType() {
- return type;
- }
-
- public int getPosition() {
- return position;
- }
-
- public String getComment() {
- return comment;
- }
-
- public boolean isPartitioned() {
- return partitioned;
- }
-
- public boolean isSortedBy() {
- return sortedBy;
- }
-
- public boolean isClusteredBy() {
- return clusteredBy;
- }
-
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/ColumnDescriptionShort.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/ColumnDescriptionShort.java
deleted file mode 100644
index 928438c..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/ColumnDescriptionShort.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/**
- * 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.client;
-
-import java.util.ArrayList;
-
-public class ColumnDescriptionShort extends ArrayList<Object> implements ColumnDescription {
- private static final int INITIAL_CAPACITY = 3;
- private String name;
- private String type;
- private int position;
-
- public ColumnDescriptionShort(String name, String type, int position) {
- super(INITIAL_CAPACITY);
- add(name);
- add(type);
- add(position);
- this.name = name;
- this.type = type;
- this.position = position;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public String getType() {
- return type;
- }
-
- @Override
- public int getPosition() {
- return position;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/ConnectionConfig.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/ConnectionConfig.java
deleted file mode 100644
index 20f18ff..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/ConnectionConfig.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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.client;
-
-import org.apache.ambari.view.hive2.actor.message.Connect;
-
-public class ConnectionConfig {
- private final String username;
- private String password;
- private final String jdbcUrl;
-
- public ConnectionConfig(String username, String password, String jdbcUrl) {
- this.username = username;
- this.password = password;
- this.jdbcUrl = jdbcUrl;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public String getUsername() {
- return username;
- }
-
- public String getPassword() {
- return password;
- }
-
- public String getJdbcUrl() {
- return jdbcUrl;
- }
-
- public Connect createConnectMessage() {
- return new Connect(username, password, jdbcUrl);
- }
-
- public Connect createConnectMessage(String jobId) {
- return new Connect(jobId, username, password, jdbcUrl);
- }
-
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/Cursor.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/Cursor.java
deleted file mode 100644
index 6bf940d..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/Cursor.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.client;
-
-import java.util.Iterator;
-import java.util.List;
-
-public interface Cursor<T, R> extends Iterator<T>, Iterable<T>{
- boolean isResettable();
- void reset();
- int getOffset();
- List<R> getDescriptions();
- void keepAlive();
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/DDLDelegator.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/DDLDelegator.java
deleted file mode 100644
index 1774a65..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/DDLDelegator.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.client;
-
-import java.util.List;
-
-public interface DDLDelegator {
-
- List<String> getDbList(ConnectionConfig config, String like);
-
- List<String> getTableList(ConnectionConfig config, String database, String like);
-
- List<Row> getTableDescriptionFormatted(ConnectionConfig config, String database, String table);
-
- List<ColumnDescription> getTableDescription(ConnectionConfig config, String database, String table, String like, boolean extended);
-
- Cursor<Row, ColumnDescription> getDbListCursor(ConnectionConfig config, String like);
-
- Cursor<Row, ColumnDescription> getTableListCursor(ConnectionConfig config, String database, String like);
-
- Cursor<Row, ColumnDescription> getTableDescriptionCursor(ConnectionConfig config, String database, String table, String like, boolean extended);
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/DDLDelegatorImpl.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/DDLDelegatorImpl.java
deleted file mode 100644
index dff9471..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/DDLDelegatorImpl.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * 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.client;
-
-import akka.actor.ActorRef;
-import akka.actor.ActorSystem;
-import akka.actor.Inbox;
-import com.google.common.base.Function;
-import com.google.common.base.Joiner;
-import com.google.common.base.Optional;
-import com.google.common.collect.FluentIterable;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Lists;
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.hive2.actor.message.Connect;
-import org.apache.ambari.view.hive2.actor.message.ExecuteJob;
-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.SQLStatementJob;
-import org.apache.ambari.view.hive2.actor.message.job.ExecutionFailed;
-import org.apache.ambari.view.hive2.actor.message.job.FetchFailed;
-import org.apache.ambari.view.hive2.actor.message.job.Next;
-import org.apache.ambari.view.hive2.actor.message.job.NoMoreItems;
-import org.apache.ambari.view.hive2.actor.message.job.NoResult;
-import org.apache.ambari.view.hive2.actor.message.job.Result;
-import org.apache.ambari.view.hive2.actor.message.job.ResultSetHolder;
-import org.apache.ambari.view.hive2.utils.HiveActorConfiguration;
-import org.apache.ambari.view.hive2.utils.ServiceFormattedException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import scala.concurrent.duration.Duration;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-
-public class DDLDelegatorImpl implements DDLDelegator {
-
- public static final String NO_VALUE_MARKER = "NO_VALUE";
- private final Logger LOG = LoggerFactory.getLogger(getClass());
-
- private final ActorRef controller;
- private final ActorSystem system;
-
- private final ViewContext context;
- private final HiveActorConfiguration actorConfiguration;
-
- public DDLDelegatorImpl(ViewContext context, ActorSystem system, ActorRef controller) {
- this.context = context;
- this.system = system;
- this.controller = controller;
- actorConfiguration = new HiveActorConfiguration(context);
- }
-
- @Override
- public List<String> getDbList(ConnectionConfig config, String like) {
- Optional<Result> rowsFromDB = getRowsFromDB(config, getDatabaseListStatements(like));
- return rowsFromDB.isPresent() ? getFirstColumnValues(rowsFromDB.get().getRows()) : Lists.<String>newArrayList();
- }
-
- @Override
- public List<String> getTableList(ConnectionConfig config, String database, String like) {
- Optional<Result> rowsFromDB = getRowsFromDB(config, getTableListStatements(database, like));
- return rowsFromDB.isPresent() ? getFirstColumnValues(rowsFromDB.get().getRows()) : Lists.<String>newArrayList();
- }
-
- @Override
- public List<Row> getTableDescriptionFormatted(ConnectionConfig config, String database, String table) {
- Optional<Result> rowsFromDB = getRowsFromDB(config, getTableDescriptionStatements(database, table));
- return rowsFromDB.isPresent() ? rowsFromDB.get().getRows() : null;
- }
-
- private String[] getTableDescriptionStatements(String database, String table) {
- return new String[]{
- String.format("use %s",database),
- String.format("describe formatted %s", table)
- };
- }
-
- @Override
- public List<ColumnDescription> getTableDescription(ConnectionConfig config, String database, String table, String like, boolean extended) {
- Optional<Result> resultOptional = getTableDescription(config, database, table, like);
- List<ColumnDescription> descriptions = new ArrayList<>();
- if(resultOptional.isPresent()) {
- for (Row row : resultOptional.get().getRows()) {
- Object[] values = row.getRow();
- String name = (String) values[3];
- String type = (String) values[5];
- int position = (Integer) values[16];
- descriptions.add(new ColumnDescriptionShort(name, type, position));
- }
- }
- return descriptions;
- }
-
- @Override
- public Cursor<Row, ColumnDescription> getDbListCursor(ConnectionConfig config, String like) {
- Optional<Result> rowsFromDB = getRowsFromDB(config, getDatabaseListStatements(like));
- if (rowsFromDB.isPresent()) {
- Result result = rowsFromDB.get();
- return new PersistentCursor<>(result.getRows(), result.getColumns());
- } else {
- return new PersistentCursor<>(Lists.<Row>newArrayList(), Lists.<ColumnDescription>newArrayList());
- }
- }
-
- @Override
- public Cursor<Row, ColumnDescription> getTableListCursor(ConnectionConfig config, String database, String like) {
- Optional<Result> rowsFromDB = getRowsFromDB(config, getTableListStatements(database, like));
- if (rowsFromDB.isPresent()) {
- Result result = rowsFromDB.get();
- return new PersistentCursor<>(result.getRows(), result.getColumns());
- } else {
- return new PersistentCursor<>(Lists.<Row>newArrayList(), Lists.<ColumnDescription>newArrayList());
- }
- }
-
- @Override
- public Cursor<Row, ColumnDescription> getTableDescriptionCursor(ConnectionConfig config, String database, String table, String like, boolean extended) {
- Optional<Result> tableDescriptionOptional = getTableDescription(config, database, table, like);
- if(tableDescriptionOptional.isPresent()) {
- Result result = tableDescriptionOptional.get();
- return new PersistentCursor<>(result.getRows(), result.getColumns());
- } else {
- return new PersistentCursor<>(Lists.<Row>newArrayList(), Lists.<ColumnDescription>newArrayList());
- }
- }
-
- private String[] getDatabaseListStatements(String like) {
- return new String[]{
- String.format("show databases like '%s'", like)
- };
- }
-
- private String[] getTableListStatements(String database, String like) {
- return new String[]{
- String.format("use %s", database),
- String.format("show tables like '%s'", like)
- };
- }
-
- private Optional<Result> getRowsFromDB(ConnectionConfig config, String[] statements) {
- Connect connect = config.createConnectMessage();
- HiveJob job = new SQLStatementJob(HiveJob.Type.SYNC, statements, config.getUsername());
- ExecuteJob execute = new ExecuteJob(connect, job);
-
- LOG.info("Executing query: {}, for user: {}", getJoinedStatements(statements), job.getUsername());
-
- return getResultFromDB(execute);
- }
-
- private Optional<Result> getTableDescription(ConnectionConfig config, String databasePattern, String tablePattern, String columnPattern) {
- Connect connect = config.createConnectMessage();
- HiveJob job = new GetColumnMetadataJob(config.getUsername(), databasePattern, tablePattern, columnPattern);
- ExecuteJob execute = new ExecuteJob(connect, job);
-
- LOG.info("Executing query to fetch the column description for dbPattern: {}, tablePattern: {}, columnPattern: {}, for user: {}",
- databasePattern, tablePattern, columnPattern, job.getUsername());
- return getResultFromDB(execute);
- }
-
- private Optional<Result> getResultFromDB(ExecuteJob job) {
- List<ColumnDescription> descriptions = null;
- List<Row> rows = Lists.newArrayList();
- Inbox inbox = Inbox.create(system);
- inbox.send(controller, job);
- Object submitResult;
- try {
- submitResult = inbox.receive(Duration.create(actorConfiguration.getSyncQueryTimeout(60 * 1000), TimeUnit.MILLISECONDS));
- } catch (Throwable ex) {
- String errorMessage = "Query timed out to fetch table description for user: " + job.getConnect().getUsername();
- LOG.error(errorMessage, ex);
- throw new ServiceFormattedException(errorMessage, ex);
- }
-
- if (submitResult instanceof NoResult) {
- LOG.info("Query returned with no result.");
- return Optional.absent();
-
- }
-
- if (submitResult instanceof ExecutionFailed) {
- ExecutionFailed error = (ExecutionFailed) submitResult;
- LOG.error("Failed to get the table description");
- throw new ServiceFormattedException(error.getMessage(), error.getError());
-
- } else if (submitResult instanceof ResultSetHolder) {
- ResultSetHolder holder = (ResultSetHolder) submitResult;
- ActorRef iterator = holder.getIterator();
- while (true) {
- inbox.send(iterator, new Next());
- Object receive;
- try {
- receive = inbox.receive(Duration.create(actorConfiguration.getResultFetchTimeout(60 * 1000), TimeUnit.MILLISECONDS));
- } catch (Throwable ex) {
- String errorMessage = "Query timed out to fetch results for user: " + job.getConnect().getUsername();
- LOG.error(errorMessage, ex);
- throw new ServiceFormattedException(errorMessage, ex);
- }
-
- if (receive instanceof Result) {
- Result result = (Result) receive;
- if (descriptions == null) {
- descriptions = result.getColumns();
- }
- rows.addAll(result.getRows());
- }
-
- if (receive instanceof NoMoreItems) {
- break;
- }
-
- if (receive instanceof FetchFailed) {
- FetchFailed error = (FetchFailed) receive;
- LOG.error("Failed to fetch results ");
- throw new ServiceFormattedException(error.getMessage(), error.getError());
- }
- }
-
- }
- return Optional.of(new Result(rows, descriptions));
- }
-
- private String getJoinedStatements(String[] statements) {
- return Joiner.on("; ").skipNulls().join(statements);
- }
-
- private ImmutableList<String> getFirstColumnValues(List<Row> rows) {
- return FluentIterable.from(rows)
- .transform(new Function<Row, String>() {
- @Override
- public String apply(Row input) {
- Object[] values = input.getRow();
- return values.length > 0 ? (String) values[0] : NO_VALUE_MARKER;
- }
- }).toList();
- }
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/EmptyCursor.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/EmptyCursor.java
deleted file mode 100644
index bf9d005..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/EmptyCursor.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * 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.client;
-
-import com.beust.jcommander.internal.Lists;
-import org.apache.commons.lang.NotImplementedException;
-
-import java.util.Iterator;
-import java.util.List;
-
-public class EmptyCursor implements Cursor<Row, ColumnDescription> {
-
- private List<Row> rows = Lists.newArrayList();
- private List<ColumnDescription> desc = Lists.newArrayList();
-
-
- @Override
- public boolean isResettable() {
- return false;
- }
-
- @Override
- public void reset() {
-
- }
-
- @Override
- public int getOffset() {
- return 0;
- }
-
- @Override
- public List<ColumnDescription> getDescriptions() {
- return desc;
- }
-
- @Override
- public void keepAlive() {
- // Do Nothing
- }
-
- /**
- * Returns an iterator over a set of elements of type T.
- *
- * @return an Iterator.
- */
- @Override
- public Iterator<Row> iterator() {
- return rows.iterator();
- }
-
- /**
- * Returns {@code true} if the iteration has more elements.
- * (In other words, returns {@code true} if {@link #next} would
- * return an element rather than throwing an exception.)
- *
- * @return {@code true} if the iteration has more elements
- */
- @Override
- public boolean hasNext() {
- return false;
- }
-
- /**
- * Returns the next element in the iteration.
- *
- * @return the next element in the iteration
- * @throws NotImplementedException if the iteration has no more elements
- */
- @Override
- public Row next() {
- throw new NotImplementedException();
- }
-
- /**
- * Removes from the underlying collection the last element returned
- * by this iterator (optional operation). This method can be called
- * only once per call to {@link #next}. The behavior of an iterator
- * is unspecified if the underlying collection is modified while the
- * iteration is in progress in any way other than by calling this
- * method.
- *
- * @throws UnsupportedOperationException if the {@code remove}
- * operation is not supported by this iterator
- * @throws IllegalStateException if the {@code next} method has not
- * yet been called, or the {@code remove} method has already
- * been called after the last call to the {@code next}
- * method
- */
- @Override
- public void remove() {
- throw new NotImplementedException();
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/HiveAuthCredentials.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/HiveAuthCredentials.java
deleted file mode 100644
index 5350d55..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/HiveAuthCredentials.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * 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.client;
-
-public class HiveAuthCredentials {
- private String password;
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/HiveAuthRequiredException.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/HiveAuthRequiredException.java
deleted file mode 100644
index db0c762..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/HiveAuthRequiredException.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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.client;
-
-import org.apache.ambari.view.hive2.utils.ServiceFormattedException;
-
-public class HiveAuthRequiredException extends ServiceFormattedException {
- public HiveAuthRequiredException() {
- super("Hive Password Required", null, 401);
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/HiveClientAuthRequiredException.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/HiveClientAuthRequiredException.java
deleted file mode 100644
index 94ff709..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/HiveClientAuthRequiredException.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * 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.client;
-
-public class HiveClientAuthRequiredException extends Exception {
- public HiveClientAuthRequiredException(String comment, Exception ex) {
- super(comment + ((ex == null)?"":(": " + ex.toString())), ex);
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/HiveClientException.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/HiveClientException.java
deleted file mode 100644
index 4d8ee01..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/HiveClientException.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * 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.client;
-
-public class HiveClientException extends Exception {
- public HiveClientException(String comment, Exception ex) {
- super(comment + ((ex == null)?"":(": " + ex.toString())), ex);
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/HiveClientRuntimeException.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/HiveClientRuntimeException.java
deleted file mode 100644
index f2bb4c3..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/HiveClientRuntimeException.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/**
- * 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.client;
-
-public class HiveClientRuntimeException extends RuntimeException {
- public HiveClientRuntimeException(String comment, Exception ex) {
- super(comment + ((ex == null)?"":(": " + ex.toString())), ex);
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java
deleted file mode 100644
index 13cab33..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/NonPersistentCursor.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * 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.client;
-
-import akka.actor.ActorRef;
-import akka.actor.ActorSystem;
-import akka.actor.Inbox;
-import com.google.common.collect.Lists;
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.hive2.actor.message.lifecycle.KeepAlive;
-import org.apache.ambari.view.hive2.utils.HiveActorConfiguration;
-import org.apache.ambari.view.hive2.utils.ServiceFormattedException;
-import org.apache.ambari.view.hive2.actor.message.job.FetchFailed;
-import org.apache.ambari.view.hive2.actor.message.job.Next;
-import org.apache.ambari.view.hive2.actor.message.job.NoMoreItems;
-import org.apache.ambari.view.hive2.actor.message.job.Result;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import scala.concurrent.duration.Duration;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.Queue;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Wrapper over iterator actor and blocks to fetch Rows and ColumnDescription whenever there is no more Rows to be
- * returned.
- */
-public class NonPersistentCursor implements Cursor<Row, ColumnDescription> {
- private final Logger LOG = LoggerFactory.getLogger(getClass());
- private static long DEFAULT_WAIT_TIMEOUT = 60 * 1000L;
-
- private final ActorSystem system;
- private final ActorRef actorRef;
- private final ViewContext context;
- private final HiveActorConfiguration actorConfiguration;
- private final Queue<Row> rows = Lists.newLinkedList();
- private final List<ColumnDescription> descriptions = Lists.newLinkedList();
- private int offSet = 0;
- private boolean endReached = false;
- private Inbox inbox;
-
- public NonPersistentCursor(ViewContext context, ActorSystem system, ActorRef actorRef) {
- this.context = context;
- this.system = system;
- this.actorRef = actorRef;
- actorConfiguration = new HiveActorConfiguration(context);
- inbox = Inbox.create(system);
- }
-
- @Override
- public boolean isResettable() {
- return false;
- }
-
- @Override
- public void reset() {
- // Do nothing
- }
-
- @Override
- public int getOffset() {
- return offSet;
- }
-
- @Override
- public List<ColumnDescription> getDescriptions() {
- fetchIfNeeded();
- return descriptions;
- }
-
- @Override
- public void keepAlive() {
- Inbox inbox = Inbox.create(system);
- inbox.send(actorRef, new KeepAlive());
- }
-
- @Override
- public Iterator<Row> iterator() {
- return this;
- }
-
- @Override
- public boolean hasNext() {
- fetchIfNeeded();
- return !endReached;
- }
-
- @Override
- public Row next() {
- fetchIfNeeded();
- offSet++;
- return rows.poll();
- }
-
- @Override
- public void remove() {
- throw new RuntimeException("Read only cursor. Method not supported");
- }
-
- private void fetchIfNeeded() {
- if (endReached || rows.size() > 0) return;
- getNextRows();
- }
-
- private void getNextRows() {
- inbox.send(actorRef, new Next());
- Object receive;
- try {
- receive = inbox.receive(Duration.create(actorConfiguration.getResultFetchTimeout(DEFAULT_WAIT_TIMEOUT),
- TimeUnit.MILLISECONDS));
- } catch (Throwable ex) {
- String errorMessage = "Result fetch timed out";
- LOG.error(errorMessage, ex);
- throw new ServiceFormattedException(errorMessage, ex);
- }
-
- if (receive instanceof Result) {
- Result result = (Result) receive;
- if (descriptions.isEmpty()) {
- descriptions.addAll(result.getColumns());
- }
- rows.addAll(result.getRows());
- }
-
- if (receive instanceof NoMoreItems) {
- if(descriptions.isEmpty()) {
- descriptions.addAll(((NoMoreItems)receive).getColumns());
- }
- endReached = true;
- }
-
- if (receive instanceof FetchFailed) {
- FetchFailed error = (FetchFailed) receive;
- LOG.error("Failed to fetch results ");
- throw new ServiceFormattedException(error.getMessage(), error.getError());
- }
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/PersistentCursor.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/PersistentCursor.java
deleted file mode 100644
index aadf31c..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/PersistentCursor.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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.client;
-
-
-import com.google.common.collect.Lists;
-
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * Wrapper over other iterables. Does not block and can be reset to start again from beginning.
- */
-public class PersistentCursor<T, R> implements Cursor<T, R> {
- private List<T> rows = Lists.newArrayList();
- private List<R> columns = Lists.newArrayList();
- private int offset = 0;
-
- public PersistentCursor(List<T> rows, List<R> columns) {
- this.rows = rows;
- this.columns = columns;
- }
-
-
- @Override
- public Iterator<T> iterator() {
- return this;
- }
-
- @Override
- public boolean hasNext() {
- return rows.size() > 0 && offset < rows.size();
- }
-
- @Override
- public T next() {
- T row = rows.get(offset);
- offset++;
- return row;
- }
-
- @Override
- public void remove() {
- throw new RuntimeException("Read only cursor. Method not supported");
- }
-
- @Override
- public boolean isResettable() {
- return true;
- }
-
- @Override
- public void reset() {
- this.offset = 0;
- }
-
- @Override
- public int getOffset() {
- return offset;
- }
-
- @Override
- public List<R> getDescriptions() {
- return columns;
- }
-
- @Override
- public void keepAlive() {
- // Do Nothing as we are pre-fetching everything.
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/Row.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/Row.java
deleted file mode 100644
index 0faa6c7..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/client/Row.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * 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.client;
-
-import java.util.Arrays;
-import java.util.HashSet;
-
-public class Row {
- private Object[] row;
-
- public Row(Object[] row) {
- this(row, null);
- }
-
- public Row(Object[] row, HashSet<Integer> selectedColumns) {
- if (selectedColumns == null || selectedColumns.size() == 0)
- this.row = row.clone();
- else {
- this.row = new Object[selectedColumns.size()];
- int rowIndex = 0;
- for (Integer selectedIndex : selectedColumns) {
- this.row[rowIndex] = row[selectedIndex];
- rowIndex ++;
- }
- }
- }
-
- public Object[] getRow() {
- return row;
- }
-
- public void setRow(Object[] row) {
- this.row = row;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
-
- Row row1 = (Row) o;
-
- boolean retValue = Arrays.equals(row, row1.row);
- return retValue;
- }
-
- @Override
- public int hashCode() {
- return Arrays.hashCode(row);
- }
-
- @Override
- public String toString() {
- return "Row{" +
- "row=" + Arrays.toString(row) +
- '}';
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/exceptions/NotConnectedException.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/exceptions/NotConnectedException.java
deleted file mode 100644
index 71e64d2..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/exceptions/NotConnectedException.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.exceptions;
-
-/**
- * Exception thrown when the connection is not made and we try to execute some job
- */
-public class NotConnectedException extends RuntimeException {
- public NotConnectedException(String message) {
- super(message);
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/AsyncExecutionFailure.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/AsyncExecutionFailure.java
deleted file mode 100644
index f587ce0..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/AsyncExecutionFailure.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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.internal;
-
-public class AsyncExecutionFailure {
-}
-
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/AsyncExecutionSuccess.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/AsyncExecutionSuccess.java
deleted file mode 100644
index c45b303..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/AsyncExecutionSuccess.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.internal;
-
-public class AsyncExecutionSuccess {
-
-
-}
-
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/Connectable.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/Connectable.java
deleted file mode 100644
index 926decc..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/Connectable.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.internal;
-
-import com.google.common.base.Optional;
-import org.apache.hive.jdbc.HiveConnection;
-
-/**
- * Life cycle management for java.sql.Connection
- */
-public interface Connectable {
-
- /**
- * Get the underlying connection
- * @return an optional wrapping the connection
- */
- Optional<HiveConnection> getConnection();
-
- /**
- * Check if the connection is open
- * @return
- */
- boolean isOpen();
-
- /**
- * Open a connection
- * @throws ConnectionException
- */
- void connect() throws ConnectionException;
-
- /**
- * Reconnect if closed
- * @throws ConnectionException
- */
- void reconnect() throws ConnectionException;
-
- /**
- * Close the connection
- * @throws ConnectionException
- */
- void disconnect() throws ConnectionException;
-
- /**
- * True when the connection is unauthorized
- * @return
- */
- boolean isUnauthorized();
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/ConnectionException.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/ConnectionException.java
deleted file mode 100644
index 14db3f1..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/ConnectionException.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.internal;
-
-public class ConnectionException extends Exception {
- public ConnectionException(Exception e, String message) {
- super(message,e);
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/ConnectionProperties.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/ConnectionProperties.java
deleted file mode 100644
index 6f829c3..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/ConnectionProperties.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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.internal;
-
-import com.google.common.collect.Maps;
-
-import java.util.Map;
-
-/**
- * Holds all information needed to connect to HS2
- */
-public class ConnectionProperties {
-
- private String host;
- private int port;
- private String userName;
- private String password;
- private Map<String, String> authParams = Maps.newHashMap();
-
- public Map<String, String> getAuthParams() {
- return authParams;
- }
-
- public void addAuthParam(String key,String value){
- authParams.put(key, value);
- }
-
- public String getHost() {
- return host;
- }
-
- public void setHost(String host) {
- this.host = host;
- }
-
- public String getPassword() {
- return password;
- }
-
- public void setPassword(String password) {
- this.password = password;
- }
-
- public int getPort() {
- return port;
- }
-
- public void setPort(int port) {
- this.port = port;
- }
-
- public String getUserName() {
- return userName;
- }
-
- public void setUserName(String userName) {
- this.userName = userName;
- }
-
- @Override
- public String toString() {
- return "HiveConnectionProps{" +
- "authParams=" + authParams +
- ", host='" + host + '\'' +
- ", port=" + port +
- ", userName='" + userName + '\'' +
- ", password='" + password + '\'' +
- '}';
- }
-
- public String asUrl() {
- return null;
- }
-
- public String asUrlWithoutCredentials() {
- return null;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/ConnectionSupplier.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/ConnectionSupplier.java
deleted file mode 100644
index 3cc268b..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/ConnectionSupplier.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.internal;
-
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.hive2.ConnectionDelegate;
-import org.apache.ambari.view.hive2.HiveJdbcConnectionDelegate;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ConnectionSupplier implements ContextSupplier<ConnectionDelegate> {
-
- protected final Logger LOG =
- LoggerFactory.getLogger(getClass());
-
- @Override
- public ConnectionDelegate get(ViewContext context) {
- LOG.debug("Creating Connection delegate instance for Viewname: {}, Instance Name: {}", context.getViewName(), context.getInstanceName());
- return new HiveJdbcConnectionDelegate();
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/ContextSupplier.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/ContextSupplier.java
deleted file mode 100644
index e35885d..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/ContextSupplier.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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.internal;
-
-import org.apache.ambari.view.ViewContext;
-
-/**
- * A class that can supply objects of same type.
- * @param <T>
- */
-public interface ContextSupplier<T> {
- /**
- * Retrieves an instance of appropriate type. The returned object could be a new instance
- * or an exiting instance. No guarantee on that.
- * @param context View Context to be used to create the instance
- * @return instance of appropriateType
- */
- T get(ViewContext context);
-
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/DataStorageSupplier.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/DataStorageSupplier.java
deleted file mode 100644
index f496d06..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/DataStorageSupplier.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.internal;
-
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.hive2.persistence.DataStoreStorage;
-import org.apache.ambari.view.hive2.persistence.Storage;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * A supplier for data storage
- * Duplicated to keep the API uniform
- */
-public class DataStorageSupplier implements ContextSupplier<Storage> {
-
- protected final Logger LOG =
- LoggerFactory.getLogger(getClass());
-
- @Override
- public Storage get(ViewContext context) {
- LOG.debug("Creating storage instance for Viewname: {}, Instance Name: {}", context.getViewName(), context.getInstanceName());
- return new DataStoreStorage(context);
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/DefaultSupplier.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/DefaultSupplier.java
deleted file mode 100644
index 39c8594..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/DefaultSupplier.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.internal;
-
-import com.google.common.base.Supplier;
-
-import java.util.List;
-
-/**
- * Create instances of classes
- * for which no constructors have been specified
- * @param <T>
- */
-public class DefaultSupplier<T> implements Supplier<T>{
-
- private Class<T> clazz;
- T instance;
-
- public DefaultSupplier(T instance) {
- this.instance = instance;
- }
-
- public DefaultSupplier(Class<T> clazz) throws IllegalAccessException, InstantiationException {
- this.clazz = clazz;
- }
-
- /**
- * Get the instance
- * @return
- */
- @Override
- public T get() {
- if(clazz != null){
- try {
- return clazz.newInstance();
- } catch (InstantiationException e) {
- e.printStackTrace();
- return null;
- } catch (IllegalAccessException e) {
- return null;
- }
- } else {
- return instance;
- }
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/Either.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/Either.java
deleted file mode 100644
index 4f25552..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/Either.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.internal;
-
-import com.google.common.base.Optional;
-
-/**
- * Simple implementation of a container class which can
- * hold one of two values
- * <p>
- * Callers should check if the value if left or right before
- * trying to get the value
- *
- * @param <L> Left Value
- * @param <R> Right value
- */
-public class Either<L, R> {
-
- private final Optional<L> left;
- private final Optional<R> right;
-
-
- public boolean isLeft() {
- return left.isPresent() && !right.isPresent();
- }
-
- public boolean isRight() {
- return !left.isPresent() && right.isPresent();
- }
-
- public boolean isNone() { return !(left.isPresent() || right.isPresent()); }
-
- public L getLeft() {
- return left.orNull();
- }
-
- public R getRight() {
- return right.orNull();
- }
-
-
- private Either(Optional<L> left, Optional<R> right) {
- this.left = left;
- this.right = right;
- }
-
-
- public static <L, R> Either<L, R> left(L value) {
- return new Either<>(Optional.of(value), Optional.<R>absent());
- }
-
- public static <L, R> Either<L, R> right(R value) {
- return new Either<>(Optional.<L>absent(), Optional.of(value));
- }
-
- public static <L, R> Either<L, R> none() {
- return new Either<>(Optional.<L>absent(), Optional.<R>absent());
- }
-
-}
-
-
-
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HdfsApiSupplier.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HdfsApiSupplier.java
deleted file mode 100644
index 58ae8ad..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HdfsApiSupplier.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.internal;
-
-import com.google.common.base.Optional;
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.commons.hdfs.ViewPropertyHelper;
-import org.apache.ambari.view.utils.hdfs.HdfsApi;
-import org.apache.ambari.view.utils.hdfs.HdfsApiException;
-import org.apache.ambari.view.utils.hdfs.HdfsUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-public class HdfsApiSupplier implements ContextSupplier<Optional<HdfsApi>> {
- public static final String VIEW_CONF_KEYVALUES = "view.conf.keyvalues";
-
- protected final Logger LOG =
- LoggerFactory.getLogger(getClass());
-
- private static final Map<String, HdfsApi> hdfsApiMap = new ConcurrentHashMap<>();
- private final Object lock = new Object();
-
- @Override
- public Optional<HdfsApi> get(ViewContext context) {
- try {
- if(!hdfsApiMap.containsKey(getKey(context))) {
- synchronized (lock) {
- if(!hdfsApiMap.containsKey(getKey(context))) {
- LOG.debug("Creating HDFSApi instance for Viewname: {}, Instance Name: {}", context.getViewName(), context.getInstanceName());
- Optional<Map<String, String>> props = ViewPropertyHelper.getViewConfigs(context, VIEW_CONF_KEYVALUES);
- HdfsApi api;
- if(props.isPresent()){
- api = HdfsUtil.connectToHDFSApi(context, props.get());
- }else{
- api = HdfsUtil.connectToHDFSApi(context);
- }
- hdfsApiMap.put(getKey(context), api);
- return Optional.of(api);
- }
- }
- }
- return Optional.of(hdfsApiMap.get(getKey(context)));
- } catch (HdfsApiException e) {
- LOG.error("Cannot get the HDFS API", e);
- return Optional.absent();
- }
- }
-
- private String getKey(ViewContext context) {
- return context.getUsername() + ":" + context.getInstanceName();
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HiveConnectionWrapper.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HiveConnectionWrapper.java
deleted file mode 100644
index 92a8a2c..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HiveConnectionWrapper.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * 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.internal;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Supplier;
-import org.apache.ambari.view.hive2.AuthParams;
-import org.apache.hadoop.security.UserGroupInformation;
-import org.apache.hive.jdbc.HiveConnection;
-
-import java.io.IOException;
-import java.lang.reflect.UndeclaredThrowableException;
-import java.security.PrivilegedExceptionAction;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-
-/**
- * Composition over a Hive jdbc connection
- * This class only provides a connection over which
- * callers should run their own JDBC statements
- */
-public class HiveConnectionWrapper implements Connectable, Supplier<HiveConnection> {
-
- private static String DRIVER_NAME = "org.apache.hive.jdbc.HiveDriver";
- public static final String SUFFIX = "validating the login";
- private final String jdbcUrl;
- private final String username;
- private final String password;
- private final AuthParams authParams;
-
- private UserGroupInformation ugi;
-
- private HiveConnection connection = null;
- private boolean authFailed;
-
- public HiveConnectionWrapper(String jdbcUrl, String username, String password, AuthParams authParams) {
- this.jdbcUrl = jdbcUrl;
- this.username = username;
- this.password = password;
- this.authParams = authParams;
- }
-
- @Override
- public void connect() throws ConnectionException {
- try {
- Class.forName(DRIVER_NAME);
- } catch (ClassNotFoundException e) {
- throw new ConnectionException(e, "Cannot load the hive JDBC driver");
- }
-
- try {
- ugi = UserGroupInformation.createProxyUser(username, authParams.getProxyUser());
- } catch (IOException e) {
- throw new ConnectionException(e, "Cannot set kerberos authentication for getting connection.");
- }
-
- try {
- Connection conn = ugi.doAs(new PrivilegedExceptionAction<Connection>() {
- @Override
- public Connection run() throws Exception {
- return DriverManager.getConnection(jdbcUrl, username, password);
- }
- });
- connection = (HiveConnection) conn;
- } catch (UndeclaredThrowableException exception) {
- // Check if the reason was an auth error
- Throwable undeclaredThrowable = exception.getUndeclaredThrowable();
- if (undeclaredThrowable instanceof SQLException) {
- SQLException sqlException = (SQLException) undeclaredThrowable;
- if (isLoginError(sqlException))
- authFailed = true;
- throw new ConnectionException(sqlException, "Cannot open a hive connection with connect string " + jdbcUrl);
- }
-
- } catch (IOException | InterruptedException e) {
- throw new ConnectionException(e, "Cannot open a hive connection with connect string " + jdbcUrl);
- }
-
- }
-
- @Override
- public void reconnect() throws ConnectionException {
-
- }
-
- @Override
- public void disconnect() throws ConnectionException {
- if (connection != null) {
- try {
- connection.close();
- } catch (SQLException e) {
- throw new ConnectionException(e, "Cannot close the hive connection with connect string " + jdbcUrl);
- }
- }
- }
-
- private boolean isLoginError(SQLException ce) {
- return ce.getCause().getMessage().toLowerCase().endsWith(SUFFIX);
- }
-
- /**
- * True when the connection is unauthorized
- *
- * @return
- */
- @Override
- public boolean isUnauthorized() {
- return authFailed;
- }
-
- public Optional<HiveConnection> getConnection() {
- return Optional.fromNullable(connection);
- }
-
- @Override
- public boolean isOpen() {
- try {
- return connection != null && !connection.isClosed() && connection.isValid(100);
- } catch (SQLException e) {
- // in case of an SQ error just return
- return false;
- }
- }
-
- /**
- * Retrieves an instance of the appropriate type. The returned object may or
- * may not be a new instance, depending on the implementation.
- *
- * @return an instance of the appropriate type
- */
- @Override
- public HiveConnection get() {
- return null;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HiveQuery.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HiveQuery.java
deleted file mode 100644
index 29f0db3..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HiveQuery.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.internal;
-
-
-import com.google.common.base.Function;
-import com.google.common.collect.FluentIterable;
-
-import javax.annotation.Nullable;
-import java.util.Arrays;
-import java.util.Collection;
-
-/**
- * Holder for query submitted by the user
- * This may contain multiple hive queries
- */
-public class HiveQuery {
-
- private String query;
-
- public HiveQuery(String query) {
- this.query = query;
- }
-
- public HiveQueries fromMultiLineQuery(String multiLineQuery){
- return new HiveQueries(multiLineQuery);
- }
-
-
- public static class HiveQueries{
-
- static final String QUERY_SEP = ";";
- Collection<HiveQuery> hiveQueries;
-
- private HiveQueries(String userQuery) {
- hiveQueries = FluentIterable.from(Arrays.asList(userQuery.split(QUERY_SEP)))
- .transform(new Function<String, HiveQuery>() {
- @Nullable
- @Override
- public HiveQuery apply(@Nullable String input) {
- return new HiveQuery(input.trim());
- }
- }).toList();
- }
-
-
-
-
-
- }
-
-
-
-
-};
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HiveResult.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HiveResult.java
deleted file mode 100644
index 25696d2..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HiveResult.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * 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.internal;
-
-import com.google.common.collect.Lists;
-
-import java.math.RoundingMode;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.text.DecimalFormat;
-import java.text.NumberFormat;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.List;
-
-public class HiveResult implements Iterator<HiveResult.Row> {
-
- public static final String NULL = "NULL";
- private static final int DEFAULT_BATCH_SIZE = 50;
- private static ResultSetMetaData metaData;
- private Row colNames;
- private NumberFormat nf = new DecimalFormat();
- private List<Row> rows = Lists.newArrayList();
-
- public HiveResult(ResultSet rs) throws SQLException {
- nf.setRoundingMode(RoundingMode.FLOOR);
- nf.setMinimumFractionDigits(0);
- nf.setMaximumFractionDigits(2);
- metaData = rs.getMetaData();
- int columnCount = metaData.getColumnCount();
- colNames = new Row(columnCount);
- int index = 0;
- while (rs.next() && index <DEFAULT_BATCH_SIZE){
- index ++;
- rows.add(new Row(columnCount,rs));
- }
-
-
- }
-
- public List<Row> getRows(){
- return rows;
- }
-
- public List<Row> getData() {
- return rows;
- }
-
- /**
- * use the lists iterator
- *
- * @return {@code true} if the iteration has more elements
- */
- @Override
- public boolean hasNext() {
- return rows.iterator().hasNext();
- }
-
- /**
- * Returns the next row in the iteration.
- *
- * @return the next element in the iteration
- */
- @Override
- public Row next() {
- return rows.iterator().next();
- }
-
- /**
- * Removes from the underlying collection the last element returned
- * by this iterator (optional operation). This method can be called
- * only once per call to {@link #next}. The behavior of an iterator
- * is unspecified if the underlying collection is modified while the
- * iteration is in progress in any way other than by calling this
- * method.
- *
- * @throws UnsupportedOperationException if the {@code remove}
- * operation is not supported by this iterator
- * @throws IllegalStateException if the {@code next} method has not
- * yet been called, or the {@code remove} method has already
- * been called after the last call to the {@code next}
- * method
- */
- @Override
- public void remove() {
- throw new UnsupportedOperationException();
- }
-
- public Row getColNames() {
- return colNames;
- }
-
-
- @Override
- public String toString() {
- return "HiveResult{" +
- "colNames=" + colNames +
- ", rows=" + rows +
- '}';
- }
-
- public class Row {
- String[] values;
-
- public Row(int size) throws SQLException {
- values = new String[size];
- for (int i = 0; i < size; i++) {
- values[i] = metaData.getColumnLabel(i + 1);
- }
- }
-
-
- public Row(int size, ResultSet rs) throws SQLException {
- values = new String[size];
- for (int i = 0; i < size; i++) {
- if (nf != null) {
- Object object = rs.getObject(i + 1);
- if (object == null) {
- values[i] = null;
- } else if (object instanceof Number) {
- values[i] = nf.format(object);
- } else {
- values[i] = object.toString();
- }
- } else {
- values[i] = rs.getString(i + 1);
- }
- values[i] = values[i] == null ? NULL : values[i];
-
- }
-
- }
-
- @Override
- public String toString() {
- return "Row{" +
- "values=" + Arrays.toString(values) +
- '}';
- }
- }
-
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HiveTask.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HiveTask.java
deleted file mode 100644
index 3a682ec..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HiveTask.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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.internal;
-
-public interface HiveTask {
-
- /**
- * The task id for this task
- * @return task Id
- */
- Long getId();
-
- /**
- * The user for which this task was submitted
- * @return
- */
- String getUser();
-
- /**
- * The view instance tied to this task
- * @return
- */
- String getInstance();
-
- /**
- * Connection properties pulled from the view context and request
- * @return
- */
-
- //Connectable getConnectionClass();
-
- ConnectionProperties getConnectionProperties();
-
- HiveQuery.HiveQueries getQueries();
-
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HiveTaskMessage.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HiveTaskMessage.java
deleted file mode 100644
index 7002f28..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/HiveTaskMessage.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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.internal;
-
-public class HiveTaskMessage implements HiveTask {
-
- private Long id;
- private String instance;
- private ConnectionProperties connectionProps;
- private HiveQuery.HiveQueries queries;
- //private Connectable connectable = new HiveConnectionWrapper(connectMessage);
-
-
- public void setConnectionProps(ConnectionProperties connectionProps) {
- this.connectionProps = connectionProps;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public void setInstance(String instance) {
- this.instance = instance;
- }
-
- public void setQueries(HiveQuery.HiveQueries queries) {
- this.queries = queries;
- }
-
-
- /*public void setConnectable(Connectable connectable) {
- this.connectable = connectable;
- }*/
-
- /**
- * The task id for this task
- *
- * @return task Id
- */
- @Override
- public Long getId() {
- return id;
- }
-
- /**
- * The user for which this task was submitted
- *
- * @return
- */
- @Override
- public String getUser() {
- return connectionProps.getUserName();
- }
-
- /**
- * The view instance tied to this task
- *
- * @return
- */
- @Override
- public String getInstance() {
- return instance;
- }
-
- /**
- * Connection properties pulled from the view context and request
- *
- * @return
- */
- /*@Override
- public Connectable getConnectionClass() {
- return connectable;
- }
-*/
- /**
- * Connection properties pulled from the view context and request
- *
- * @return
- */
- @Override
- public ConnectionProperties getConnectionProperties() {
- return connectionProps;
- }
-
- @Override
- public HiveQuery.HiveQueries getQueries() {
- return queries;
- }
-
-
- @Override
- public String toString() {
- return "HiveTaskMessage{" +
- "connectionProps=" + connectionProps +
- ", id=" + id +
- ", instance='" + instance + '\'' +
- ", queries=" + queries +
- '}';
- }
-
-
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/SafeViewContext.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/SafeViewContext.java
deleted file mode 100644
index 2ee3697..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/internal/SafeViewContext.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * 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.internal;
-
-import org.apache.ambari.view.AmbariStreamProvider;
-import org.apache.ambari.view.DataStore;
-import org.apache.ambari.view.HttpImpersonator;
-import org.apache.ambari.view.ImpersonatorSetting;
-import org.apache.ambari.view.ResourceProvider;
-import org.apache.ambari.view.SecurityException;
-import org.apache.ambari.view.URLConnectionProvider;
-import org.apache.ambari.view.URLStreamProvider;
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.ViewController;
-import org.apache.ambari.view.ViewDefinition;
-import org.apache.ambari.view.ViewInstanceDefinition;
-import org.apache.ambari.view.cluster.Cluster;
-
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * Wrapper to ViewContext. This delegates all the method calls to wrapped ViewContext object excepting for
- * #getUsername() and #getLoggedinUser(). At the creation time, the username and loggedinuser are store
- * in instance variable. This was done to bypass the ThreadLocal variables implicitly used in actual viewContext.
- * So, object of this class should be used in the ActorSystem.
- */
-public class SafeViewContext implements ViewContext {
- private final ViewContext viewContext;
- private final String username;
- private final String loggedinUser;
- private final Map<String, String> properties;
-
- public SafeViewContext(ViewContext viewContext) {
- this.viewContext = viewContext;
- username = viewContext.getUsername();
- loggedinUser = viewContext.getLoggedinUser();
- properties = viewContext.getProperties();
- }
-
- @Override
- public String getUsername() {
- return username;
- }
-
- @Override
- public String getLoggedinUser() {
- return loggedinUser;
- }
-
- @Override
- public void hasPermission(String userName, String permissionName) throws SecurityException {
- viewContext.hasPermission(userName, permissionName);
- }
-
- @Override
- public String getViewName() {
- return viewContext.getViewName();
- }
-
- @Override
- public ViewDefinition getViewDefinition() {
- return viewContext.getViewDefinition();
- }
-
- @Override
- public String getInstanceName() {
- return viewContext.getInstanceName();
- }
-
- @Override
- public ViewInstanceDefinition getViewInstanceDefinition() {
- return viewContext.getViewInstanceDefinition();
- }
-
- @Override
- public Map<String, String> getProperties() {
- return properties;
- }
-
- @Override
- public void putInstanceData(String key, String value) {
- viewContext.putInstanceData(key, value);
- }
-
- @Override
- public String getInstanceData(String key) {
- return viewContext.getInstanceData(key);
- }
-
- @Override
- public Map<String, String> getInstanceData() {
- return viewContext.getInstanceData();
- }
-
- @Override
- public void removeInstanceData(String key) {
- viewContext.removeInstanceData(key);
- }
-
- @Override
- public String getAmbariProperty(String key) {
- return viewContext.getAmbariProperty(key);
- }
-
- @Override
- public ResourceProvider<?> getResourceProvider(String type) {
- return viewContext.getResourceProvider(type);
- }
-
- @Override
- public URLStreamProvider getURLStreamProvider() {
- return viewContext.getURLStreamProvider();
- }
-
- @Override
- public URLConnectionProvider getURLConnectionProvider() {
- return viewContext.getURLConnectionProvider();
- }
-
- @Override
- public AmbariStreamProvider getAmbariStreamProvider() {
- return viewContext.getAmbariStreamProvider();
- }
-
- @Override
- public AmbariStreamProvider getAmbariClusterStreamProvider() {
- return viewContext.getAmbariClusterStreamProvider();
- }
-
- @Override
- public DataStore getDataStore() {
- return viewContext.getDataStore();
- }
-
- @Override
- public Collection<ViewDefinition> getViewDefinitions() {
- return viewContext.getViewDefinitions();
- }
-
- @Override
- public Collection<ViewInstanceDefinition> getViewInstanceDefinitions() {
- return viewContext.getViewInstanceDefinitions();
- }
-
- @Override
- public ViewController getController() {
- return viewContext.getController();
- }
-
- @Override
- public HttpImpersonator getHttpImpersonator() {
- return viewContext.getHttpImpersonator();
- }
-
- @Override
- public ImpersonatorSetting getImpersonatorSetting() {
- return viewContext.getImpersonatorSetting();
- }
-
- @Override
- public Cluster getCluster() {
- return viewContext.getCluster();
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/DataStoreStorage.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/DataStoreStorage.java
deleted file mode 100644
index a54a82e..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/DataStoreStorage.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/**
- * 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.persistence;
-
-import org.apache.ambari.view.PersistenceException;
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.hive2.persistence.utils.FilteringStrategy;
-import org.apache.ambari.view.hive2.persistence.utils.Indexed;
-import org.apache.ambari.view.hive2.persistence.utils.ItemNotFound;
-import org.apache.ambari.view.hive2.persistence.utils.OnlyOwnersFilteringStrategy;
-import org.apache.ambari.view.hive2.utils.ServiceFormattedException;
-import org.apache.commons.beanutils.BeanUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.beans.Transient;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * Engine for storing objects to context DataStore storage
- */
-public class DataStoreStorage implements Storage {
- private final static Logger LOG =
- LoggerFactory.getLogger(DataStoreStorage.class);
-
- protected ViewContext context;
-
- /**
- * Constructor
- * @param context View Context instance
- */
- public DataStoreStorage(ViewContext context) {
- this.context = context;
- }
-
- @Override
- public synchronized void store(Class model, Indexed obj) {
-
- try {
- Indexed newBean = (Indexed) BeanUtils.cloneBean(obj);
- preprocessEntity(newBean);
- context.getDataStore().store(newBean);
- obj.setId(newBean.getId());
- } catch (Exception e) {
- throw new ServiceFormattedException("S020 Data storage error", e);
- }
- }
-
- private void preprocessEntity(Indexed obj) {
- cleanTransientFields(obj);
- }
-
- private void cleanTransientFields(Indexed obj) {
- for (Method m : obj.getClass().getMethods()) {
- Transient aTransient = m.getAnnotation(Transient.class);
- if (aTransient != null && m.getName().startsWith("set")) {
- try {
- m.invoke(obj, new Object[]{ null });
- } catch (IllegalAccessException e) {
- throw new ServiceFormattedException("S030 Data storage error", e);
- } catch (InvocationTargetException e) {
- throw new ServiceFormattedException("S030 Data storage error", e);
- }
- }
- }
- }
-
- @Override
- public synchronized <T extends Indexed> T load(Class<T> model, Object id) throws ItemNotFound {
- LOG.debug(String.format("Loading %s #%s", model.getName(), id));
- try {
- T obj = context.getDataStore().find(model, id);
- if (obj != null) {
- return obj;
- } else {
- throw new ItemNotFound();
- }
- } catch (PersistenceException e) {
- throw new ServiceFormattedException("S040 Data storage error", e);
- }
- }
-
- @Override
- public synchronized <T extends Indexed> List<T> loadAll(Class<? extends T> model, FilteringStrategy filter) {
- LinkedList<T> list = new LinkedList<T>();
- LOG.debug(String.format("Loading all %s-s", model.getName()));
- try {
- for(T item: context.getDataStore().findAll(model, filter.whereStatement())) {
- list.add(item);
- }
- } catch (PersistenceException e) {
- throw new ServiceFormattedException("S050 Data storage error", e);
- }
- return list;
- }
-
- @Override
- public synchronized <T extends Indexed> List<T> loadAll(Class<T> model) {
- return loadAll(model, new OnlyOwnersFilteringStrategy(this.context.getUsername()));
- }
-
- @Override
- public synchronized void delete(Class model, Object id) throws ItemNotFound {
- LOG.debug(String.format("Deleting %s:%s", model.getName(), id));
- Object obj = load(model, id);
- try {
- context.getDataStore().remove(obj);
- } catch (PersistenceException e) {
- throw new ServiceFormattedException("S060 Data storage error", e);
- }
- }
-
- @Override
- public boolean exists(Class model, Object id) {
- try {
- return context.getDataStore().find(model, id) != null;
- } catch (PersistenceException e) {
- throw new ServiceFormattedException("S070 Data storage error", e);
- }
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/IStorageFactory.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/IStorageFactory.java
deleted file mode 100644
index 6c39359..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/IStorageFactory.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * 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.persistence;
-
-public interface IStorageFactory {
- Storage getStorage();
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/InstanceKeyValueStorage.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/InstanceKeyValueStorage.java
deleted file mode 100644
index 86f2bfc..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/InstanceKeyValueStorage.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/**
- * 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.persistence;
-
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.hive2.persistence.utils.ContextConfigurationAdapter;
-import org.apache.ambari.view.hive2.utils.ServiceFormattedException;
-import org.apache.commons.configuration.Configuration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.WebApplicationException;
-
-
-/**
- * Persistent storage engine for storing java beans to
- * instance data
- */
-@Deprecated
-public class InstanceKeyValueStorage extends KeyValueStorage {
- private final static Logger LOG =
- LoggerFactory.getLogger(InstanceKeyValueStorage.class);
-
- private ContextConfigurationAdapter config = null;
- private int VALUE_LENGTH_LIMIT = 254;
-
- /**
- * Constructor.
- * @param context View Context instance
- */
- public InstanceKeyValueStorage(ViewContext context) {
- super(context);
- }
-
- /**
- * Returns config instance, adapter to Persistence API
- * @return config instance
- */
- @Override
- protected synchronized Configuration getConfig() {
- if (config == null) {
- config = new ContextConfigurationAdapter(context);
- }
- return config;
- }
-
- /**
- * Value is limited to 256 symbols, this code splits value into chunks and saves them as <key>#<chunk_id>
- * @param modelPropName key
- * @param json value
- */
- protected void write(String modelPropName, String json) {
- int saved = 0;
- int page = 1;
- while (saved < json.length()) {
- int end = Math.min(saved + VALUE_LENGTH_LIMIT, json.length());
- String substring = json.substring(saved, end);
- getConfig().setProperty(modelPropName + "#" + page, substring);
- saved += VALUE_LENGTH_LIMIT;
- page += 1;
- LOG.debug("Chunk saved: " + modelPropName + "#" + page + "=" + substring);
- }
- getConfig().setProperty(modelPropName, page - 1);
- LOG.debug("Write finished: " + modelPropName + " pages:" + (page - 1));
- }
-
- /**
- * Read chunked value (keys format <key>#<chunk_id>)
- * @param modelPropName key
- * @return value
- */
- protected String read(String modelPropName) {
- StringBuilder result = new StringBuilder();
- int pages = getConfig().getInt(modelPropName);
- LOG.debug("Read started: " + modelPropName + " pages:" + pages);
-
- for(int page = 1; page <= pages; page++) {
- String substring = getConfig().getString(modelPropName + "#" + page);
- LOG.debug("Chunk read: " + modelPropName + "#" + page + "=" + substring);
- if (substring != null) {
- result.append(substring);
- }
- }
-
- return result.toString();
- }
-
- /**
- * Remove chunked value (keys format <key>#<chunk_id>)
- * @param modelPropName key
- */
- protected void clear(String modelPropName) {
- int pages = getConfig().getInt(modelPropName);
- LOG.debug("Clean started: " + modelPropName + " pages:" + pages);
-
- for(int page = 1; page <= pages; page++) {
- getConfig().clearProperty(modelPropName + "#" + page);
- LOG.debug("Chunk clean: " + modelPropName + "#" + page);
- }
- getConfig().clearProperty(modelPropName);
- }
-
- public static void storageSmokeTest(ViewContext context) {
- try {
- final String property = "test.smoke.property";
- context.putInstanceData(property, "42");
- boolean status = context.getInstanceData(property).equals("42");
- context.removeInstanceData(property);
- if (!status) throw new ServiceFormattedException("Ambari Views instance data DB doesn't work properly", null);
- } catch (WebApplicationException ex) {
- throw ex;
- } catch (Exception ex) {
- throw new ServiceFormattedException(ex.getMessage(), ex);
- }
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/KeyValueStorage.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/KeyValueStorage.java
deleted file mode 100644
index 7b9c61c..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/KeyValueStorage.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/**
- * 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.persistence;
-
-import com.google.gson.Gson;
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.hive2.persistence.utils.FilteringStrategy;
-import org.apache.ambari.view.hive2.persistence.utils.Indexed;
-import org.apache.ambari.view.hive2.persistence.utils.ItemNotFound;
-import org.apache.ambari.view.hive2.persistence.utils.OnlyOwnersFilteringStrategy;
-import org.apache.commons.configuration.Configuration;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Engine for storing objects to key-value storage
- */
-public abstract class KeyValueStorage implements Storage {
- private final static Logger LOG =
- LoggerFactory.getLogger(KeyValueStorage.class);
- protected final Gson gson = new Gson();
- protected ViewContext context;
-
- /**
- * Constructor
- * @param context View Context instance
- */
- public KeyValueStorage(ViewContext context) {
- this.context = context;
- }
-
- /**
- * Returns config instance, adapter to Persistence API
- * @return config instance
- */
- protected abstract Configuration getConfig();
-
- @Override
- public <T extends Indexed> void store(Class<T> model, Indexed obj) {
- String modelIndexingPropName = getIndexPropertyName(model);
-
- if (obj.getId() == null) {
- int lastIndex = getConfig().getInt(modelIndexingPropName, 0);
- lastIndex ++;
- getConfig().setProperty(modelIndexingPropName, lastIndex);
- obj.setId(String.valueOf(lastIndex));
- }
-
- String modelPropName = getItemPropertyName(model, obj.getId());
- String json = serialize(obj);
- write(modelPropName, json);
- }
-
- @Override
- public <T extends Indexed> T load(Class<T> model, Object id) throws ItemNotFound {
- String modelPropName = getItemPropertyName(model, id);
- LOG.debug(String.format("Loading %s", modelPropName));
- if (getConfig().containsKey(modelPropName)) {
- String json = read(modelPropName);
- LOG.debug(String.format("json: %s", json));
-
- return deserialize(model, json);
- } else {
- throw new ItemNotFound();
- }
- }
-
- /**
- * Write json to storage
- * @param modelPropName key
- * @param json value
- */
- protected void write(String modelPropName, String json) {
- getConfig().setProperty(modelPropName, json);
- }
-
- /**
- * Read json from storage
- * @param modelPropName key
- * @return value
- */
- protected String read(String modelPropName) {
- return getConfig().getString(modelPropName);
- }
-
- /**
- * Remove line from storage
- * @param modelPropName key
- */
- protected void clear(String modelPropName) {
- getConfig().clearProperty(modelPropName);
- }
-
- protected String serialize(Indexed obj) {
- return gson.toJson(obj);
- }
-
- protected <T extends Indexed> T deserialize(Class<T> model, String json) {
- return gson.fromJson(json, model);
- }
-
- @Override
- public synchronized <T extends Indexed> List<T> loadAll(Class<? extends T> model, FilteringStrategy filter) {
- ArrayList<T> list = new ArrayList<T>();
- String modelIndexingPropName = getIndexPropertyName(model);
- LOG.debug(String.format("Loading all %s-s", model.getName()));
- int lastIndex = getConfig().getInt(modelIndexingPropName, 0);
- for(int i=1; i<=lastIndex; i++) {
- try {
- T item = load(model, i);
- if ((filter == null) || filter.isConform(item)) {
- list.add(item);
- }
- } catch (ItemNotFound ignored) {
- }
- }
- return list;
- }
-
- @Override
- public synchronized <T extends Indexed> List<T> loadAll(Class<T> model) {
- return loadAll(model, new OnlyOwnersFilteringStrategy(this.context.getUsername()));
- }
-
- @Override
- public synchronized void delete(Class model, Object id) {
- LOG.debug(String.format("Deleting %s:%s", model.getName(), id));
- String modelPropName = getItemPropertyName(model, id);
- clear(modelPropName);
- }
-
- @Override
- public boolean exists(Class model, Object id) {
- return getConfig().containsKey(getItemPropertyName(model, id));
- }
-
- private String getIndexPropertyName(Class model) {
- return String.format("%s:index", model.getName());
- }
-
- private String getItemPropertyName(Class model, Object id) {
- return String.format("%s.%s", model.getName(), id);
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/LocalKeyValueStorage.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/LocalKeyValueStorage.java
deleted file mode 100644
index 7293363..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/LocalKeyValueStorage.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * 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.persistence;
-
-import org.apache.ambari.view.ViewContext;
-import org.apache.ambari.view.hive2.utils.MisconfigurationFormattedException;
-import org.apache.commons.configuration.ConfigurationException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-
-/**
- * Persistent storage engine for storing java beans to
- * properties file
- * Path to file should be in 'dataworker.storagePath' parameter
- */
-@Deprecated
-public class LocalKeyValueStorage extends KeyValueStorage {
- private final static Logger LOG =
- LoggerFactory.getLogger(LocalKeyValueStorage.class);
-
- private PersistentConfiguration config = null;
-
- /**
- * Constructor
- * @param context View Context instance
- */
- public LocalKeyValueStorage(ViewContext context) {
- super(context);
- }
-
- /**
- * Returns config instance
- * @return config instance
- */
- @Override
- protected synchronized PersistentConfiguration getConfig() {
- if (config == null) {
- String fileName = context.getProperties().get("dataworker.storagePath");
- if (fileName == null) {
- String msg = "dataworker.storagePath is not configured!";
- LOG.error(msg);
- throw new MisconfigurationFormattedException("dataworker.storagePath");
- }
- try {
- config = new PersistentConfiguration(fileName);
- } catch (ConfigurationException e) {
- e.printStackTrace();
- }
- }
- return config;
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/PersistentConfiguration.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/PersistentConfiguration.java
deleted file mode 100644
index 222225d..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/PersistentConfiguration.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * 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.persistence;
-
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.PropertiesConfiguration;
-import org.apache.commons.configuration.reloading.FileChangedReloadingStrategy;
-
-import java.io.File;
-
-/**
- * Configuration enables all necessary options for PropertiesConfiguration:
- * auto-save, auto-reloading, no delimiter parsing and other
- */
-@Deprecated
-public class PersistentConfiguration extends PropertiesConfiguration {
- /**
- * Constructor
- * @param fileName path to data file
- * @throws ConfigurationException
- */
- public PersistentConfiguration(String fileName) throws ConfigurationException {
- super();
-
- File config = new File(fileName);
- setFile(config);
- this.setAutoSave(true);
- this.setReloadingStrategy(new FileChangedReloadingStrategy());
- this.setDelimiterParsingDisabled(true);
- this.setListDelimiter((char) 0);
-
- if (config.exists()) {
- this.load();
- }
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/Storage.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/Storage.java
deleted file mode 100644
index 2c962ba..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/Storage.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * 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.persistence;
-
-import org.apache.ambari.view.hive2.persistence.utils.FilteringStrategy;
-import org.apache.ambari.view.hive2.persistence.utils.Indexed;
-import org.apache.ambari.view.hive2.persistence.utils.ItemNotFound;
-
-import java.util.List;
-
-/**
- * Object storage interface
- */
-public interface Storage {
- /**
- * Persist object to DB. It should be Indexed
- * @param obj object to save
- */
- <T extends Indexed> void store(Class<T> model, Indexed obj);
-
- /**
- * Load object
- * @param model bean class
- * @param id identifier
- * @return bean instance
- * @throws ItemNotFound thrown if item with id was not found in DB
- */
- <T extends Indexed> T load(Class<T> model, Object id) throws ItemNotFound;
-
- /**
- * Load all objects of given bean class
- * @param model bean class
- * @param filter filtering strategy (return only those objects that conform condition)
- * @param <T> bean class
- * @return list of filtered objects
- */
- <T extends Indexed> List<T> loadAll(Class<? extends T> model, FilteringStrategy filter);
-
- /**
- * Load all objects of given bean class
- * @param model bean class
- * @param <T> bean class
- * @return list of all objects
- */
- <T extends Indexed> List<T> loadAll(Class<T> model);
-
- /**
- * Delete object
- * @param model bean class
- * @param id identifier
- */
- void delete(Class model, Object id) throws ItemNotFound;
-
- /**
- * Check is object exists
- * @param model bean class
- * @param id identifier
- * @return true if exists
- */
- boolean exists(Class model, Object id);
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/ContextConfigurationAdapter.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/ContextConfigurationAdapter.java
deleted file mode 100644
index 8c907b8..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/ContextConfigurationAdapter.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/**
- * 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.persistence.utils;
-
-import org.apache.ambari.view.ViewContext;
-import org.apache.commons.configuration.Configuration;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Persistence API to Apache Configuration adapter
- */
-@Deprecated
-public class ContextConfigurationAdapter implements Configuration {
- private ViewContext context;
-
- /**
- * Constructor of adapter
- * @param context View Context
- */
- public ContextConfigurationAdapter(ViewContext context) {
- this.context = context;
- }
-
- @Override
- public Configuration subset(String prefix) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isEmpty() {
- return context.getInstanceData().isEmpty();
- }
-
- @Override
- public boolean containsKey(String s) {
- Map<String, String> data = context.getInstanceData();
- return data.containsKey(s);
- }
-
- @Override
- public void addProperty(String s, Object o) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setProperty(String s, Object o) {
- context.putInstanceData(s, o.toString());
- }
-
- @Override
- public void clearProperty(String key) {
- context.removeInstanceData(key);
- }
-
- @Override
- public void clear() {
- for (String key : context.getInstanceData().keySet())
- context.removeInstanceData(key);
- }
-
- @Override
- public Object getProperty(String key) {
- return context.getInstanceData(key);
- }
-
- @Override
- public Iterator getKeys(String s) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Iterator getKeys() {
- return context.getInstanceData().keySet().iterator();
- }
-
- @Override
- public Properties getProperties(String s) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean getBoolean(String s) {
- return getBoolean(s, null);
- }
-
- @Override
- public boolean getBoolean(String s, boolean b) {
- return getBoolean(s, (Boolean)b);
- }
-
- @Override
- public Boolean getBoolean(String s, Boolean aBoolean) {
- String data = context.getInstanceData(s);
- return (data != null)?Boolean.parseBoolean(data):aBoolean;
- }
-
- @Override
- public byte getByte(String s) {
- return getByte(s, null);
- }
-
- @Override
- public byte getByte(String s, byte b) {
- return getByte(s, (Byte)b);
- }
-
- @Override
- public Byte getByte(String s, Byte aByte) {
- String data = context.getInstanceData(s);
- return (data != null)?Byte.parseByte(data):aByte;
- }
-
- @Override
- public double getDouble(String s) {
- return getDouble(s, null);
- }
-
- @Override
- public double getDouble(String s, double v) {
- return getDouble(s, (Double)v);
- }
-
- @Override
- public Double getDouble(String s, Double aDouble) {
- String data = context.getInstanceData(s);
- return (data != null)?Double.parseDouble(data):aDouble;
- }
-
- @Override
- public float getFloat(String s) {
- return getFloat(s, null);
- }
-
- @Override
- public float getFloat(String s, float v) {
- return getFloat(s, (Float)v);
- }
-
- @Override
- public Float getFloat(String s, Float aFloat) {
- String data = context.getInstanceData(s);
- return (data != null)?Float.parseFloat(data):aFloat;
- }
-
- @Override
- public int getInt(String s) {
- return getInteger(s, null);
- }
-
- @Override
- public int getInt(String s, int i) {
- return getInteger(s, i);
- }
-
- @Override
- public Integer getInteger(String s, Integer integer) {
- String data = context.getInstanceData(s);
- return (data != null)?Integer.parseInt(data):integer;
- }
-
- @Override
- public long getLong(String s) {
- return getLong(s, null);
- }
-
- @Override
- public long getLong(String s, long l) {
- return getLong(s, (Long)l);
- }
-
- @Override
- public Long getLong(String s, Long aLong) {
- String data = context.getInstanceData(s);
- return (data != null)?Long.parseLong(data):aLong;
- }
-
- @Override
- public short getShort(String s) {
- return getShort(s, null);
- }
-
- @Override
- public short getShort(String s, short i) {
- return getShort(s, (Short)i);
- }
-
- @Override
- public Short getShort(String s, Short aShort) {
- String data = context.getInstanceData(s);
- return (data != null)?Short.parseShort(data):aShort;
- }
-
- @Override
- public BigDecimal getBigDecimal(String s) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public BigDecimal getBigDecimal(String s, BigDecimal bigDecimal) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public BigInteger getBigInteger(String s) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public BigInteger getBigInteger(String s, BigInteger bigInteger) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public String getString(String s) {
- return context.getInstanceData(s);
- }
-
- @Override
- public String getString(String s, String s2) {
- String data = getString(s);
- return (data != null)?data:s2;
- }
-
- @Override
- public String[] getStringArray(String s) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public List getList(String s) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public List getList(String s, List list) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/FilteringStrategy.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/FilteringStrategy.java
deleted file mode 100644
index cec204a..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/FilteringStrategy.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * 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.persistence.utils;
-
-/**
- * Filtering strategy for stored objects
- */
-public interface FilteringStrategy {
- /**
- * Check whether item conforms chosen filter or not
- * @param item item to check
- * @return true if item conforms this filter
- */
- boolean isConform(Indexed item);
- String whereStatement();
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/Indexed.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/Indexed.java
deleted file mode 100644
index c45e32c..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/Indexed.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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.persistence.utils;
-
-/**
- * Interface to represent item with identifier
- */
-public interface Indexed {
- /**
- * Get the ID
- * @return ID
- */
- String getId();
-
- /**
- * Set ID
- * @param id ID
- */
- void setId(String id);
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/ItemNotFound.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/ItemNotFound.java
deleted file mode 100644
index 2433e34..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/ItemNotFound.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * 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.persistence.utils;
-
-/**
- * Thrown when item was not found in DB
- */
-public class ItemNotFound extends Exception {
- public ItemNotFound() {
- }
-
- public ItemNotFound(String message) {
- super(message);
- }
-
- public ItemNotFound(String message, Throwable cause) {
- super(message, cause);
- }
-
- public ItemNotFound(Throwable cause) {
- super(cause);
- }
-
- public ItemNotFound(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
- super(message, cause, enableSuppression, writableStackTrace);
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/OnlyOwnersFilteringStrategy.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/OnlyOwnersFilteringStrategy.java
deleted file mode 100644
index c260ef4..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/OnlyOwnersFilteringStrategy.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/**
- * 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.persistence.utils;
-
-public class OnlyOwnersFilteringStrategy implements FilteringStrategy {
- private final String username;
-
- public OnlyOwnersFilteringStrategy(String username) {
- this.username = username;
- }
-
- @Override
- public boolean isConform(Indexed item) {
- Owned object = (Owned) item;
- return object.getOwner().compareTo(username) == 0;
- }
-
- @Override
- public String whereStatement() {
- return "owner = '" + username + "'";
- }
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/Owned.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/Owned.java
deleted file mode 100644
index afa873b..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/Owned.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * 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.persistence.utils;
-
-/**
- * Interface to represent item with owner
- */
-public interface Owned {
- /**
- * Get the owner
- * @return owner
- */
- String getOwner();
-
- /**
- * Set owner
- * @param owner owner
- */
- void setOwner(String owner);
-}
diff --git a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/PersonalResource.java b/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/PersonalResource.java
deleted file mode 100644
index 02dc2b3..0000000
--- a/contrib/views/hive-next/src/main/java/org/apache/ambari/view/hive2/persistence/utils/PersonalResource.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * 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
- *
... 101721 lines suppressed ...
--
To stop receiving notification emails like this one, please contact
mgergely@apache.org.