Author: jmhodges
Date: Fri Jun 4 05:37:10 2010
New Revision: 951280
URL: http://svn.apache.org/viewvc?rev=951280&view=rev
Log:
AVRO-511. Ruby implementation passes the rpc interop tests. merge from trunk
Modified:
avro/branches/branch-1.3/ (props changed)
avro/branches/branch-1.3/CHANGES.txt
avro/branches/branch-1.3/lang/ruby/lib/avro.rb
avro/branches/branch-1.3/lang/ruby/lib/avro/ipc.rb
avro/branches/branch-1.3/lang/ruby/test/sample_ipc_http_server.rb
avro/branches/branch-1.3/lang/ruby/test/sample_ipc_server.rb
avro/branches/branch-1.3/share/test/interop/bin/test_rpc_interop.sh
Propchange: avro/branches/branch-1.3/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 4 05:37:10 2010
@@ -1,2 +1,2 @@
/avro/trunk:944035,944049
-/hadoop/avro/trunk:930458-930459,930461-930462,930599,931026-931027,931437,933158,933180-933181,933184,935526,938347
+/hadoop/avro/trunk:930458-930459,930461-930462,930599,931026-931027,931437,933158,933180-933181,933184,935526,938347,938577
Modified: avro/branches/branch-1.3/CHANGES.txt
URL:
http://svn.apache.org/viewvc/avro/branches/branch-1.3/CHANGES.txt?rev=951280&r1=951279&r2=951280&view=diff
==============================================================================
--- avro/branches/branch-1.3/CHANGES.txt (original)
+++ avro/branches/branch-1.3/CHANGES.txt Fri Jun 4 05:37:10 2010
@@ -25,6 +25,8 @@ Avro 1.3.3 (Unreleased)
AVRO-514. Removing unnecessary ruby StringIO calls. (jmhodges)
+ AVRO-511. Ruby implementation passes the rpc interop tests.
+
BUG FIXES
AVRO-461. Skipping primitives in the ruby side (jmhodges)
Modified: avro/branches/branch-1.3/lang/ruby/lib/avro.rb
URL:
http://svn.apache.org/viewvc/avro/branches/branch-1.3/lang/ruby/lib/avro.rb?rev=951280&r1=951279&r2=951280&view=diff
==============================================================================
--- avro/branches/branch-1.3/lang/ruby/lib/avro.rb (original)
+++ avro/branches/branch-1.3/lang/ruby/lib/avro.rb Fri Jun 4 05:37:10 2010
@@ -17,6 +17,8 @@
require 'yajl'
require 'set'
require 'md5'
+require 'net/http'
+require 'stringio'
module Avro
VERSION = "FIXME"
Modified: avro/branches/branch-1.3/lang/ruby/lib/avro/ipc.rb
URL:
http://svn.apache.org/viewvc/avro/branches/branch-1.3/lang/ruby/lib/avro/ipc.rb?rev=951280&r1=951279&r2=951280&view=diff
==============================================================================
--- avro/branches/branch-1.3/lang/ruby/lib/avro/ipc.rb (original)
+++ avro/branches/branch-1.3/lang/ruby/lib/avro/ipc.rb Fri Jun 4 05:37:10 2010
@@ -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 @@ module Avro::IPC
# 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 @@ module Avro::IPC
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
Modified: avro/branches/branch-1.3/lang/ruby/test/sample_ipc_http_server.rb
URL:
http://svn.apache.org/viewvc/avro/branches/branch-1.3/lang/ruby/test/sample_ipc_http_server.rb?rev=951280&r1=951279&r2=951280&view=diff
==============================================================================
--- avro/branches/branch-1.3/lang/ruby/test/sample_ipc_http_server.rb (original)
+++ avro/branches/branch-1.3/lang/ruby/test/sample_ipc_http_server.rb Fri Jun
4 05:37:10 2010
@@ -68,7 +68,6 @@ class MailHandler < WEBrick::HTTPServlet
writer = Avro::IPC::FramedWriter.new(StringIO.new)
writer.write_framed_message(unframed_resp)
resp.body = writer.to_s
- raise WEBrick::HTTPStatus::OK
end
end
Modified: avro/branches/branch-1.3/lang/ruby/test/sample_ipc_server.rb
URL:
http://svn.apache.org/viewvc/avro/branches/branch-1.3/lang/ruby/test/sample_ipc_server.rb?rev=951280&r1=951279&r2=951280&view=diff
==============================================================================
--- avro/branches/branch-1.3/lang/ruby/test/sample_ipc_server.rb (original)
+++ avro/branches/branch-1.3/lang/ruby/test/sample_ipc_server.rb Fri Jun 4
05:37:10 2010
@@ -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
Modified: avro/branches/branch-1.3/share/test/interop/bin/test_rpc_interop.sh
URL:
http://svn.apache.org/viewvc/avro/branches/branch-1.3/share/test/interop/bin/test_rpc_interop.sh?rev=951280&r1=951279&r2=951280&view=diff
==============================================================================
--- avro/branches/branch-1.3/share/test/interop/bin/test_rpc_interop.sh
(original)
+++ avro/branches/branch-1.3/share/test/interop/bin/test_rpc_interop.sh Fri Jun
4 05:37:10 2010
@@ -29,10 +29,13 @@ java_server="java -jar lang/java/build/a
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