Hi all:
I am a novice for HBase thrift. I encountered a problem on writing a python
code to access HBase with thrift.

I igenerated the gen-py files. Subsequently, moved it to the python
lib:~/.local/lib/python2.7/site-packages/

The hbase thrift server is in 192.168.15.116:39090. It was started.

my code is in the server 192.168.15.146. In this machine, I can use hbase
shell command to read the hbase data. Here is my Python code:

#! /usr/bin/env pythonfrom thrift import Thrift

                                                                 from
thrift.transport import TSocket, TTransport

                                      from thrift.protocol import
TBinaryProtocol

               from hbase import Hbase


transport = TSocket.TSocket('192.168.15.116', 39090)

transport.setTimeout(5000)
#transport = TTransport.TBufferedTransport(transport)

protocol = TBinaryProtocol.TBinaryProtocol(transport)

client = Hbase.Client(protocol)

transport.open()

print(client.getTableNames())

It was all ok *but the last line `print(client.getTableNames())`*, here is
the error:

Traceback (most recent call last):
  File "test01.py", line 24, in <module>
    client.getTableNames()
  File "~/.local/lib/python2.7/site-packages/hbase/Hbase.py", line
788, in getTableNames
    return self.recv_getTableNames()
  File "~/.local/lib/python2.7/site-packages/hbase/Hbase.py", line
803, in recv_getTableNames
    raise x
thrift.Thrift.TApplicationException: Internal error processing getTableNames

My thrfit version is 0.9.0.

HBase version is HBase 0.94.2-cdh4.2.1.

Has anybody had this issue before? How to solve it? Thanks.

Reply via email to