Преглед изворни кода

HS2 JDBC URL for Oozie Workflow via config param (#3961)

Co-authored-by: mbalakrishnan@cloudera.com <mbalakrishnan@MacBook-Pro.hsd1.ca.comcast.net>
Mahesh Balakrishnan пре 10 месеци
родитељ
комит
afc3806f8e

+ 7 - 0
apps/oozie/src/oozie/conf.py

@@ -61,6 +61,13 @@ REMOTE_SAMPLE_DIR = Config(
   ),
 )
 
+OOZIE_HS2_JDBC_URL = Config(
+    key="oozie_hs2_jdbc_url",
+    help="The JDBC URL for HiveServer2 action",
+    type=str,
+    default=""
+)
+
 
 def get_oozie_job_count():
   '''Returns the maximum of jobs fetched by the API depending on the Hue version'''

+ 2 - 2
apps/oozie/src/oozie/models2.py

@@ -50,7 +50,7 @@ from liboozie.conf import SECURITY_ENABLED
 from liboozie.oozie_api import get_oozie
 from liboozie.submission2 import Submission, create_directories
 from notebook.models import Notebook
-from oozie.conf import REMOTE_SAMPLE_DIR
+from oozie.conf import OOZIE_HS2_JDBC_URL, REMOTE_SAMPLE_DIR
 from oozie.importlib.workflows import InvalidTagWithNamespaceException, MalformedWfDefException, generate_v2_graph_nodes
 from oozie.utils import UTC_TIME_FORMAT, convert_to_server_timezone, utc_datetime_format
 
@@ -830,7 +830,7 @@ class Node(object):
       workflow_mapping = {}
 
     if self.data['type'] in ('hive2', 'hive-document') and not self.data['properties']['jdbc_url']:
-      self.data['properties']['jdbc_url'] = _get_hiveserver2_url()
+      self.data['properties']['jdbc_url'] = OOZIE_HS2_JDBC_URL.get() if OOZIE_HS2_JDBC_URL.get() else _get_hiveserver2_url()
 
     if self.data['type'] == 'fork':
       links = [link for link in self.data['children'] if link['to'] in node_mapping]

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

@@ -1689,6 +1689,9 @@ submit_to=True
 # Parameters are $TIME and $USER, e.g. /user/$USER/hue/workspaces/workflow-$TIME
 ## remote_data_dir=/user/hue/oozie/workspaces
 
+# JDBC URL for Hive2 action
+## oozie_hs2_jdbc_url=jdbc:hive2://localhost:10000/default
+
 # Maximum of Oozie workflows or coodinators to retrieve in one API call.
 ## oozie_jobs_count=100
 

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

@@ -1673,6 +1673,9 @@
   # Parameters are $TIME and $USER, e.g. /user/$USER/hue/workspaces/workflow-$TIME
   ## remote_data_dir=/user/hue/oozie/workspaces
 
+  # JDBC URL for Hive2 action
+  ## oozie_hs2_jdbc_url=jdbc:hive2://localhost:10000/default
+
   # Maximum of Oozie workflows or coodinators to retrieve in one API call.
   ## oozie_jobs_count=100