Reamer commented on code in PR #4668:
URL: https://github.com/apache/zeppelin/pull/4668#discussion_r1352293951
##########
python/src/main/java/org/apache/zeppelin/python/PythonUtils.java:
##########
@@ -37,35 +36,22 @@ public class PythonUtils {
public static GatewayServer createGatewayServer(Object entryPoint,
String serverAddress,
int port,
- String secretKey,
- boolean useAuth) throws
IOException {
- LOGGER.info("Launching GatewayServer at " + serverAddress + ":" + port +
- ", useAuth: " + useAuth);
- if (useAuth) {
- try {
- Class clz = Class.forName("py4j.GatewayServer$GatewayServerBuilder",
true,
- Thread.currentThread().getContextClassLoader());
- Object builder =
clz.getConstructor(Object.class).newInstance(entryPoint);
- builder.getClass().getMethod("authToken",
String.class).invoke(builder, secretKey);
- builder.getClass().getMethod("javaPort", int.class).invoke(builder,
port);
- builder.getClass().getMethod("javaAddress",
InetAddress.class).invoke(builder,
- InetAddress.getByName(serverAddress));
- builder.getClass()
- .getMethod("callbackClient", int.class, InetAddress.class,
String.class)
- .invoke(builder, port, InetAddress.getByName(serverAddress),
secretKey);
- return (GatewayServer)
builder.getClass().getMethod("build").invoke(builder);
- } catch (Exception e) {
- throw new IOException(e);
- }
- } else {
- return new GatewayServer(entryPoint,
- port,
- GatewayServer.DEFAULT_PYTHON_PORT,
- InetAddress.getByName(serverAddress),
- InetAddress.getByName(serverAddress),
- GatewayServer.DEFAULT_CONNECT_TIMEOUT,
- GatewayServer.DEFAULT_READ_TIMEOUT,
- (List) null);
+ String secretKey) throws
IOException {
+ LOGGER.info("Launching GatewayServer at {}:{}", serverAddress, port);
+ try {
+ Class clz = Class.forName("py4j.GatewayServer$GatewayServerBuilder",
true,
Review Comment:
Great.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]