>> It appears to me that some change in the behavior under the covers of map
>> reduce jobs is now forcing me to recreate, rather than reuse, instances
>> created by HBaseConfiguration.

See HBASE-2925 <https://issues.apache.org/jira/browse/HBASE-2925>

I and Karthick have come up with a solution. See HBASE-3777.

See also my blog:
http://zhihongyu.blogspot.com/2011/04/managing-connections-in-hbase-090-and.html

On Sun, Apr 24, 2011 at 5:59 PM, Pete Tyler <[email protected]>wrote:

> Apologies, I should have mentioned I do not see a ConnectionLossException
> in
> any log files. This lack of the described exception made me think I had a
> different problem.
>
> The teeny weeny stack trace I get just shows that the 'closed' field in the
> 'HConnectionManager' class is set to false.
>
> java.io.IOException:
>
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation@18862d13
> closed
>        at
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:567)
>        at
> org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:555)
>
> at org.apache.hadoop.hbase.client.HTable.<init>(HTable.java:171)'
>
>
> Tracing through the logs and code I found a workaround whereby I should no
> longer reuse the same HBaseConfiguration/Configuration instance throughout
> my test suite. Previously, with HBase 0.20.4 I just created one instance
> of HBaseConfiguration and used this in ctors when creating HTable
> instances.
>
> My first attempt at a fix was to use a new instance of HBaseConfiguration
> every time I created an instance of HTable. This caused OutOfMemoryError
> exceptions to be thrown part way through my test suite.
>
> To get my test suite working again I have now coded the following solution
> which is less than ideal in that normal, predictable logic involves
> catching
> an exception,
>
>        HTable htable = null;
>
>        try {
>            htable = new HTable(conf, tableName);
>        }
>        catch (IOException) {
>            conf = new HBaseConfiguration.create(conf);
>            htable = new HTable(conf, tableName);
>        }
>
> It appears to me that some change in the behavior under the covers of map
> reduce jobs is now forcing me to recreate, rather than reuse, instances
> created by HBaseConfiguration.
>
> Oh well, at least my code is working in this area, onto the next breaking
> change :)
>

Reply via email to