rroonga 3.0.5 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/AUTHORS +5 -0
- data/Gemfile +20 -0
- data/Rakefile +187 -0
- data/doc/text/news.textile +10 -2
- data/doc/text/tutorial.textile +0 -2
- data/ext/groonga/extconf.rb +7 -1
- data/ext/groonga/rb-grn-accessor.c +11 -11
- data/ext/groonga/rb-grn-array.c +25 -25
- data/ext/groonga/rb-grn-column.c +106 -106
- data/ext/groonga/rb-grn-context.c +121 -121
- data/ext/groonga/rb-grn-database.c +78 -78
- data/ext/groonga/rb-grn-double-array-trie.c +92 -92
- data/ext/groonga/rb-grn-encoding-support.c +1 -1
- data/ext/groonga/rb-grn-encoding.c +28 -28
- data/ext/groonga/rb-grn-exception.c +9 -9
- data/ext/groonga/rb-grn-expression-builder.c +6 -6
- data/ext/groonga/rb-grn-expression.c +87 -87
- data/ext/groonga/rb-grn-fix-size-column.c +12 -12
- data/ext/groonga/rb-grn-geo-point.c +2 -2
- data/ext/groonga/rb-grn-hash.c +38 -38
- data/ext/groonga/rb-grn-index-column.c +191 -191
- data/ext/groonga/rb-grn-index-cursor.c +29 -29
- data/ext/groonga/rb-grn-logger.c +36 -36
- data/ext/groonga/rb-grn-normalizer.c +10 -10
- data/ext/groonga/rb-grn-patricia-trie.c +196 -196
- data/ext/groonga/rb-grn-plugin.c +5 -5
- data/ext/groonga/rb-grn-posting.c +2 -2
- data/ext/groonga/rb-grn-procedure.c +2 -2
- data/ext/groonga/rb-grn-query-logger.c +1 -1
- data/ext/groonga/rb-grn-record.c +1 -1
- data/ext/groonga/rb-grn-snippet.c +14 -14
- data/ext/groonga/rb-grn-table-cursor-key-support.c +4 -4
- data/ext/groonga/rb-grn-table-cursor.c +52 -52
- data/ext/groonga/rb-grn-table-key-support.c +209 -209
- data/ext/groonga/rb-grn-type.c +18 -18
- data/ext/groonga/rb-grn-utils.c +332 -314
- data/ext/groonga/rb-grn-variable-size-column.c +34 -34
- data/ext/groonga/rb-grn-variable.c +2 -2
- data/ext/groonga/rb-grn.h +240 -232
- data/ext/groonga/rb-groonga.c +10 -10
- data/rroonga-build.rb +7 -0
- data/rroonga.gemspec +1 -1
- data/test/test-hash.rb +4 -4
- data/test/test-index-column.rb +271 -257
- data/test/test-table-key-support.rb +78 -0
- data/test/test-table.rb +78 -51
- metadata +195 -164
- checksums.yaml +0 -7
@@ -55,42 +55,42 @@ rb_grn_variable_size_column_compressed_p (int argc, VALUE *argv, VALUE self)
|
|
55
55
|
rb_scan_args(argc, argv, "01", &type);
|
56
56
|
|
57
57
|
if (NIL_P(type)) {
|
58
|
-
|
58
|
+
accept_any_type = GRN_TRUE;
|
59
59
|
} else {
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
60
|
+
if (rb_grn_equal_option(type, "zlib")) {
|
61
|
+
need_zlib_check = GRN_TRUE;
|
62
|
+
} else if (rb_grn_equal_option(type, "lzo")) {
|
63
|
+
need_lzo_check = GRN_TRUE;
|
64
|
+
} else {
|
65
|
+
rb_raise(rb_eArgError,
|
66
|
+
"compressed type should be <:zlib> or <:lzo>: <%s>",
|
67
|
+
rb_grn_inspect(type));
|
68
|
+
}
|
69
69
|
}
|
70
70
|
|
71
71
|
rb_grn_column = SELF(self);
|
72
72
|
rb_grn_object_deconstruct(RB_GRN_OBJECT(rb_grn_column), &column, &context,
|
73
|
-
|
74
|
-
|
73
|
+
NULL, NULL,
|
74
|
+
NULL, NULL);
|
75
75
|
|
76
76
|
flags = column->header.flags;
|
77
77
|
switch (flags & GRN_OBJ_COMPRESS_MASK) {
|
78
78
|
case GRN_OBJ_COMPRESS_ZLIB:
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
79
|
+
if (accept_any_type || need_zlib_check) {
|
80
|
+
grn_obj support_p;
|
81
|
+
GRN_BOOL_INIT(&support_p, 0);
|
82
|
+
grn_obj_get_info(context, NULL, GRN_INFO_SUPPORT_ZLIB, &support_p);
|
83
|
+
compressed_p = GRN_BOOL_VALUE(&support_p);
|
84
|
+
}
|
85
|
+
break;
|
86
86
|
case GRN_OBJ_COMPRESS_LZO:
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
87
|
+
if (accept_any_type || need_lzo_check) {
|
88
|
+
grn_obj support_p;
|
89
|
+
GRN_BOOL_INIT(&support_p, 0);
|
90
|
+
grn_obj_get_info(context, NULL, GRN_INFO_SUPPORT_LZO, &support_p);
|
91
|
+
compressed_p = GRN_BOOL_VALUE(&support_p);
|
92
|
+
}
|
93
|
+
break;
|
94
94
|
}
|
95
95
|
|
96
96
|
return CBOOL2RVAL(compressed_p);
|
@@ -121,16 +121,16 @@ rb_grn_variable_size_column_defrag (int argc, VALUE *argv, VALUE self)
|
|
121
121
|
|
122
122
|
rb_scan_args(argc, argv, "01", &options);
|
123
123
|
rb_grn_scan_options(options,
|
124
|
-
|
125
|
-
|
124
|
+
"threshold", &rb_threshold,
|
125
|
+
NULL);
|
126
126
|
if (!NIL_P(rb_threshold)) {
|
127
|
-
|
127
|
+
threshold = NUM2INT(rb_threshold);
|
128
128
|
}
|
129
129
|
|
130
130
|
rb_grn_column = SELF(self);
|
131
131
|
rb_grn_object_deconstruct(RB_GRN_OBJECT(rb_grn_column), &column, &context,
|
132
|
-
|
133
|
-
|
132
|
+
NULL, NULL,
|
133
|
+
NULL, NULL);
|
134
134
|
n_segments = grn_obj_defrag(context, column, threshold);
|
135
135
|
rb_grn_context_check(context, self);
|
136
136
|
|
@@ -141,10 +141,10 @@ void
|
|
141
141
|
rb_grn_init_variable_size_column (VALUE mGrn)
|
142
142
|
{
|
143
143
|
rb_cGrnVariableSizeColumn =
|
144
|
-
|
144
|
+
rb_define_class_under(mGrn, "VariableSizeColumn", rb_cGrnColumn);
|
145
145
|
|
146
146
|
rb_define_method(rb_cGrnVariableSizeColumn, "compressed?",
|
147
|
-
|
147
|
+
rb_grn_variable_size_column_compressed_p, -1);
|
148
148
|
rb_define_method(rb_cGrnVariableSizeColumn, "defrag",
|
149
|
-
|
149
|
+
rb_grn_variable_size_column_defrag, -1);
|
150
150
|
}
|
@@ -54,8 +54,8 @@ rb_grn_variable_deconstruct (RbGrnVariable *rb_grn_variable,
|
|
54
54
|
|
55
55
|
rb_grn_object = RB_GRN_OBJECT(rb_grn_variable);
|
56
56
|
rb_grn_object_deconstruct(rb_grn_object, variable, context,
|
57
|
-
|
58
|
-
|
57
|
+
domain_id, domain,
|
58
|
+
range_id, range);
|
59
59
|
}
|
60
60
|
|
61
61
|
/*
|