Эх сурвалжийг харах

HUE-3865 [editor] Flag to enable the query scheduling

Romain Rigaux 9 жил өмнө
parent
commit
6934b3f33d

+ 3 - 0
desktop/conf.dist/hue.ini

@@ -674,6 +674,9 @@
   ## Flag to enable the SQL query builder of the table assist.
   ## Flag to enable the SQL query builder of the table assist.
   # enable_query_builder=true
   # enable_query_builder=true
 
 
+  ## Flag to enable the creation of a coordinator for the current SQL query.
+  # enable_query_scheduling=true
+
 
 
 ###########################################################################
 ###########################################################################
 # Settings to configure your Hadoop cluster.
 # Settings to configure your Hadoop cluster.

+ 3 - 0
desktop/conf/pseudo-distributed.ini.tmpl

@@ -678,6 +678,9 @@
   ## Flag to enable the SQL query builder of the table assist.
   ## Flag to enable the SQL query builder of the table assist.
   # enable_query_builder=true
   # enable_query_builder=true
 
 
+  ## Flag to enable the creation of a coordinator for the current SQL query.
+  # enable_query_scheduling=true
+
 
 
 ###########################################################################
 ###########################################################################
 # Settings to configure your Hadoop cluster.
 # Settings to configure your Hadoop cluster.

+ 11 - 2
desktop/libs/notebook/src/notebook/conf.py

@@ -80,13 +80,22 @@ ENABLE_DBPROXY_SERVER = Config(
   key="enable_dbproxy_server",
   key="enable_dbproxy_server",
   help=_t("Main flag to override the automatic starting of the DBProxy server."),
   help=_t("Main flag to override the automatic starting of the DBProxy server."),
   type=bool,
   type=bool,
-  default=True)
+  default=True
+)
 
 
 ENABLE_QUERY_BUILDER = Config(
 ENABLE_QUERY_BUILDER = Config(
   key="enable_query_builder",
   key="enable_query_builder",
   help=_t("Flag to enable the SQL query builder of the table assist."),
   help=_t("Flag to enable the SQL query builder of the table assist."),
   type=bool,
   type=bool,
-  default=True)
+  default=True
+)
+
+ENABLE_QUERY_SCHEDULING = Config(
+  key="enable_query_scheduling",
+  help=_t("Flag to enable the creation of a coordinator for the current SQL query."),
+  type=bool,
+  default=True
+)
 
 
 GITHUB_REMOTE_URL = Config(
 GITHUB_REMOTE_URL = Config(
     key="github_remote_url",
     key="github_remote_url",

+ 2 - 2
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -19,7 +19,7 @@ from desktop import conf
 from desktop.lib.i18n import smart_unicode
 from desktop.lib.i18n import smart_unicode
 from django.utils.translation import ugettext as _
 from django.utils.translation import ugettext as _
 from desktop.views import _ko
 from desktop.views import _ko
-from notebook.conf import ENABLE_QUERY_BUILDER
+from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING
 %>
 %>
 
 
 <%namespace name="require" file="/require.mako" />
 <%namespace name="require" file="/require.mako" />
@@ -203,7 +203,7 @@ ${ hueIcons.symbols() }
           <i class="fa fa-cogs"></i>
           <i class="fa fa-cogs"></i>
         </a>
         </a>
 
 
-        % if mode == 'editor':
+        % if mode == 'editor' and ENABLE_QUERY_SCHEDULING.get():
         <div class="btn-group">
         <div class="btn-group">
           <a class="btn" title="${ _('Schedule') }" rel="tooltip" data-placement="bottom" data-bind="click: function() { if ($root.selectedNotebook() && $root.selectedNotebook().id()) { $root.selectedNotebook().schedule() } }, css: {'disabled': ! $root.selectedNotebook() || ! $root.selectedNotebook().id() }">
           <a class="btn" title="${ _('Schedule') }" rel="tooltip" data-placement="bottom" data-bind="click: function() { if ($root.selectedNotebook() && $root.selectedNotebook().id()) { $root.selectedNotebook().schedule() } }, css: {'disabled': ! $root.selectedNotebook() || ! $root.selectedNotebook().id() }">
             <i class="fa fa-fw fa-calendar"></i>
             <i class="fa fa-fw fa-calendar"></i>