-
Notifications
You must be signed in to change notification settings - Fork 603
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,26 +17,12 @@ | |
|
||
package org.apache.livy.rsc; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.net.URI; | ||
import java.nio.ByteBuffer; | ||
import java.util.Map; | ||
import java.util.UUID; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
import java.util.concurrent.Future; | ||
import java.util.concurrent.TimeUnit; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
import io.netty.channel.ChannelHandlerContext; | ||
import io.netty.channel.EventLoopGroup; | ||
import io.netty.channel.nio.NioEventLoopGroup; | ||
import io.netty.util.concurrent.GenericFutureListener; | ||
import io.netty.util.concurrent.ImmediateEventExecutor; | ||
import io.netty.util.concurrent.Promise; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import org.apache.livy.Job; | ||
import org.apache.livy.JobHandle; | ||
import org.apache.livy.LivyClient; | ||
|
@@ -45,8 +31,22 @@ | |
import org.apache.livy.rsc.driver.AddJarJob; | ||
import org.apache.livy.rsc.rpc.Rpc; | ||
import org.apache.livy.sessions.SessionState; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import static org.apache.livy.rsc.RSCConf.Entry.*; | ||
import java.io.File; | ||
import java.io.IOException; | ||
import java.net.URI; | ||
import java.nio.ByteBuffer; | ||
import java.util.Map; | ||
import java.util.UUID; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
import java.util.concurrent.Future; | ||
import java.util.concurrent.TimeUnit; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
import static org.apache.livy.rsc.RSCConf.Entry.CLIENT_SHUTDOWN_TIMEOUT; | ||
import static org.apache.livy.rsc.RSCConf.Entry.RPC_MAX_THREADS; | ||
|
||
public class RSCClient implements LivyClient { | ||
private static final Logger LOG = LoggerFactory.getLogger(RSCClient.class); | ||
|
@@ -426,10 +426,15 @@ private void handle(ChannelHandlerContext ctx, ReplState msg) { | |
LOG.trace("Received repl state for {}", msg.state); | ||
// Update last activity timestamp when state change is from busy to idle. | ||
if (SessionState.Busy$.MODULE$.state().equals(replState) && msg != null && | ||
SessionState.Idle$.MODULE$.state().equals(msg.state)) { | ||
SessionState.Idle$.MODULE$.state().equals(msg.state)) { | ||
replLastActivity = System.nanoTime(); | ||
} | ||
replState = msg.state; | ||
} | ||
} | ||
@Override | ||
public String getSessionAppId(){throw new UnsupportedOperationException();} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
||
@Override | ||
public int getSessionId(){throw new UnsupportedOperationException();} | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.