Masafumi Yokoyama
null+****@clear*****
Thu Oct 30 23:20:23 JST 2014
Masafumi Yokoyama 2014-10-30 23:20:23 +0900 (Thu, 30 Oct 2014) New Revision: 8ee1686a38a65779cffc2a90b0cfd329c936be61 https://github.com/ranguba/rroonga/commit/8ee1686a38a65779cffc2a90b0cfd329c936be61 Message: Support LZ4 for Groonga::Schema GitHub: #28, #32 Modified files: ext/groonga/rb-grn-table.c lib/groonga/schema.rb test/test-schema.rb Modified: ext/groonga/rb-grn-table.c (+7 -3) =================================================================== --- ext/groonga/rb-grn-table.c 2014-10-29 16:37:19 +0900 (28f48b3) +++ ext/groonga/rb-grn-table.c 2014-10-30 23:20:23 +0900 (f80f8ff) @@ -1,6 +1,7 @@ /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (C) 2009-2014 Kouhei Sutou <kou �� clear-code.com> + Copyright (C) 2014 Masafumi Yokoyama <myokoym �� gmail.com> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -235,7 +236,7 @@ rb_grn_table_inspect (VALUE self) * 値の圧縮方法を指定する。省略した場合は、圧縮しない。 * * - +:zlib+ := 値をzlib圧縮して格納する。 - * - +:lzo+ := 値をlzo圧縮して格納する。 + * - +:lz4+ := 値をlz4圧縮して格納する。 * * @return [Groonga::FixSizeColumn or Groonga::VariableSizeColumn] */ @@ -313,11 +314,14 @@ rb_grn_table_define_column (int argc, VALUE *argv, VALUE self) } else if (rb_grn_equal_option(rb_compress, "zlib")) { flags |= GRN_OBJ_COMPRESS_ZLIB; } else if (rb_grn_equal_option(rb_compress, "lzo")) { - flags |= GRN_OBJ_COMPRESS_LZO; + /* TODO: for backward compatibility */ + flags |= GRN_OBJ_COMPRESS_LZ4; + } else if (rb_grn_equal_option(rb_compress, "lz4")) { + flags |= GRN_OBJ_COMPRESS_LZ4; } else { rb_raise(rb_eArgError, "invalid compress type: %s: " - "available types: [:zlib, :lzo, nil]", + "available types: [:zlib, :lz4, nil]", rb_grn_inspect(rb_compress)); } Modified: lib/groonga/schema.rb (+2 -1) =================================================================== --- lib/groonga/schema.rb 2014-10-29 16:37:19 +0900 (644368c) +++ lib/groonga/schema.rb 2014-10-30 23:20:23 +0900 (c200209) @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2009-2014 Kouhei Sutou <kou �� clear-code.com> +# Copyright (C) 2014 Masafumi Yokoyama <myokoym �� gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -881,7 +882,7 @@ module Groonga # 値の圧縮方法を指定する。省略した場合は、圧縮しない。 # # - :zlib := 値をzlib圧縮して格納する。 - # - :lzo := 値をlzo圧縮して格納する。 + # - :lz4 := 値をlz4圧縮して格納する。 def column(name, type, options={}) definition = self[name, ColumnDefinition] if definition.nil? Modified: test/test-schema.rb (+1 -1) =================================================================== --- test/test-schema.rb 2014-10-29 16:37:19 +0900 (076ce99) +++ test/test-schema.rb 2014-10-30 23:20:23 +0900 (3a47ec4) @@ -330,7 +330,7 @@ class SchemaTest < Test::Unit::TestCase :path => path.to_s, :persistent => true, :type => :vector, - :compress => :lzo) + :compress => :lz4) end column_name = "Posts.rate" -------------- next part -------------- HTML����������������������������... Download