> On Dec. 24, 2015, 8:47 a.m., Rajat Khandelwal wrote: > > lens-server/src/main/java/org/apache/lens/server/metastore/CubeMetastoreServiceImpl.java, > > line 1217 > > <https://reviews.apache.org/r/41687/diff/1/?file=1175339#file1175339line1217> > > > > Can you describe what is the exception thrown? > > Deepak Barr wrote: > So, this is what happens. Lets say you fired getNativeTables API using a > session, then, you get a metastoreclient instance by > getSession(sessionid).getMetaStoreClient(). In finally, you close the > metastoreclient. Now, if you call the getNativeTables API again, > getSession(sessionid).getMetaStoreClient() will return the same > metastoreclient instance that you closed in previous call. So, when you do > metastoreclient.getAllTables(), you get the following exception - > > > org.apache.thrift.transport.TTransportException: Cannot write to null > outputStream > at > org.apache.thrift.transport.TIOStreamTransport.write(TIOStreamTransport.java:142) > ~[libthrift-0.9.0.jar:0.9.0] > at > org.apache.thrift.protocol.TBinaryProtocol.writeI32(TBinaryProtocol.java:163) > ~[libthrift-0.9.0.jar:0.9.0] > at > org.apache.thrift.protocol.TBinaryProtocol.writeMessageBegin(TBinaryProtocol.java:91) > ~[libthrift-0.9.0.jar:0.9.0] > at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62) > ~[libthrift-0.9.0.jar:0.9.0] > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.send_get_database(ThriftHiveMetastore.java:538) > ~[hive-metastore-0.13.3-inm.jar:0.13.3-inm] > at > org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.get_database(ThriftHiveMetastore.java:530) > ~[hive-metastore-0.13.3-inm.jar:0.13.3-inm] > at > org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getDatabase(HiveMetaStoreClient.java:970) > ~[hive-metastore-0.13.3-inm.jar:0.13.3-inm] > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > ~[na:1.8.0_45] > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > ~[na:1.8.0_45] > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > ~[na:1.8.0_45] > at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_45] > at > org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.invoke(RetryingMetaStoreClient.java:89) > ~[hive-metastore-0.13.3-inm.jar:0.13.3-inm] > at com.sun.proxy.$Proxy7.getDatabase(Unknown Source) [na:na] > at org.apache.hadoop.hive.ql.metadata.Hive.getDatabase(Hive.java:1156) > [hive-exec-0.13.3-inm.jar:0.13.3-inm] > at org.apache.hadoop.hive.ql.metadata.Hive.databaseExists(Hive.java:1145) > [hive-exec-0.13.3-inm.jar:0.13.3-inm] > at > org.apache.lens.server.metastore.CubeMetastoreServiceImpl.getAllNativeTableNames(CubeMetastoreServiceImpl.java:1229) > > Rajat Khandelwal wrote: > Understood. So metastore client is always closed on session close?
Yes. HiveSessionImpl.close() closes the metastoreclient. - Deepak ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/41687/#review111829 ----------------------------------------------------------- On Dec. 23, 2015, 12:10 p.m., Deepak Barr wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/41687/ > ----------------------------------------------------------- > > (Updated Dec. 23, 2015, 12:10 p.m.) > > > Review request for lens. > > > Bugs: LENS-907 > https://issues.apache.org/jira/browse/LENS-907 > > > Repository: lens > > > Description > ------- > > Removed metatoreClient.close() on getNativeTablesFromDB() call. So, The > metastore client will close only on session close. > > > Diffs > ----- > > > lens-server/src/main/java/org/apache/lens/server/metastore/CubeMetastoreServiceImpl.java > 66ed938 > > Diff: https://reviews.apache.org/r/41687/diff/ > > > Testing > ------- > > Yes. > > [INFO] > ------------------------------------------------------------------------ > [INFO] Reactor Summary: > [INFO] > [INFO] Lens Checkstyle Rules .............................. SUCCESS [ 3.275 > s] > [INFO] Lens ............................................... SUCCESS [ 6.600 > s] > [INFO] Lens API ........................................... SUCCESS [ 26.217 > s] > [INFO] Lens API for server and extensions ................. SUCCESS [ 22.673 > s] > [INFO] Lens Cube .......................................... SUCCESS [10:30 > min] > [INFO] Lens DB storage .................................... SUCCESS [ 16.720 > s] > [INFO] Lens Query Library ................................. SUCCESS [ 12.628 > s] > [INFO] Lens Hive Driver ................................... SUCCESS [02:48 > min] > [INFO] Lens Driver for JDBC ............................... SUCCESS [ 33.977 > s] > [INFO] Lens Elastic Search Driver ......................... SUCCESS [ 15.588 > s] > [INFO] Lens Server ........................................ SUCCESS [14:27 > min] > [INFO] Lens client ........................................ SUCCESS [ 36.158 > s] > [INFO] Lens CLI ........................................... SUCCESS [ 50.406 > s] > [INFO] Lens Examples ...................................... SUCCESS [ 7.659 > s] > [INFO] Lens Ship Jars to Distributed Cache ................ SUCCESS [ 1.101 > s] > [INFO] Lens Distribution .................................. SUCCESS [ 11.752 > s] > [INFO] Lens ML Lib ........................................ SUCCESS [01:37 > min] > [INFO] Lens ML Ext Distribution ........................... SUCCESS [ 3.789 > s] > [INFO] Lens Regression .................................... SUCCESS [ 12.604 > s] > [INFO] Lens UI ............................................ SUCCESS [ 3.883 > s] > [INFO] > ------------------------------------------------------------------------ > [INFO] BUILD SUCCESS > [INFO] > ------------------------------------------------------------------------ > [INFO] Total time: 33:48 min > [INFO] Finished at: 2015-12-23T17:09:08+05:30 > [INFO] Final Memory: 130M/914M > [INFO] > ------------------------------------------------------------------------ > > > Thanks, > > Deepak Barr > >