Bläddra i källkod

HUE-3078 [impala] Drop the remember invalidate decision from assist refresh and add flush_all = true

Johan Ahlen 9 år sedan
förälder
incheckning
ed7f55f

+ 0 - 2
desktop/core/src/desktop/static/desktop/js/assist/assistDbEntry.js

@@ -54,8 +54,6 @@
     self.isSearchVisible = assistDbSource.isSearchVisible;
     self.editingSearch = ko.observable(false);
     self.sourceType = self.assistDbSource.sourceType;
-    self.dontAskForInvalidate = self.assistDbSource.dontAskForInvalidate;
-    self.dontAskForInvalidateTemp = self.assistDbSource.dontAskForInvalidateTemp;
     self.invalidateOnRefresh =  self.assistDbSource.invalidateOnRefresh;
 
     self.expandable = typeof definition.type === "undefined" || /table|view|struct|array|map/i.test(definition.type);

+ 2 - 6
desktop/core/src/desktop/static/desktop/js/assist/assistDbSource.js

@@ -45,11 +45,7 @@
     self.isSearchVisible = ko.observable(false);
     self.editingSearch = ko.observable(false);
 
-    self.dontAskForInvalidate = ko.observable();
-    self.dontAskForInvalidateTemp = ko.observable();
-    self.assistHelper.withTotalStorage('assist', 'dontAskForInvalidate', self.dontAskForInvalidate, false);
-    self.invalidateOnRefresh = ko.observable();
-    self.assistHelper.withTotalStorage('assist', 'invalidateOnRefresh', self.invalidateOnRefresh, true);
+    self.invalidateOnRefresh = ko.observable(false);
 
     self.filter = {
       query: ko.observable("").extend({ rateLimit: 150 })
@@ -193,6 +189,7 @@
         clearAll: true,
         invalidateImpala: self.invalidateOnRefresh()
       });
+      self.invalidateOnRefresh(false);
       self.initDatabases();
     };
 
@@ -211,7 +208,6 @@
 
   AssistDbSource.prototype.triggerRefresh = function () {
     var self = this;
-    self.dontAskForInvalidate(self.dontAskForInvalidateTemp());
     huePubSub.publish('assist.db.refresh', self.sourceType);
   };
 

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/assist/assistHelper.js

@@ -509,7 +509,7 @@
     };
 
     if (options.sourceType === 'impala' && self.invalidateImpala) {
-      $.post(IMPALA_INVALIDATE_API, loadFunction);
+      $.post(IMPALA_INVALIDATE_API, { flush_all: true }, loadFunction);
     } else {
       loadFunction();
     }

+ 2 - 8
desktop/core/src/desktop/templates/assist.mako

@@ -581,9 +581,8 @@ from desktop.views import _ko
 
   <script type="text/html" id="ask-for-invalidate-content">
     <label class="checkbox" style="margin-bottom: 2px;"><input type="checkbox" data-bind="checked: invalidateOnRefresh" /> ${ _('Invalidate metadata') }</label>
-    <div style="display: inline-block; margin-left: 20px; font-style: italic">${ _('This could take a noticeable amount of time') }</div>
-    <label class="checkbox" style="margin-top: 4px;"><input type="checkbox" data-bind="checked: dontAskForInvalidateTemp" /> ${ _('Remember my decision') }</label>
-    <div style="width: 100%; display: inline-block; margin-top: 5px;"><button class="pull-right btn btn-primary" data-bind="click: function () { huePubSub.publish('close.popover'); triggerRefresh(); }, clickBubble: false">${ _('Refresh') }</button></div>
+    <div style="display: inline-block; margin-left: 20px; font-style: italic">${ _('This is a resource- and time-intensive operation that will rebuild the entire metadata store index.') }</div>
+    <div style="width: 100%; display: inline-block; margin-top: 5px;"><button class="pull-right btn btn-primary" data-bind="css: { 'btn-primary': !invalidateOnRefresh(), 'btn-danger': invalidateOnRefresh }, click: function () { huePubSub.publish('close.popover'); triggerRefresh(); }, clickBubble: false">${ _('Refresh') }</button></div>
   </script>
 
   <script type="text/html" id="assist-db-header-actions">
@@ -592,13 +591,8 @@ from desktop.views import _ko
       <!-- ko ifnot: loading -->
       <a class="inactive-action" href="javascript:void(0)" data-bind="click: toggleSearch, css: { 'blue' : isSearchVisible }"><i class="pointer fa fa-search" title="${_('Search')}"></i></a>
       <!-- ko if: sourceType === 'impala' -->
-      <!-- ko if: dontAskForInvalidate -->
-      <a class="inactive-action" href="javascript:void(0)" data-bind="click: triggerRefresh"><i class="pointer fa fa-refresh" data-bind="css: { 'fa-spin blue' : loading }" title="${_('Manually refresh the table list')}"></i></a>
-      <!-- /ko -->
-      <!-- ko ifnot: dontAskForInvalidate -->
       <a class="inactive-action" href="javascript:void(0)" data-bind="templatePopover : { contentTemplate: 'ask-for-invalidate-content', titleTemplate: 'ask-for-invalidate-title', trigger: 'click', minWidth: '320px' }"><i class="pointer fa fa-refresh" data-bind="css: { 'fa-spin blue' : loading }" title="${_('Manually refresh the table list')}"></i></a>
       <!-- /ko -->
-      <!-- /ko -->
       <!-- ko if: sourceType !== 'impala' -->
       <a class="inactive-action" href="javascript:void(0)" data-bind="click: triggerRefresh"><i class="pointer fa fa-refresh" data-bind="css: { 'fa-spin blue' : loading }" title="${_('Manually refresh the table list')}"></i></a>
       <!-- /ko -->