Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

AVRO-511. Ruby implementation passes the rpc interop tests.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/avro/trunk@938577 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
commit 93a483eb1efafadd9cac2e104ecbe31ae2b9451d 1 parent 00c2339
Jeff Hodges authored
View
2  CHANGES.txt
@@ -29,6 +29,8 @@ Avro 1.4.0 (unreleased)
AVRO-521. Out of memory and other issues with Junit tests for mapreduce (thiru)
+ AVRO-511. Ruby implementation passes the rpc interop tests.
+
BUG FIXES
AVRO-461. Skipping primitives in the ruby side (jmhodges)
View
2  lang/ruby/lib/avro.rb
@@ -17,6 +17,8 @@
require 'yajl'
require 'set'
require 'md5'
+require 'net/http'
+require 'stringio'
module Avro
VERSION = "FIXME"
View
5 lang/ruby/lib/avro/ipc.rb
@@ -13,7 +13,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-require 'stringio'
module Avro::IPC
@@ -239,7 +238,7 @@ def initialize(local_protocol)
# Called by a server to deserialize a request, compute and serialize
# a response or error. Compare to 'handle()' in Thrift.
def respond(call_request)
- buffer_decoder = Avro::IO::BinaryDecoder.new(call_request)
+ buffer_decoder = Avro::IO::BinaryDecoder.new(StringIO.new(call_request))
buffer_writer = StringIO.new('', 'w+')
buffer_encoder = Avro::IO::BinaryEncoder.new(buffer_writer)
error = nil
@@ -308,7 +307,7 @@ def process_handshake(decoder, encoder)
remote_protocol = protocol_cache[client_hash]
if !remote_protocol && client_protocol
- remote_protocol = protocol.parse(client_protocol)
+ remote_protocol = Avro::Protocol.parse(client_protocol)
protocol_cache[client_hash] = remote_protocol
end
View
1  lang/ruby/test/sample_ipc_http_server.rb
@@ -68,7 +68,6 @@ def do_POST(req, resp)
writer = Avro::IPC::FramedWriter.new(StringIO.new)
writer.write_framed_message(unframed_resp)
resp.body = writer.to_s
- raise WEBrick::HTTPStatus::OK
end
end
View
2  lang/ruby/test/sample_ipc_server.rb
@@ -81,7 +81,7 @@ class MailHandler < RequestHandler
def handle(request)
responder = MailResponder.new()
transport = Avro::IPC::SocketTransport.new(request)
- str = StringIO.new(transport.read_framed_message)
+ str = transport.read_framed_message
transport.write_framed_message(responder.respond(str))
end
end
View
7 share/test/interop/bin/test_rpc_interop.sh
@@ -29,10 +29,13 @@ java_server="java -jar lang/java/build/avro-tools-$VERSION.jar rpcreceive"
py_client="python lang/py/src/avro/tool.py rpcsend"
py_server="python lang/py/src/avro/tool.py rpcreceive"
+ruby_client="ruby -rubygems -Ilang/ruby/lib lang/ruby/test/tool.rb rpcsend"
+ruby_server="ruby -rubygems -Ilang/ruby/lib lang/ruby/test/tool.rb rpcreceive"
+
export PYTHONPATH=lang/py/src # path to avro Python module
-clients=("$java_client" "$py_client")
-servers=("$java_server" "$py_server")
+clients=("$java_client" "$py_client" "$ruby_client")
+servers=("$java_server" "$py_server" "$ruby_server")
proto=share/test/schemas/simple.avpr
Please sign in to comment.
Something went wrong with that request. Please try again.