rroonga 3.0.5 → 3.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/AUTHORS +5 -0
  2. data/Gemfile +20 -0
  3. data/Rakefile +187 -0
  4. data/doc/text/news.textile +10 -2
  5. data/doc/text/tutorial.textile +0 -2
  6. data/ext/groonga/extconf.rb +7 -1
  7. data/ext/groonga/rb-grn-accessor.c +11 -11
  8. data/ext/groonga/rb-grn-array.c +25 -25
  9. data/ext/groonga/rb-grn-column.c +106 -106
  10. data/ext/groonga/rb-grn-context.c +121 -121
  11. data/ext/groonga/rb-grn-database.c +78 -78
  12. data/ext/groonga/rb-grn-double-array-trie.c +92 -92
  13. data/ext/groonga/rb-grn-encoding-support.c +1 -1
  14. data/ext/groonga/rb-grn-encoding.c +28 -28
  15. data/ext/groonga/rb-grn-exception.c +9 -9
  16. data/ext/groonga/rb-grn-expression-builder.c +6 -6
  17. data/ext/groonga/rb-grn-expression.c +87 -87
  18. data/ext/groonga/rb-grn-fix-size-column.c +12 -12
  19. data/ext/groonga/rb-grn-geo-point.c +2 -2
  20. data/ext/groonga/rb-grn-hash.c +38 -38
  21. data/ext/groonga/rb-grn-index-column.c +191 -191
  22. data/ext/groonga/rb-grn-index-cursor.c +29 -29
  23. data/ext/groonga/rb-grn-logger.c +36 -36
  24. data/ext/groonga/rb-grn-normalizer.c +10 -10
  25. data/ext/groonga/rb-grn-patricia-trie.c +196 -196
  26. data/ext/groonga/rb-grn-plugin.c +5 -5
  27. data/ext/groonga/rb-grn-posting.c +2 -2
  28. data/ext/groonga/rb-grn-procedure.c +2 -2
  29. data/ext/groonga/rb-grn-query-logger.c +1 -1
  30. data/ext/groonga/rb-grn-record.c +1 -1
  31. data/ext/groonga/rb-grn-snippet.c +14 -14
  32. data/ext/groonga/rb-grn-table-cursor-key-support.c +4 -4
  33. data/ext/groonga/rb-grn-table-cursor.c +52 -52
  34. data/ext/groonga/rb-grn-table-key-support.c +209 -209
  35. data/ext/groonga/rb-grn-type.c +18 -18
  36. data/ext/groonga/rb-grn-utils.c +332 -314
  37. data/ext/groonga/rb-grn-variable-size-column.c +34 -34
  38. data/ext/groonga/rb-grn-variable.c +2 -2
  39. data/ext/groonga/rb-grn.h +240 -232
  40. data/ext/groonga/rb-groonga.c +10 -10
  41. data/rroonga-build.rb +7 -0
  42. data/rroonga.gemspec +1 -1
  43. data/test/test-hash.rb +4 -4
  44. data/test/test-index-column.rb +271 -257
  45. data/test/test-table-key-support.rb +78 -0
  46. data/test/test-table.rb +78 -51
  47. metadata +195 -164
  48. 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
- accept_any_type = GRN_TRUE;
58
+ accept_any_type = GRN_TRUE;
59
59
  } else {
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
- }
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
- NULL, NULL,
74
- NULL, NULL);
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
- 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;
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
- 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;
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
- "threshold", &rb_threshold,
125
- NULL);
124
+ "threshold", &rb_threshold,
125
+ NULL);
126
126
  if (!NIL_P(rb_threshold)) {
127
- threshold = NUM2INT(rb_threshold);
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
- NULL, NULL,
133
- NULL, NULL);
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
- rb_define_class_under(mGrn, "VariableSizeColumn", rb_cGrnColumn);
144
+ rb_define_class_under(mGrn, "VariableSizeColumn", rb_cGrnColumn);
145
145
 
146
146
  rb_define_method(rb_cGrnVariableSizeColumn, "compressed?",
147
- rb_grn_variable_size_column_compressed_p, -1);
147
+ rb_grn_variable_size_column_compressed_p, -1);
148
148
  rb_define_method(rb_cGrnVariableSizeColumn, "defrag",
149
- rb_grn_variable_size_column_defrag, -1);
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
- domain_id, domain,
58
- range_id, range);
57
+ domain_id, domain,
58
+ range_id, range);
59
59
  }
60
60
 
61
61
  /*