Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HS2 JDBC URL for Oozie Workflow via config param #3961

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading