Re: HConnectionManager leaks with zookeeper conection oo many connections from /my.tomcat.server.com - max is 60

2014-12-13 Thread Serega Sheypak
Hm... confusing, So here is the code path: 1. Servlet has doPost method 2. HistoryController instantiated during each doPost request. HistoryController is Logic wrapper around low-level HBase persistence stuff Each doPost invokes: final HistoryController getHistoryController(){ return new

Re: HConnectionManager leaks with zookeeper conection oo many connections from /my.tomcat.server.com - max is 60

2014-12-13 Thread lars hofhansl
Note also that the createConnection part is somewhat expensive (creates a new thread pool for use with Puts, also does a ZK lookup, etc).If possible create the connection ahead of time and only get/close an HTable per request/thread. -- Lars From: Serega Sheypak serega.shey...@gmail.com

Re: HConnectionManager leaks with zookeeper conection oo many connections from /my.tomcat.server.com - max is 60

2014-12-13 Thread Serega Sheypak
So the idea is 1. instantiate HConnection using HConnectionManager once 2. Create HTable instance for each Servlet.doPost and close after operation is done. Is that correct? Do region locations cached in this case? Are ZK connections to region/ZK reused? Can I harm put/get data because of Servlet

Re: HConnectionManager leaks with zookeeper conection oo many connections from /my.tomcat.server.com - max is 60

2014-12-13 Thread Stack
On Sat, Dec 13, 2014 at 11:33 AM, Serega Sheypak serega.shey...@gmail.com wrote: So the idea is 1. instantiate HConnection using HConnectionManager once 2. Create HTable instance for each Servlet.doPost and close after operation is done. Is that correct? Yes. Do region locations

Re: HConnectionManager leaks with zookeeper conection oo many connections from /my.tomcat.server.com - max is 60

2014-12-13 Thread Serega Sheypak
Great, I'll refactor the code. and report back 2014-12-13 22:36 GMT+03:00 Stack st...@duboce.net: On Sat, Dec 13, 2014 at 11:33 AM, Serega Sheypak serega.shey...@gmail.com wrote: So the idea is 1. instantiate HConnection using HConnectionManager once 2. Create HTable instance for