belugabehr commented on a change in pull request #1946: URL: https://github.com/apache/hive/pull/1946#discussion_r580519970
########## File path: service/src/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java ########## @@ -147,15 +151,81 @@ protected ThreadLocal<ServerContext> currentServerContext; + /** + * A context container for information related to client connections to the + * Thrift server. + */ static class ThriftCLIServerContext implements ServerContext { - private SessionHandle sessionHandle = null; - public void setSessionHandle(SessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; + private final long createTime; + private final Collection<SessionHandle> hiveSessionHandles; Review comment: It is my understanding, that in the context of something like a JDBC Database connection pool, a connection to Hive can be re-used, in which case, a single connection can have many Session handles associated with it (sequentially, over time). I can think of a scenario where it might be helpful to have a history size of one: if something about one session breaks something that then cascades to the next session. I picked four arbitrarily, but this number can be adjusted once it's used a bit and see if it's helpful or not. I believe you already figured this out, but just to be clear, the Collection I am using is initialized with capacity of 4 and beyond that, all new entries remove the oldest entry; it keeps a running list of the last 4 session handles. The size shouldn't be unbounded because, as I understand it, there is no limit on the number of sessions that a single connection can have. ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org