On Dec 30, 5:43 am, "Mateusz Berezecki" <[email protected]> wrote:
> Hi Luke,
>
> I'm seeing weird behavior when running ThriftClient in python , as
> well as my own ruby simple clients
>
> Is the output below a sign of a broken thrift installation or a bug of
> thriftbroker?

Well here my client_test.py output:

{'mutator': None, 'cells': None, 'results': ['BigTest', 'METADATA',
'Pages', 'Pa
ges_clone', 'Test1', 'Test2', 'Test3', 'Test4', 'hypertable', 'test',
'thrift_te
st'], 'scanner': None}
{'mutator': None, 'cells': [{'column_family': 'col',
'column_qualifier': None, '
timestamp': 1226401871000000000L, 'value': 'v1', 'row_key': 'k1',
'flag': 255, '
revision': -9223372036854775806L}, {'column_family': 'col',
'column_qualifier':
None, 'timestamp': 1226401871000000000L, 'value': 'v2', 'row_key':
'k2', 'flag':
 255, 'revision': -9223372036854775806L}, {'column_family': 'col',
'column_quali
fier': None, 'timestamp': 1226401871000000000L, 'value': 'v3',
'row_key': 'k3',
'flag': 255, 'revision': -9223372036854775806L}], 'results': None,
'scanner': No
ne}

Here is an interactive session:
$ env PYTHONPATH=.:./gen-py python
Python 2.5.2 (r252:60911, Apr 14 2008, 21:12:06)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from hypertable.thriftclient import ThriftClient
>>> client = ThriftClient("localhost", 38080)
>>> client.hql_query("show tables")
{'mutator': None, 'cells': None, 'results': ['BigTest', 'METADATA',
'Pages', 'Pages_clone', 'Test1', 'Test2', 'Test3', 'Test4',
'hypertable', 'test', 'thrift_test'], 'scanner': None}
>>>

Can you tell me your thrift version? Does the C++ client work? It
could be that you're using the latest thrift in trunk and they changed
a few things. In the case, try touch src/cc/ThriftBroker/*.thrift and
try make again, which will generate new gen-py/rb etc.

__Luke

>
> Mateusz
>
> ---------
>
> And here's the python output
>
> Traceback (most recent call last):
>   File "client_test.py", line 4, in <module>
>     res = client.hql_query("show tables")
>   File 
> "/Users/m/work/hypertable/src/py/ThriftClient/hypertable/thriftclient.py",
> line 27, in hql_query
>   File 
> "/Users/m/work/hypertable/src/py/ThriftClient/gen-py/hyperthrift/gen2/HqlService.py",
> line 30, in hql_exec
>     return self.recv_hql_exec()
>   File 
> "/Users/m/work/hypertable/src/py/ThriftClient/gen-py/hyperthrift/gen2/HqlService.py",
> line 43, in recv_hql_exec
>     (fname, mtype, rseqid) = self._iprot.readMessageBegin()
>   File "/Library/Python/2.5/site-packages/thrift/protocol/TBinaryProtocol.py",
> line 113, in readMessageBegin
>     sz = self.readI32()
>   File "/Library/Python/2.5/site-packages/thrift/protocol/TBinaryProtocol.py",
> line 190, in readI32
>     buff = self.trans.readAll(4)
>   File "/Library/Python/2.5/site-packages/thrift/transport/TTransport.py",
> line 50, in readAll
>     raise EOFError()
> EOFError
>
> And here's for Ruby
>
> Warning: class TSocket is deprecated
>   from test.rb:8
> Warning: class TFramedTransport is deprecated
>   from test.rb:8
> Warning: class TBinaryProtocol is deprecated
>   from test.rb:9
> Warning: class TException is deprecated
>   from test.rb:15
> /usr/local/lib/ruby/site_ruby/1.8/thrift/transport/socket.rb:94:in
> `read': bignum too big to convert into `long'
> (Thrift::TransportException)
>         from /usr/local/lib/ruby/site_ruby/1.8/thrift/transport.rb:44:in 
> `read_all'
>         from /usr/local/lib/ruby/site_ruby/1.8/thrift/transport.rb:218:in 
> `read_frame'
>         from /usr/local/lib/ruby/site_ruby/1.8/thrift/transport.rb:177:in 
> `read'
>         from /usr/local/lib/ruby/site_ruby/1.8/thrift/transport.rb:44:in 
> `read_all'
>         from 
> /usr/local/lib/ruby/site_ruby/1.8/thrift/protocol/binaryprotocol.rb:143:in
> `read_i32'
>         from 
> /usr/local/lib/ruby/site_ruby/1.8/thrift/protocol/binaryprotocol.rb:80:in
> `read_message_begin'
>         from /usr/local/lib/ruby/site_ruby/1.8/thrift/client.rb:26:in 
> `receive_message'
>         from ./HqlService.rb:28:in `recv_hql_exec'
>         from ./HqlService.rb:20:in `hql_exec'
>         from test.rb:14
>
> And here's the ruby source
>
> #!/usr/bin/env ruby
> $:.push('../gen-rb')
> require 'thrift/transport/tsocket.rb'
> require 'thrift/protocol/tbinaryprotocol.rb'
> require 'HqlService'
>
> begin
>         transport = TFramedTransport.new(TSocket.new('localhost', 12345))
>         protocol = TBinaryProtocol.new(transport)
>         client = Hypertable::ThriftGen::HqlService::Client.new(protocol)
>
>         transport.open()
>
>         print client.hql_exec("show tables", 0, 0)
> rescue TException => tx
>         print tx.message
> end
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Hypertable Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/hypertable-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to