hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Segel <michael_se...@hotmail.com>
Subject RE: Correct use of HTablePool
Date Tue, 27 Sep 2011 14:18:23 GMT

Outside of a M/R context, sure, why not?


> Subject: Correct use of HTablePool
> From: joel@su3analytics.com
> To: user@hbase.apache.org
> Date: Tue, 27 Sep 2011 10:19:04 +0100
> 
> When using an HTablePool and calling get() or scan() can I return the
> Table to the pool as soon as I have the Result of Scanner object?
> 
> i.e. is this valid?
> 
> HTablePool pool = myPool;
> Get get = myGet;
> HTable table = pool.getTable(myTableName);;
> Result result = null;
> try {
> 	result = table.get(get);
> } finally {
> 	pool.putTable(table);	
> }
> 
> // use Result now table has been returned to pool.
> r.getValue(Bytes.toBytes("COL"), Bytes.toBytes("ID"))
> 
> 
> and likewise with a Scanner
> 
> Rgs
> Joel
 		 	   		  
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message