hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stack <st...@duboce.net>
Subject Re: Occasional GSSException that brings down region server
Date Fri, 14 Mar 2014 22:30:18 GMT
On Fri, Mar 14, 2014 at 2:55 PM, Wei Tan <wtan@us.ibm.com> wrote:

> Hi All, we seem to have overcome this occasional exception by changing
> HTable from being called through ConnectionManager vs. directly
> instantiating  HTable.
>
> OLD BAD:
> connection = HConnectionManager.createConnection(config);
>
> protected HTableInterface getHTable(String tableName) throws IOException
> {
>                  //Connection might have been closed since we acquired
> it...create a
>                  //new one if this is the case
>                  if (connection == null || connection.isClosed())
>                  {
>                                  log.info("HConnection null or
> closed...reopening");
>                                  connection =
> HConnectionManager.createConnection(config);
>                  }
>
>                  return connection.getTable(tableName);
> }
>
>
> NEW GOOD:
> public HTableInterface getHTable(byte[] tableName) throws IOException
> {
>                  return new HTable(conf, tableName);
> }
>
> Comment on this link [0] is why they opted down the initial - BAD path:
> ". Instances of this class can be constructed directly but it is
> encouraged that users get instances via HConnection and HConnectionManager
> . See HConnectionManager class comment for an example. "
>
>
I made it a blocker to change the wording (HBASE-10757).  We want folks to
go via HCM ALWAYs from here on out.

Thanks for reporting back Wei Tan,
St.Ack

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message