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

Added support for multiple Azkaban Host URL #342

Merged
merged 1 commit into from
Feb 27, 2018

Conversation

mkumar1984
Copy link
Contributor

Currently Auto Tuning does not support job execution IDs from different azkaban host and it fails while calling azkaban rest api. This PR have changes to support multiple azkaban host and it also takes care of creating new session every hour for azkaban rest api.

* Constructor of the class
* @param url
*/
public AzkabanJobStatusUtil(String url) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this class can be marked as a singleton?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is not thread safe, whoever is using this class need to make sure that it runs only one request at a time. So we need to first make it thread safe or make it a utility kind of class before making it singleton.

Copy link
Contributor

@akshayrai akshayrai Feb 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not happy with keeping the login state in a utility method. Ideally, the login should be done in a separate class (workflowClient itself) and then you can call this utility method by passing the workflowClient object to it. This way the login can be reused for other utilities and the utility methods also remain stateless and easily testable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently also login method is called form outside. As we discussed we will create a task to refactor this and take it up with in one month.

_workflowClient.setURL(execUrl);
return _workflowClient.getJobsFromFlow();
AzkabanWorkflowClient workflowClient = getWorkflowClient(execUrl);
workflowClient.setURL(execUrl);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required? Doesn't the previous line already return the updated client for the url.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, first line is only returning the workflowClient, next line is setting the url.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The url seems to be already set when you call getWorkflowClient(execUrl). The explicit setURL in the next line seems redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are talking about this code getWorkflowClientInstance(scheduler, url), then this is only getting called when first time WorkflowClient is created, after that it will always pick up from the map.

@akshayrai
Copy link
Contributor

I have approved the changes only to unblock you guys. Please make sure you address them asap.

@akshayrai akshayrai merged commit 79bb59f into linkedin:master Feb 27, 2018
pralabhkumar pushed a commit to pralabhkumar/dr-elephant that referenced this pull request Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants