avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fo...@apache.org
Subject [avro] branch master updated: AVRO-2475: rake generate_interop should generate files for all codecs (#588)
Date Mon, 22 Jul 2019 18:07:10 GMT
This is an automated email from the ASF dual-hosted git repository.

fokko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/master by this push:
     new ee4c2aa  AVRO-2475: rake generate_interop should generate files for all codecs (#588)
ee4c2aa is described below

commit ee4c2aaf4a5a0e1108dc01b157150d4629dd7881
Author: Kengo Seki <sekikn@apache.org>
AuthorDate: Tue Jul 23 03:07:03 2019 +0900

    AVRO-2475: rake generate_interop should generate files for all codecs (#588)
---
 lang/ruby/Rakefile | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/lang/ruby/Rakefile b/lang/ruby/Rakefile
index ef25fd9..e1e672a 100644
--- a/lang/ruby/Rakefile
+++ b/lang/ruby/Rakefile
@@ -38,17 +38,13 @@ task :generate_interop do
 
   schema = Avro::Schema.parse(File.read(SCHEMAS + '/interop.avsc'))
   r = RandomData.new(schema, ENV['SEED'])
-  f = File.open(BUILD + '/interop/data/ruby.avro', 'w')
-  writer = Avro::DataFile::Writer.new(f, Avro::IO::DatumWriter.new(schema), schema)
-  begin
-    writer << r.next
-    writer << r.next
-  ensure
-    writer.close
-  end
-
-  Avro::DataFile.open(BUILD + '/interop/data/ruby_deflate.avro', 'w', schema.to_s, :deflate)
do |writer|
-    20.times { writer << r.next }
+  Avro::DataFile.codecs.each do |name, codec|
+    next unless codec
+    filename = name == 'null' ? 'ruby.avro' : "ruby_#{name}.avro"
+    path = File.join(BUILD, 'interop/data', filename)
+    Avro::DataFile.open(path, 'w', schema.to_s, name) do |writer|
+      writer << r.next
+    end
   end
 end
 


Mime
View raw message