incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabor Torok <Gabor.To...@sunpowercorp.com>
Subject Re: avro + cassandra + ruby
Date Thu, 30 Sep 2010 16:56:46 GMT
The server exception is:

WARN 09:49:56,644 user error
org.apache.cassandra.avro.KeyspaceNotDefinedException
	at org.apache.cassandra.avro.AvroValidation.validateKeyspace(AvroValidation.java:73)
	at org.apache.cassandra.avro.AvroValidation.validateColumnParent(AvroValidation.java:121)
	at org.apache.cassandra.avro.CassandraServer.multigetSliceInternal(CassandraServer.java:311)
	at org.apache.cassandra.avro.CassandraServer.multiget_slice(CassandraServer.java:379)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.avro.specific.SpecificResponder.respond(SpecificResponder.java:93)
	at org.apache.avro.ipc.Responder.respond(Responder.java:136)
	at org.apache.avro.ipc.Responder.respond(Responder.java:88)
	at org.apache.avro.ipc.ResponderServlet.doPost(ResponderServlet.java:48)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:930)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
	at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:637)

The ruby client says:  

/usr/local/lib/ruby/gems/1.8/gems/avro-1.4.0/lib/avro/io.rb:247:in `match_schemas': undefined
local variable or method `writers_scheam' for Avro::IO::DatumReader:Class (NameError)
	from /usr/local/lib/ruby/gems/1.8/gems/avro-1.4.0/lib/avro/io.rb:295:in `read_data'
	from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `find'
	from /usr/local/lib/ruby/gems/1.8/gems/avro-1.4.0/lib/avro/io.rb:294:in `each'
	from /usr/local/lib/ruby/gems/1.8/gems/avro-1.4.0/lib/avro/io.rb:294:in `find'
	from /usr/local/lib/ruby/gems/1.8/gems/avro-1.4.0/lib/avro/io.rb:294:in `read_data'
	from /usr/local/lib/ruby/gems/1.8/gems/avro-1.4.0/lib/avro/io.rb:383:in `read_union'
	from /usr/local/lib/ruby/gems/1.8/gems/avro-1.4.0/lib/avro/io.rb:316:in `read_data'
	from /usr/local/lib/ruby/gems/1.8/gems/avro-1.4.0/lib/avro/io.rb:282:in `read'
	from /usr/local/lib/ruby/gems/1.8/gems/avro-1.4.0/lib/avro/ipc.rb:227:in `read_error'
	from /usr/local/lib/ruby/gems/1.8/gems/avro-1.4.0/lib/avro/ipc.rb:216:in `read_call_response'
	from /usr/local/lib/ruby/gems/1.8/gems/avro-1.4.0/lib/avro/ipc.rb:113:in `request'
	from ./avro_test.rb:19

"writers_scheam" is a typo bug :-)

My client code is:

avro_protocol = File.open("config/cassandra.avpr", "r").read
json_avro = JSON.parse(avro_protocol)
protocol = Avro::Protocol.parse(avro_protocol)
transport = Avro::IPC::HTTPTransceiver.new("localhost", 9160)
requestor = Avro::IPC::Requestor.new(protocol, transport)

requestor.request("set_keyspace", "keyspace" => "TMAC")
requestor.request("multiget_slice", "keys"=>...

Looking in the server code, it seems java is expecting all avro communications to be stateful
(or some other way of matching threads to callers.)

Thanks,
--Gabor

Mime
View raw message