Skip to content

Commit

Permalink
HS2 JDBC URL for Oozie Workflow via config param (#3961)
Browse files Browse the repository at this point in the history
  • Loading branch information
quadoss and [email protected] authored Jan 22, 2025
1 parent d610479 commit afc3806
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions apps/oozie/src/oozie/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@
),
)

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'''
Expand Down
4 changes: 2 additions & 2 deletions apps/oozie/src/oozie/models2.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
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

Expand Down Expand Up @@ -830,7 +830,7 @@ def to_xml(self, mapping=None, node_mapping=None, workflow_mapping=None):
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]
Expand Down
3 changes: 3 additions & 0 deletions desktop/conf.dist/hue.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions desktop/conf/pseudo-distributed.ini.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit afc3806

Please sign in to comment.