Skip to content

Commit

Permalink
[ozone] adding UI warning if file size is greater then upload_chunk_size
Browse files Browse the repository at this point in the history
  • Loading branch information
agl29 committed Mar 7, 2023
1 parent 07fb2fc commit be6297d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Expand Up @@ -2012,6 +2012,10 @@ else:
});
$("#fileUploader").on('fb:updatePath', function (e, options) {
const uploadingToOzone = self.currentPath().startsWith("ofs://");
if (uploadingToOzone && UPLOAD_CHUNK_SIZE) {
uploader.setOption('sizeLimit', UPLOAD_CHUNK_SIZE);
}
uploader.setParams({
dest: options.dest,
fileFieldLabel: "hdfs_file"
Expand Down
3 changes: 3 additions & 0 deletions desktop/core/src/desktop/js/ext/fileuploader.custom.js
Expand Up @@ -315,6 +315,9 @@ qq.FileUploaderBasic.prototype = {
setParams: function(params){
this._options.params = params;
},
setOption: function(key, val){
this._options[key] = val;
},
getInProgress: function(){
return this._filesInProgress;
},
Expand Down
2 changes: 2 additions & 0 deletions desktop/core/src/desktop/templates/global_js_constants.mako
Expand Up @@ -26,6 +26,7 @@
from beeswax.conf import DOWNLOAD_BYTES_LIMIT, DOWNLOAD_ROW_LIMIT, LIST_PARTITIONS_LIMIT, CLOSE_SESSIONS
from dashboard.conf import HAS_SQL_ENABLED
from hadoop.conf import UPLOAD_CHUNK_SIZE
from jobbrowser.conf import ENABLE_HISTORY_V2
from filebrowser.conf import SHOW_UPLOAD_BUTTON, REMOTE_STORAGE_HOME
from indexer.conf import ENABLE_NEW_INDEXER
Expand Down Expand Up @@ -135,6 +136,7 @@

window.SHOW_NOTEBOOKS = '${ SHOW_NOTEBOOKS.get() }' === 'True'
window.SHOW_UPLOAD_BUTTON = '${ hasattr(SHOW_UPLOAD_BUTTON, 'get') and SHOW_UPLOAD_BUTTON.get() }' === 'True'
window.UPLOAD_CHUNK_SIZE = '${ UPLOAD_CHUNK_SIZE.get() }';

window.IS_MULTICLUSTER_ONLY = '${ IS_MULTICLUSTER_ONLY.get() }' === 'True';
window.IS_K8S_ONLY = '${ IS_K8S_ONLY.get() }' === 'True';
Expand Down

0 comments on commit be6297d

Please sign in to comment.