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

Enabling Dr Elephant to work with YARN in HTTPS mode #475

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

shahrukhkhan489
Copy link
Contributor

@shahrukhkhan489 shahrukhkhan489 commented Nov 7, 2018

This pull request is to address #472

Configuration value of the property - yarn.http.policy which can have either of the values - HTTP_ONLY / HTTPS_ONLY, defines whether YARN is in HTTPS mode

Changes Addressed to below files -

  1. TezFetcher
  2. AnalyticJobGeneratorHadoop2

If statement inserted to check the configuration value of the property - yarn.http.policy which can have either of the values - HTTP_ONLY / HTTPS_ONLY. Based on the value below properties need to be addressed

RESOURCE_MANAGER_ADDRESS as yarn.resourcemanager.webapp.address or yarn.resourcemanager.webapp.https.address

RM_NODE_STATE_URL as http://%s/ws/v1/cluster/info or https://%s/ws/v1/cluster/info

succeededAppsURL and failedAppsURL as new URL("http://" + _resourceManagerAddress) or new URL("https://" + _resourceManagerAddress)

@@ -67,6 +72,31 @@
private final ArrayList<AnalyticJob> _secondRetryQueue = new ArrayList<AnalyticJob>();

public void updateResourceManagerAddresses() {

String rm_http_policy = configuration.get(RM_HTTP_POLICY);
Copy link
Contributor

Choose a reason for hiding this comment

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

please follow naming convention

Copy link
Contributor

Choose a reason for hiding this comment

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

Please move your code to seperate method , as it makes this method really long

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@pralabhkumar
Copy link
Contributor

pralabhkumar commented Dec 17, 2018

@shahrukhkhan489 Add unit test cases to check the functionality


//Assigning URL's a header of http:// or https:// depending if YARN https is enabled or not
private static String RM_URL_HEADER;
private static String RESOURCE_MANAGER_ADDRESS;
Copy link
Contributor

@varunsaxena varunsaxena Dec 18, 2018

Choose a reason for hiding this comment

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

Any specific reason to make these 3 variables static? In fact, RESOURCE_MANAGER_ADDRESS may not even need to be a member variable.

@@ -145,8 +167,8 @@ private URL getTaskAttemptURL(String dagId, String taskId, String attemptId) thr

private String _timelineWebAddr;

private URLFactory(String hserverAddr) throws IOException {
_timelineWebAddr = "http://" + hserverAddr + "/ws/v1/timeline";
private URLFactory(String hserverAddr,String RM_URL_HEADER) throws IOException {
Copy link
Contributor

@varunsaxena varunsaxena Dec 18, 2018

Choose a reason for hiding this comment

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

Kindy follow naming convention for method parameters.


private URLFactory _urlFactory;
private JSONFactory _jsonFactory;
private String _timelineWebAddr;

private FetcherConfigurationData _fetcherConfigurationData;
private static String RM_URL_HEADER;
private static String TIMELINE_SERVER_URL;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these be static?

private static final String FETCH_INITIAL_WINDOW_MS = "drelephant.analysis.fetch.initial.windowMillis";


//Assigning URL's a header of http:// or https:// depending if YARN https is enabled or not
private static String RM_URL_HEADER;
Copy link
Contributor

Choose a reason for hiding this comment

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

http:// or https:// refers to URL scheme instead of header. Rename the variable name accordingly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updating object name from RM_URL_HEADER to RM_URL_SCHEME


private URLFactory _urlFactory;
private JSONFactory _jsonFactory;
private String _timelineWebAddr;

private FetcherConfigurationData _fetcherConfigurationData;
private static String RM_URL_HEADER;
Copy link
Contributor

@varunsaxena varunsaxena Dec 18, 2018

Choose a reason for hiding this comment

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

Should be TIMELINE_SERVER_URL_PREFIX/SCHEME

@varunsaxena
Copy link
Contributor

@shahrukhkhan489 can you check the Travis CI build failure. It has failed due to drop in coverage

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.

3 participants