[
https://issues.apache.org/jira/browse/SUBMARINE-60?focusedWorklogId=346796&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-346796
]
ASF GitHub Bot logged work on SUBMARINE-60:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 20/Nov/19 15:16
Start Date: 20/Nov/19 15:16
Worklog Time Spent: 10m
Work Description: adamantal commented on pull request #96: SUBMARINE-60.
Remove stubServiceClient from YarnServiceUtils
URL: https://github.com/apache/submarine/pull/96
### What is this PR for?
Remove stubServiceClient from YarnServiceUtils and introduce a Factory based
injecting solution. (See jira for further details)
### What type of PR is it?
Refactoring
### Todos
* [ ] - Check whether the refactored test passes.
### What is the Jira issue?
* https://issues.apache.org/jira/browse/SUBMARINE-60
### How should this be tested?
* No need for integration testing, just the UTs.
### Screenshots (if appropriate)
-
### Questions:
* Does the licenses files need update? No
* Is there breaking changes for older versions? No
* Does this needs documentation? No
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 346796)
Remaining Estimate: 0h
Time Spent: 10m
> Remove stubServiceClient from YarnServiceUtils
> ----------------------------------------------
>
> Key: SUBMARINE-60
> URL: https://issues.apache.org/jira/browse/SUBMARINE-60
> Project: Apache Submarine
> Issue Type: Improvement
> Reporter: Szilard Nemeth
> Assignee: Adam Antal
> Priority: Major
> Labels: pull-request-available
> Attachments: SUBMARINE-60.001.patch, SUBMARINE-60.002.patch,
> SUBMARINE-60.002.patch, SUBMARINE-60.003.patch, SUBMARINE-60.003.patch,
> SUBMARINE-60.003.patch
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> We have a field in YarnServiceUtils:
> org.apache.hadoop.yarn.submarine.runtimes.yarnservice.YarnServiceUtils#stubServiceClient
> There's a setter for this field, marked with VisibleForTesting and the test
> code uses this setter to set the value of this field to a mock.
> Then, when createServiceClient gets called from the production code, it first
> checks if we have this field set. If so, we return it, otherwise we create a
> normal app admin client.
> This is an anti-pattern to just have test-related fields or methods in the
> production code.
>
> Currently, YarnServiceJobSubmitter and YarnServiceJobMonitor are the only
> users of
> org.apache.hadoop.yarn.submarine.runtimes.yarnservice.YarnServiceUtils#createServiceClient.
> This static could be easily replaced with a factory that receives the current
> Configuration object then returns the AppAdminClient. The test should inject
> the mock factory either via the constructor or with a setter.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]