> On April 12, 2016, 12:46 p.m., Amareshwari Sriramadasu wrote: > > lens-cli/src/main/java/org/apache/lens/cli/commands/BaseLensCommand.java, > > line 127 > > <https://reviews.apache.org/r/45099/diff/1/?file=1308293#file1308293line127> > > > > Hope this is used only in unit tests. Can we reduce the scope? > > > > Also, Commands should not take responsibility for closing these clients. > > > > what happens if we do the following : > > qcom.setclient(client1); > > qcom.setclient(client2); > > > > qcom.closeConnection() would only close client2. > > > > Instead we should leave closing of client1 and client2 to the creaters > > of them.
This setter will be invoked when cli is launched(i.e. LensConnectionCommand is called). This setter is mostly used in test cases. I agree with your point, we can revert LENS-853. In that case, users(or tests cases) should exeplicitly close Lens clients instead of closing Lens commands. - Raju ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/45099/#review128377 ----------------------------------------------------------- On March 21, 2016, 11:47 a.m., Raju Bairishetti wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/45099/ > ----------------------------------------------------------- > > (Updated March 21, 2016, 11:47 a.m.) > > > Review request for lens, Amareshwari Sriramadasu and Rajat Khandelwal. > > > Bugs: lens-991 > https://issues.apache.org/jira/browse/lens-991 > > > Repository: lens > > > Description > ------- > > Shutdown hook was getting called for each lens **command bean** whenver we do > ctrl+c on cli. > > > Diffs > ----- > > lens-cli/src/main/java/org/apache/lens/cli/commands/BaseLensCommand.java > be1ca12 > src/site/apt/user/client-config.apt 714db18 > > Diff: https://reviews.apache.org/r/45099/diff/ > > > Testing > ------- > > **Before applying patch:** > > lens-shell>show cubes > No cube found > lens-shell>show params > ... > lens-shell>Exception in thread "Thread-3" java.lang.IllegalStateException: > Unable to close lens connection with params > LensConnectionParams{dbName='default', baseUrl='http://0.0.0.0:9999/lensapi', > user=anonymous, lensConfs={}, lensVars={}, sessionVars={}} > at org.apache.lens.client.LensConnection.close(LensConnection.java:206) > at > org.apache.lens.client.LensClient.closeConnection(LensClient.java:326) > at > org.apache.lens.cli.commands.BaseLensCommand.closeClientConnection(BaseLensCommand.java:92) > at > org.apache.lens.cli.commands.BaseLensCommand$2.run(BaseLensCommand.java:81) > LZDLocalAdmins-MacBook-Pro-2:client rajubairishetti$ > > > > **After aplying patch:** > > lens-shell>show cubes > No cube found > lens-shell>show params > ... > lens-shell>LZDLocalAdmins-MacBook-Pro-2:client rajubairishetti$ > > > Thanks, > > Raju Bairishetti > >
