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

[LIVY-891] Expose the sessionID via the client APIs [WIP] #348

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

Conversation

haripriya-b
Copy link

https://issues.apache.org/jira/browse/LIVY-891

What changes were proposed in this pull request?

Currently getSessionID() is exposed in HttpClient only for testing purposes. Since the internally created session ID is useful to doing operations such as re-connecting to the session, killing the session etc., it will be useful to expose it as a public api in HttpClient and LivyClient. (Include a link to the associated JIRA and make sure to add a link to this pr on the JIRA as well)

How was this patch tested?

(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)

Please review https://livy.incubator.apache.org/community/ before opening a pull request.

Copy link
Contributor

@lmccay lmccay left a comment

Choose a reason for hiding this comment

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

One minor change requested.

import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.*;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not use wildcard imports to pull in everything in a package.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you, @lmccay. I've updated the files. Can you please review the changes.

@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2023

Codecov Report

Merging #348 (2369bdc) into master (4d8a912) will decrease coverage by 0.20%.
The diff coverage is 76.92%.

@@             Coverage Diff              @@
##             master     #348      +/-   ##
============================================
- Coverage     68.50%   68.29%   -0.21%     
- Complexity      841      843       +2     
============================================
  Files           103      103              
  Lines          5940     5968      +28     
  Branches        898      907       +9     
============================================
+ Hits           4069     4076       +7     
- Misses         1312     1331      +19     
- Partials        559      561       +2     
Impacted Files Coverage Δ
...c/src/main/java/org/apache/livy/rsc/RSCClient.java 72.61% <0.00%> (-0.88%) ⬇️
...n/java/org/apache/livy/client/http/HttpClient.java 85.71% <100.00%> (+0.23%) ⬆️
...c/main/scala/org/apache/livy/repl/ReplDriver.scala 27.27% <0.00%> (-8.63%) ⬇️
...ain/scala/org/apache/livy/utils/SparkYarnApp.scala 72.61% <0.00%> (-2.39%) ⬇️
...ain/java/org/apache/livy/rsc/driver/RSCDriver.java 79.66% <0.00%> (-1.17%) ⬇️
...scala/org/apache/livy/repl/PythonInterpreter.scala 44.17% <0.00%> (ø)
...rg/apache/livy/repl/AbstractSparkInterpreter.scala 57.14% <0.00%> (ø)
...main/scala/org/apache/livy/server/LivyServer.scala 32.14% <0.00%> (+0.44%) ⬆️
...cala/org/apache/livy/scalaapi/ScalaJobHandle.scala 65.11% <0.00%> (+2.32%) ⬆️
...ala/org/apache/livy/utils/LineBufferedStream.scala 82.92% <0.00%> (+2.43%) ⬆️
... and 1 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@haripriya-b haripriya-b marked this pull request as ready for review January 4, 2023 22:47
Copy link
Contributor

@lmccay lmccay left a comment

Choose a reason for hiding this comment

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

Left a comment that questions the appropriateness of this as an extension to LivyClient given that RSCClient is throwing an UnsupportedOperationException. Given that it represents half of the implementations of LivyClient, it seems like consumers of the interface shouldn't encounter a runtime exception from a couple new getters. It also strikes me as odd to need to add a new dependency on livy-api to rsc/pom.xml in order to throw and UnsupportedOperationException. There is code across the project using expecting to us the LivyClient interface - maybe I am missing something there.

replLastActivity = System.nanoTime();
}
replState = msg.state;
}
}
@Override
public String getSessionAppId(){throw new UnsupportedOperationException();}
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to me that this is pointing to the fact that it is an inappropriate extension to the interface.
If there are only 2 implementations of the interface and 1 of them throws exceptions for this methods then I don't think they are appropriate for the interface. What is the story here? Session ID isn't known within RSCClient usage?

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