Thanks for the quick response. I should have checked jira's more thoroughly.

my 2 cents:

Having an API LensClient.isConnectionOpen that doesn't return "false" when the the connection is closed sounds like an issue to me. As mentioned by Rajat in the jira, isConnectionOpen API can return 410 when the connection needs to be re-established.

regarding the usecase: It is available as a LensClient API for the users to invoke LensInterpreter (i.e via lens-cli) from Zeppelin or for that matter using lens api. Its upto the API implementer to decide on how they implement their use-case i.e. whether they would like to handle using 410 status code or by making two round-trips.

In my Spark integration I want to check if the LensConnection is really open after a long inactivity on spark-shell rather than handling 410 at multiple places.

Quite honestly I can add code to handle 410 as well. Either way is OK.

Regards,
-Pranav.

On 03/11/15 10:50 am, amareshwarisr . wrote:
Can we understand usecases of this api?

Why is LensClient.isConnectionOpen required? Are we suggesting users should
call this for any api call? If that is required, for every call user has to
do two round trips to server.

Right now, all api takes session handle and returns 410 if session is
expired - upon which user can open a new session and try the call again. I
think that is a better option than providing an api for  is current session
valid or not.

I see there is already some discussion on
https://issues.apache.org/jira/browse/LENS-794 regarding this. Please check
if it makes sense.

Thanks
Amareshwari

On Mon, Nov 2, 2015 at 7:22 PM, Pranav Kumar Agarwal <[email protected]>
wrote:

Hi All,

I can see LensClient.isConnectionOpen just checks if the connection was
ever established with the LensServer. However in my opinion it should
rather make a call to Session service and then check if the Hive session is
still valid in HiveSessionService.java.

Also, In HiveSessionService I can see that removal of the key from
SESSION_MAP happens only when an explicit call to closeSession is made,  so
isOpen method in HiveSessionService won't work as is, but we should rather
query cliService to verify if the session is indeed valid.

Thoughts?

If there are no objections to the proposed change in behavior then I'll
file the jira.

Regards,
-Pranav.


Reply via email to