rroonga 6.1.0 → 6.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 78fd337dfaf2b617d681f0d50231e3aa53462cb9
4
- data.tar.gz: a9d2c0a6d5f182494441b98ada3a83b9a69f8452
3
+ metadata.gz: a44ed5f4456e72a24167e4077f73fd94b242fe26
4
+ data.tar.gz: d5f416c9f3e0751810397e114a5adbeb046f1626
5
5
  SHA512:
6
- metadata.gz: de6363baa9a40f6cf01224c184ab73d04886307197dc84d1a8ac55e1db9b8cc1e4ed919931f2c24247b6a41406204e1a4afaebf17096d6dc234ab95f92aff9a1
7
- data.tar.gz: a90742232b1c67a901f00fc9df9f2a230d261e5d0fdab445d9074fa6b3276bfe3d6da43badafc078cf0a0ab4149e1436b55fea231544a4e6fe6b5755b88976ab
6
+ metadata.gz: ba25928a5113c6550972b540f269ca1ad2b5eac2ed0c72e156011332b641f722337895c2bb1dcd3ef5e73fef5c5fea8c3102f50b81dcabeb198e3c009facb370
7
+ data.tar.gz: 8d869ffd01942c02055cf4b5f70b97717a818a467caf9ca590dd51f190dc380f71a844bd0bb8ff958060cf2945ad19cf1b7428ba74c0ed9b5690d13c9dd7c5f2
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
1
  # -*- coding: utf-8; mode: ruby -*-
2
2
  #
3
3
  # Copyright (C) 2009-2016 Kouhei Sutou <kou@clear-code.com>
4
+ # Copyright (C) 2017 Masafumi Yokoyama <yokoyama@clear-code.com>
4
5
  #
5
6
  # This library is free software; you can redistribute it and/or
6
7
  # modify it under the terms of the GNU Lesser General Public
@@ -157,7 +158,7 @@ windows_architectures = [:x86, :x64]
157
158
 
158
159
  namespace :build do
159
160
  namespace :windows do
160
- ruby_versions = "2.1.6:2.2.2:2.3.0"
161
+ ruby_versions = "2.1.6:2.2.2:2.3.0:2.4.0"
161
162
 
162
163
  windows_architectures.each do |architecture|
163
164
  desc "Build gem for Windows #{architecture}"
data/doc/text/news.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # NEWS
2
2
 
3
+ ## 6.1.3: 2017-01-12 {#version-6-1-3}
4
+
5
+ ### Improvements
6
+
7
+ * Supported Groonga 6.1.3. Groonga 6.1.0 or older aren't supported.
8
+
9
+ * Added {Groonga::Context#support_zstd?}.
10
+
11
+ * Added {Groonga::ZstdError}.
12
+
13
+ * Supported Zstandard compression.
14
+ If Zstandard is available in your enviromemt, you can use Zstandard
15
+ compression for columns. How to use:
16
+
17
+ Groonga::Schema.define do |schema|
18
+ schema.create_table("Posts") do |table|
19
+ table.short_text("title", :compress => :zstandard)
20
+ # shortened form
21
+ # table.short_text("title", :compress => :zstd)
22
+ end
23
+ end
24
+
25
+ * Added PID for {Groonga::Logger::Flags}.
26
+
27
+ * Added {Groonga::Logger.flags}.
28
+
29
+ * Added {Groonga::Logger.flags=}.
30
+
3
31
  ## 6.1.0: 2016-11-07 {#version-6-1-0}
4
32
 
5
33
  ### Improvements
@@ -1,6 +1,7 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
3
  Copyright (C) 2010-2015 Kouhei Sutou <kou@clear-code.com>
4
+ Copyright (C) 2016 Masafumi Yokoyama <yokoyama@clear-code.com>
4
5
 
5
6
  This library is free software; you can redistribute it and/or
6
7
  modify it under the terms of the GNU Lesser General Public
@@ -698,6 +699,28 @@ rb_grn_context_support_lz4_p (VALUE self)
698
699
  return rb_support_p;
699
700
  }
700
701
 
702
+ /*
703
+ * If Groonga supports Zstandard compression, it returns `true`,
704
+ * otherwise it returns `false`.
705
+ *
706
+ * @overload support_zstd?
707
+ */
708
+ static VALUE
709
+ rb_grn_context_support_zstd_p (VALUE self)
710
+ {
711
+ VALUE rb_support_p;
712
+ grn_ctx *context;
713
+ grn_obj support_p;
714
+
715
+ context = SELF(self);
716
+ GRN_BOOL_INIT(&support_p, 0);
717
+ grn_obj_get_info(context, NULL, GRN_INFO_SUPPORT_ZSTD, &support_p);
718
+ rb_support_p = CBOOL2RVAL(GRN_BOOL_VALUE(&support_p));
719
+ GRN_OBJ_FIN(context, &support_p);
720
+
721
+ return rb_support_p;
722
+ }
723
+
701
724
  /*
702
725
  * コンテキストが使うデータベースを返す。
703
726
  *
@@ -1005,6 +1028,8 @@ rb_grn_init_context (VALUE mGrn)
1005
1028
  rb_grn_context_support_lzo_p, 0);
1006
1029
  rb_define_method(cGrnContext, "support_lz4?",
1007
1030
  rb_grn_context_support_lz4_p, 0);
1031
+ rb_define_method(cGrnContext, "support_zstd?",
1032
+ rb_grn_context_support_zstd_p, 0);
1008
1033
 
1009
1034
  rb_define_method(cGrnContext, "database", rb_grn_context_get_database, 0);
1010
1035
 
@@ -706,9 +706,9 @@ rb_grn_database_reindex (VALUE self)
706
706
  }
707
707
 
708
708
  /*
709
- * Removes a broken object.
709
+ * Removes an object forcibly.
710
710
  *
711
- * You should use {Groonga::Object#remove} normally.
711
+ * Normally, you should use {Groonga::Object#remove}.
712
712
  *
713
713
  * @overload remove_force(name)
714
714
  *
@@ -1,7 +1,7 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
- Copyright (C) 2014-2015 Masafumi Yokoyama <yokoyama@clear-code.com>
4
3
  Copyright (C) 2009-2016 Kouhei Sutou <kou@clear-code.com>
4
+ Copyright (C) 2014-2016 Masafumi Yokoyama <yokoyama@clear-code.com>
5
5
 
6
6
  This library is free software; you can redistribute it and/or
7
7
  modify it under the terms of the GNU Lesser General Public
@@ -102,6 +102,7 @@ static VALUE eGrnPluginError;
102
102
  static VALUE eGrnScorerError;
103
103
  static VALUE eGrnCancel;
104
104
  static VALUE eGrnWindowFunctionError;
105
+ static VALUE eGrnZstdError;
105
106
 
106
107
  VALUE
107
108
  rb_grn_rc_to_exception (grn_rc rc)
@@ -349,6 +350,9 @@ rb_grn_rc_to_exception (grn_rc rc)
349
350
  case GRN_WINDOW_FUNCTION_ERROR:
350
351
  exception = eGrnWindowFunctionError;
351
352
  break;
353
+ case GRN_ZSTD_ERROR:
354
+ exception = eGrnZstdError;
355
+ break;
352
356
  }
353
357
 
354
358
  if (NIL_P(exception))
@@ -1058,4 +1062,14 @@ rb_grn_init_exception (VALUE mGrn)
1058
1062
  */
1059
1063
  eGrnWindowFunctionError =
1060
1064
  rb_define_class_under(mGrn, "WindowFunctionError", rb_eGrnError);
1065
+
1066
+ /*
1067
+ * Document-class: Groonga::ZstdError
1068
+ *
1069
+ * It is used when Zstd causes an error.
1070
+ *
1071
+ * @since 6.1.3
1072
+ */
1073
+ eGrnZstdError =
1074
+ rb_define_class_under(mGrn, "ZstdError", rb_eGrnError);
1061
1075
  }
@@ -1,6 +1,7 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
3
  Copyright (C) 2009-2015 Kouhei Sutou <kou@clear-code.com>
4
+ Copyright (C) 2016-2017 Masafumi Yokoyama <yokoyama@clear-code.com>
4
5
 
5
6
  This library is free software; you can redistribute it and/or
6
7
  modify it under the terms of the GNU Lesser General Public
@@ -547,6 +548,43 @@ rb_grn_logger_s_set_path (VALUE klass, VALUE rb_path)
547
548
  return Qnil;
548
549
  }
549
550
 
551
+ /*
552
+ * Gets the current log flags that is used by the default logger.
553
+ *
554
+ * @overload flags
555
+ * @return [Integer] The current log flags.
556
+ *
557
+ * @since 6.1.3
558
+ */
559
+ static VALUE
560
+ rb_grn_logger_s_get_flags (VALUE klass)
561
+ {
562
+ int flags = 0;
563
+ VALUE rb_flags;
564
+
565
+ flags = grn_default_logger_get_flags();
566
+ rb_flags = INT2NUM(flags);
567
+
568
+ return rb_flags;
569
+ }
570
+
571
+ /*
572
+ * Sets the log flags that is used by the default logger.
573
+ *
574
+ * @overload flags=(flags)
575
+ * @param flags [Integer] The log flags for the default logger.
576
+ * @return void
577
+ *
578
+ * @since 6.1.3
579
+ */
580
+ static VALUE
581
+ rb_grn_logger_s_set_flags (VALUE klass, VALUE rb_flags)
582
+ {
583
+ grn_default_logger_set_flags(NUM2INT(rb_flags));
584
+
585
+ return Qnil;
586
+ }
587
+
550
588
  /*
551
589
  * Gets the current rotate threshold size that is used by the default
552
590
  * logger.
@@ -636,6 +674,10 @@ rb_grn_init_logger (VALUE mGrn)
636
674
  rb_grn_logger_s_get_path, 0);
637
675
  rb_define_singleton_method(rb_cGrnLogger, "path=",
638
676
  rb_grn_logger_s_set_path, 1);
677
+ rb_define_singleton_method(rb_cGrnLogger, "flags",
678
+ rb_grn_logger_s_get_flags, 0);
679
+ rb_define_singleton_method(rb_cGrnLogger, "flags=",
680
+ rb_grn_logger_s_set_flags, 1);
639
681
  rb_define_singleton_method(rb_cGrnLogger, "rotate_threshold_size",
640
682
  rb_grn_logger_s_get_rotate_threshold_size, 0);
641
683
  rb_define_singleton_method(rb_cGrnLogger, "rotate_threshold_size=",
@@ -650,6 +692,7 @@ rb_grn_init_logger (VALUE mGrn)
650
692
  DEFINE_FLAG(TITLE);
651
693
  DEFINE_FLAG(MESSAGE);
652
694
  DEFINE_FLAG(LOCATION);
695
+ DEFINE_FLAG(PID);
653
696
  #undef DEFINE_FLAG
654
697
 
655
698
  rb_cGrnCallbackLogger =
@@ -1,6 +1,6 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
- Copyright (C) 2009-2014 Kouhei Sutou <kou@clear-code.com>
3
+ Copyright (C) 2009-2016 Kouhei Sutou <kou@clear-code.com>
4
4
  Copyright (C) 2014-2016 Masafumi Yokoyama <yokoyama@clear-code.com>
5
5
 
6
6
  This library is free software; you can redistribute it and/or
@@ -914,10 +914,18 @@ rb_grn_object_inspect_content_flags_with_label (VALUE inspected,
914
914
  switch (object->header.type) {
915
915
  case GRN_COLUMN_FIX_SIZE:
916
916
  case GRN_COLUMN_VAR_SIZE:
917
- if (column_flags & GRN_OBJ_COMPRESS_ZLIB) {
917
+ switch (column_flags & GRN_OBJ_COMPRESS_MASK) {
918
+ case GRN_OBJ_COMPRESS_ZLIB:
918
919
  rb_ary_push(inspected_flags, rb_str_new_cstr("COMPRESS_ZLIB"));
919
- } else if (column_flags & GRN_OBJ_COMPRESS_LZ4) {
920
+ break;
921
+ case GRN_OBJ_COMPRESS_LZ4:
920
922
  rb_ary_push(inspected_flags, rb_str_new_cstr("COMPRESS_LZ4"));
923
+ break;
924
+ case GRN_OBJ_COMPRESS_ZSTD:
925
+ rb_ary_push(inspected_flags, rb_str_new_cstr("COMPRESS_ZSTD"));
926
+ break;
927
+ default:
928
+ break;
921
929
  }
922
930
  break;
923
931
  case GRN_COLUMN_INDEX:
@@ -229,8 +229,10 @@ rb_grn_table_inspect (VALUE self)
229
229
  * @option options :compress
230
230
  * 値の圧縮方法を指定する。省略した場合は、圧縮しない。
231
231
  *
232
- * - +:zlib+ := 値をzlib圧縮して格納する。
233
- * - +:lz4+ := 値をLZ4圧縮して格納する。
232
+ * * `:zlib`: Compressed by zlib.
233
+ * * `:lz4`: Compressed by LZ4.
234
+ * * `:zstd`: Compressed by Zstandard.
235
+ * * `:zstandard`: Compressed by Zstandard.
234
236
  *
235
237
  * @return [Groonga::FixSizeColumn, Groonga::VariableSizeColumn]
236
238
  */
@@ -312,10 +314,14 @@ rb_grn_table_define_column (int argc, VALUE *argv, VALUE self)
312
314
  flags |= GRN_OBJ_COMPRESS_LZ4;
313
315
  } else if (rb_grn_equal_option(rb_compress, "lz4")) {
314
316
  flags |= GRN_OBJ_COMPRESS_LZ4;
317
+ } else if (rb_grn_equal_option(rb_compress, "zstd")) {
318
+ flags |= GRN_OBJ_COMPRESS_ZSTD;
319
+ } else if (rb_grn_equal_option(rb_compress, "zstandard")) {
320
+ flags |= GRN_OBJ_COMPRESS_ZSTD;
315
321
  } else {
316
322
  rb_raise(rb_eArgError,
317
323
  "invalid compress type: %s: "
318
- "available types: [:zlib, :lz4, nil]",
324
+ "available types: [:zlib, :lz4, :zstd, :zstandard, nil]",
319
325
  rb_grn_inspect(rb_compress));
320
326
  }
321
327
 
@@ -465,7 +465,7 @@ rb_grn_variable_size_column_array_set (VALUE self, VALUE rb_id, VALUE rb_value)
465
465
  * @overload compressed?
466
466
  * @return [Boolean] whether the column is compressed or not.
467
467
  * @overload compressed?(type)
468
- * @param [:zlib, :lz4] type (nil)
468
+ * @param [:zlib, :lz4, :zstd, :zstandard] type (nil)
469
469
  * @return [Boolean] whether specified compressed type is used or not.
470
470
  * @since 1.3.1
471
471
  */
@@ -481,6 +481,7 @@ rb_grn_variable_size_column_compressed_p (int argc, VALUE *argv, VALUE self)
481
481
  grn_bool accept_any_type = GRN_FALSE;
482
482
  grn_bool need_zlib_check = GRN_FALSE;
483
483
  grn_bool need_lz4_check = GRN_FALSE;
484
+ grn_bool need_zstd_check = GRN_FALSE;
484
485
 
485
486
  rb_scan_args(argc, argv, "01", &type);
486
487
 
@@ -494,9 +495,14 @@ rb_grn_variable_size_column_compressed_p (int argc, VALUE *argv, VALUE self)
494
495
  need_lz4_check = GRN_TRUE;
495
496
  } else if (rb_grn_equal_option(type, "lz4")) {
496
497
  need_lz4_check = GRN_TRUE;
498
+ } else if (rb_grn_equal_option(type, "zstd")) {
499
+ need_zstd_check = GRN_TRUE;
500
+ } else if (rb_grn_equal_option(type, "zstandardd")) {
501
+ need_zstd_check = GRN_TRUE;
497
502
  } else {
498
503
  rb_raise(rb_eArgError,
499
- "compressed type should be <:zlib> or <:lz4>: <%s>",
504
+ "compressed type should be "
505
+ "<:zlib>, <:lz4>, <:zstd> or <:zstandard>: <%s>",
500
506
  rb_grn_inspect(type));
501
507
  }
502
508
  }
@@ -524,6 +530,14 @@ rb_grn_variable_size_column_compressed_p (int argc, VALUE *argv, VALUE self)
524
530
  compressed_p = GRN_BOOL_VALUE(&support_p);
525
531
  }
526
532
  break;
533
+ case GRN_OBJ_COMPRESS_ZSTD:
534
+ if (accept_any_type || need_zstd_check) {
535
+ grn_obj support_p;
536
+ GRN_BOOL_INIT(&support_p, 0);
537
+ grn_obj_get_info(context, NULL, GRN_INFO_SUPPORT_ZSTD, &support_p);
538
+ compressed_p = GRN_BOOL_VALUE(&support_p);
539
+ }
540
+ break;
527
541
  }
528
542
 
529
543
  return CBOOL2RVAL(compressed_p);
data/ext/groonga/rb-grn.h CHANGED
@@ -1,7 +1,7 @@
1
1
  /* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
2
  /*
3
3
  Copyright (C) 2009-2016 Kouhei Sutou <kou@clear-code.com>
4
- Copyright (C) 2015-2016 Masafumi Yokoyama <yokoyama@clear-code.com>
4
+ Copyright (C) 2015-2017 Masafumi Yokoyama <yokoyama@clear-code.com>
5
5
 
6
6
  This library is free software; you can redistribute it and/or
7
7
  modify it under the terms of the GNU Lesser General Public
@@ -99,7 +99,7 @@ RB_GRN_BEGIN_DECLS
99
99
 
100
100
  #define RB_GRN_MAJOR_VERSION 6
101
101
  #define RB_GRN_MINOR_VERSION 1
102
- #define RB_GRN_MICRO_VERSION 0
102
+ #define RB_GRN_MICRO_VERSION 3
103
103
 
104
104
  #define RB_GRN_OBJECT(object) ((RbGrnObject *)(object))
105
105
  #define RB_GRN_NAMED_OBJECT(object) ((RbGrnNamedObject *)(object))
@@ -159,7 +159,7 @@ rb_grn_s_get_lock_timeout (VALUE klass)
159
159
  * @overload lock_timeout=(timeout)
160
160
  * @param [Integer] timeout The new lock timeout.
161
161
  *
162
- * @see {#lock_timeout}
162
+ * @see lock_timeout
163
163
  * @since 3.1.2
164
164
  */
165
165
  static VALUE
@@ -628,6 +628,8 @@ module Groonga
628
628
  flags << "COMPRESS_ZLIB"
629
629
  elsif column.compressed?(:lz4)
630
630
  flags << "COMPRESS_LZ4"
631
+ elsif column.compressed?(:zstd)
632
+ flags << "COMPRESS_ZSTD"
631
633
  end
632
634
  end
633
635
  parameters << "#{flags.join('|')}"
@@ -23,6 +23,7 @@ module Groonga
23
23
  TITLE => "title",
24
24
  MESSAGE => "message",
25
25
  LOCATION => "location",
26
+ PID => "pid",
26
27
  }
27
28
 
28
29
  class << self
@@ -34,7 +35,7 @@ module Groonga
34
35
  def label(flags)
35
36
  labels = []
36
37
  LABELS.each do |flag, label|
37
- flags << label if (flags & flag) == flag
38
+ labels << label if (flags & flag) == flag
38
39
  end
39
40
  labels << "none" if labels.empty?
40
41
  labels.join("|")
@@ -850,8 +850,10 @@ module Groonga
850
850
  #
851
851
  # 値の圧縮方法を指定する。省略した場合は、圧縮しない。
852
852
  #
853
- # - :zlib := 値をzlib圧縮して格納する。
854
- # - :lz4 := 値をLZ4圧縮して格納する。
853
+ # * `:zlib`: Compressed by zlib.
854
+ # * `:lz4`: Compzressed by LZ4.
855
+ # * `:zstd`: Compressed by Zstandard.
856
+ # * `:zstandard`: Compressed by Zstandard.
855
857
  def column(name, type, options={})
856
858
  definition = self[name, ColumnDefinition]
857
859
  if definition.nil?
data/rroonga-build.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2009-2016 Kouhei Sutou <kou@clear-code.com>
2
- # Copyright (C) 2015-2016 Masafumi Yokoyama <yokoyama@clear-code.com>
2
+ # Copyright (C) 2015-2017 Masafumi Yokoyama <yokoyama@clear-code.com>
3
3
  #
4
4
  # This library is free software; you can redistribute it and/or
5
5
  # modify it under the terms of the GNU Lesser General Public
@@ -17,16 +17,16 @@
17
17
  module RroongaBuild
18
18
  module RequiredGroongaVersion
19
19
  MAJOR = 6
20
- MINOR = 0
21
- MICRO = 9
20
+ MINOR = 1
21
+ MICRO = 1
22
22
  VERSION = [MAJOR, MINOR, MICRO]
23
- RELEASED_DATE = Time.utc(2016, 9, 29)
23
+ RELEASED_DATE = Time.utc(2016, 11, 29)
24
24
  end
25
25
 
26
26
  module LatestGroongaVersion
27
27
  MAJOR = 6
28
28
  MINOR = 1
29
- MICRO = 0
29
+ MICRO = 3
30
30
  VERSION = [MAJOR, MINOR, MICRO]
31
31
  end
32
32
 
data/rroonga.gemspec CHANGED
@@ -1,6 +1,7 @@
1
1
  # -*- mode: ruby; coding: utf-8 -*-
2
2
  #
3
3
  # Copyright (C) 2012-2016 Kouhei Sutou <kou@clear-code.com>
4
+ # Copyright (C) 2017 Masafumi Yokoyama <yokoyama@clear-code.com>
4
5
  #
5
6
  # This library is free software; you can redistribute it and/or
6
7
  # modify it under the terms of the GNU Lesser General Public
@@ -88,7 +89,7 @@ Gem::Specification.new do |s|
88
89
  s.add_development_dependency("test-unit", [">= 3.0.0"])
89
90
  s.add_development_dependency("rake")
90
91
  s.add_development_dependency("rake-compiler", [">= 0.9.5"])
91
- s.add_development_dependency("rake-compiler-dock")
92
+ s.add_development_dependency("rake-compiler-dock", [">= 0.6.0"])
92
93
  s.add_development_dependency("bundler")
93
94
  s.add_development_dependency("yard")
94
95
  s.add_development_dependency("packnga", [">= 1.0.0"])
data/test/test-context.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # Copyright (C) 2009-2015 Kouhei Sutou <kou@clear-code.com>
2
+ # Copyright (C) 2016 Masafumi Yokoyama <yokoyama@clear-code.com>
2
3
  #
3
4
  # This library is free software; you can redistribute it and/or
4
5
  # modify it under the terms of the GNU Lesser General Public
@@ -122,6 +123,10 @@ class ContextTest < Test::Unit::TestCase
122
123
  assert_boolean(Groonga::Context.default.support_lz4?)
123
124
  end
124
125
 
126
+ def test_support_zstd?
127
+ assert_boolean(Groonga::Context.default.support_zstd?)
128
+ end
129
+
125
130
  def test_match_escalation_threshold
126
131
  assert_equal(0, context.match_escalation_threshold)
127
132
  context.match_escalation_threshold = -1
@@ -1,5 +1,5 @@
1
- # Copyright (C) 2014-2015 Masafumi Yokoyama <yokoyama@clear-code.com>
2
1
  # Copyright (C) 2009-2014 Kouhei Sutou <kou@clear-code.com>
2
+ # Copyright (C) 2014-2016 Masafumi Yokoyama <yokoyama@clear-code.com>
3
3
  #
4
4
  # This library is free software; you can redistribute it and/or
5
5
  # modify it under the terms of the GNU Lesser General Public
@@ -100,6 +100,7 @@ class ExceptionTest < Test::Unit::TestCase
100
100
  assert_const_defined(Groonga, :CommandError)
101
101
  assert_const_defined(Groonga, :PluginError)
102
102
  assert_const_defined(Groonga, :ScorerError)
103
+ assert_const_defined(Groonga, :ZstdError)
103
104
  end
104
105
  end
105
106
 
data/test/test-logger.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # Copyright (C) 2010 Kouhei Sutou <kou@clear-code.com>
2
+ # Copyright (C) 2016 Masafumi Yokoyama <yokoyama@clear-code.com>
2
3
  #
3
4
  # This library is free software; you can redistribute it and/or
4
5
  # modify it under the terms of the GNU Lesser General Public
@@ -43,6 +44,14 @@ class LoggerTest < Test::Unit::TestCase
43
44
  assert_equal(:debug, Groonga::Logger.max_level)
44
45
  end
45
46
 
47
+ def test_flags
48
+ default_flags = Groonga::Logger::Flags::TIME |
49
+ Groonga::Logger::Flags::MESSAGE
50
+ assert_equal(default_flags, Groonga::Logger.flags)
51
+ Groonga::Logger.flags = Groonga::Logger::Flags::LOCATION
52
+ assert_equal(Groonga::Logger::Flags::LOCATION, Groonga::Logger.flags)
53
+ end
54
+
46
55
  sub_test_case ".log" do
47
56
  test "no options" do
48
57
  messages = []
@@ -137,4 +146,13 @@ class LoggerTest < Test::Unit::TestCase
137
146
  Groonga::Logger.log("Hello")
138
147
  assert_not_equal([], Dir.glob("#{@log_path}.*"))
139
148
  end
149
+
150
+ sub_test_case "Flags" do
151
+ sub_test_case "#label" do
152
+ test "pid" do
153
+ flags = Groonga::Logger::Flags::PID
154
+ assert_equal("pid", Groonga::Logger::Flags.label(flags))
155
+ end
156
+ end
157
+ end
140
158
  end
@@ -1,5 +1,5 @@
1
1
  # Copyright (C) 2009-2016 Kouhei Sutou <kou@clear-code.com>
2
- # Copyright (C) 2014 Masafumi Yokoyama <myokoym@gmail.com>
2
+ # Copyright (C) 2014-2016 Masafumi Yokoyama <yokoyama@clear-code.com>
3
3
  #
4
4
  # This library is free software; you can redistribute it and/or
5
5
  # modify it under the terms of the GNU Lesser General Public
@@ -432,6 +432,16 @@ column_create Posts title #{flags} ShortText
432
432
  SCHEMA
433
433
  end
434
434
 
435
+ def test_zstd
436
+ define_column_compression_zstd_schema
437
+ flags = "COLUMN_SCALAR"
438
+ flags << "|COMPRESS_ZSTD" if context.support_zstd?
439
+ assert_equal(<<-SCHEMA, dump)
440
+ table_create Posts TABLE_NO_KEY
441
+ column_create Posts title #{flags} ShortText
442
+ SCHEMA
443
+ end
444
+
435
445
  def test_with_weight_vector
436
446
  define_column_compression_with_weight_vector_schema
437
447
  flags = "COLUMN_VECTOR|WITH_WEIGHT"
@@ -459,6 +469,14 @@ column_create Posts comments #{flags} ShortText
459
469
  end
460
470
  end
461
471
 
472
+ def define_column_compression_zstd_schema
473
+ Groonga::Schema.define do |schema|
474
+ schema.create_table("Posts") do |table|
475
+ table.short_text("title", :compress => :zstd)
476
+ end
477
+ end
478
+ end
479
+
462
480
  def define_column_compression_with_weight_vector_schema
463
481
  Groonga::Schema.define do |schema|
464
482
  schema.create_table("Posts") do |table|
@@ -96,6 +96,16 @@ class VariableSizeColumnTest < Test::Unit::TestCase
96
96
  end
97
97
  end
98
98
 
99
+ def test_compressed_zstd?
100
+ description = @users.define_column("description", "ShortText",
101
+ :compress => :zstd)
102
+ if context.support_zstd?
103
+ assert {description.compressed?(:zstd)}
104
+ else
105
+ assert {not description.compressed?(:zstd)}
106
+ end
107
+ end
108
+
99
109
  def test_inspect
100
110
  assert_equal("#<Groonga::VariableSizeColumn " +
101
111
  "id: <#{@name.id}>, " +
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rroonga
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0
4
+ version: 6.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2016-11-07 00:00:00.000000000 Z
15
+ date: 2017-01-12 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: pkg-config
@@ -118,14 +118,14 @@ dependencies:
118
118
  requirements:
119
119
  - - ">="
120
120
  - !ruby/object:Gem::Version
121
- version: '0'
121
+ version: 0.6.0
122
122
  type: :development
123
123
  prerelease: false
124
124
  version_requirements: !ruby/object:Gem::Requirement
125
125
  requirements:
126
126
  - - ">="
127
127
  - !ruby/object:Gem::Version
128
- version: '0'
128
+ version: 0.6.0
129
129
  - !ruby/object:Gem::Dependency
130
130
  name: bundler
131
131
  requirement: !ruby/object:Gem::Requirement
@@ -195,8 +195,8 @@ email:
195
195
  - dara@shidara.net
196
196
  executables:
197
197
  - groonga-database-inspect
198
- - grntest-log-analyze
199
198
  - grndump
199
+ - grntest-log-analyze
200
200
  - groonga-index-dump
201
201
  extensions:
202
202
  - ext/groonga/extconf.rb
@@ -417,71 +417,71 @@ specification_version: 4
417
417
  summary: Ruby bindings for Groonga that provide full text search and column store
418
418
  features.
419
419
  test_files:
420
- - test/test-statistic-measurer.rb
421
- - test/test-table-select-weight.rb
422
- - test/test-table-key-support.rb
423
- - test/test-table-group.rb
424
- - test/test-id.rb
425
- - test/test-table-select-normalize.rb
426
- - test/test-schema-type.rb
427
- - test/test-record.rb
428
- - test/test-table-traverse.rb
429
- - test/test-data-column.rb
430
- - test/test-lock-timeout.rb
431
- - test/test-variable.rb
432
- - test/test-table-dumper.rb
433
- - test/test-gqtp.rb
434
- - test/test-database-inspector.rb
435
- - test/test-flushable.rb
436
- - test/test-context.rb
437
- - test/test-index-column.rb
438
- - test/test-exception.rb
439
- - test/test-fix-size-column.rb
440
- - test/test-config.rb
441
- - test/test-sub-records.rb
442
- - test/test-encoding.rb
443
- - test/test-patricia-trie.rb
444
420
  - test/run-test.rb
445
- - test/test-windows-event-logger.rb
446
- - test/test-plugin.rb
421
+ - test/test-error-message.rb
447
422
  - test/test-request-canceler.rb
448
- - test/test-query-logger.rb
449
- - test/test-schema-dumper.rb
450
- - test/test-snippet.rb
451
- - test/test-accessor.rb
452
- - test/test-database.rb
453
- - test/test-table-offset-and-limit.rb
454
- - test/test-version.rb
455
- - test/test-thread.rb
456
- - test/test-token-regexp.rb
457
- - test/test-table-select.rb
458
- - test/test-logger.rb
459
- - test/test-package-label.rb
460
- - test/groonga-test-utils.rb
461
- - test/test-expression-builder.rb
462
423
  - test/test-normalizer.rb
463
- - test/test-expression.rb
424
+ - test/test-database.rb
425
+ - test/test-schema-type.rb
464
426
  - test/test-convert.rb
465
- - test/test-index-cursor.rb
466
- - test/test-command-select.rb
467
- - test/test-vector-column.rb
427
+ - test/test-memory-pool.rb
428
+ - test/test-gqtp.rb
429
+ - test/test-id.rb
430
+ - test/test-schema-create-table.rb
431
+ - test/test-query-logger.rb
432
+ - test/test-pagination.rb
433
+ - test/test-expression-builder.rb
434
+ - test/test-table-group.rb
468
435
  - test/test-schema.rb
469
- - test/test-remote.rb
470
- - test/test-procedure.rb
471
- - test/test-name.rb
472
436
  - test/test-operator.rb
473
- - test/test-table-select-mecab.rb
474
- - test/test-schema-create-table.rb
437
+ - test/test-expression.rb
438
+ - test/test-name.rb
439
+ - test/test-patricia-trie.rb
440
+ - test/test-command-select.rb
441
+ - test/test-context.rb
442
+ - test/test-variable-size-column.rb
475
443
  - test/test-request-timer.rb
444
+ - test/test-variable.rb
445
+ - test/test-sub-records.rb
446
+ - test/test-index-cursor.rb
447
+ - test/test-double-array-trie.rb
448
+ - test/test-table-select.rb
449
+ - test/test-windows-event-logger.rb
450
+ - test/test-table-traverse.rb
451
+ - test/test-exception.rb
452
+ - test/test-index-column.rb
476
453
  - test/test-geo-point.rb
454
+ - test/test-vector-column.rb
455
+ - test/test-lock-timeout.rb
456
+ - test/test-array.rb
457
+ - test/test-schema-dumper.rb
458
+ - test/test-fix-size-column.rb
459
+ - test/test-table-select-mecab.rb
460
+ - test/test-procedure.rb
477
461
  - test/test-database-dumper.rb
478
- - test/test-table.rb
462
+ - test/test-database-inspector.rb
463
+ - test/test-package-label.rb
464
+ - test/test-data-column.rb
465
+ - test/test-table-key-support.rb
466
+ - test/test-table-offset-and-limit.rb
467
+ - test/test-accessor.rb
468
+ - test/test-remote.rb
469
+ - test/test-plugin.rb
470
+ - test/groonga-test-utils.rb
479
471
  - test/test-column.rb
480
- - test/test-pagination.rb
481
- - test/test-double-array-trie.rb
482
- - test/test-memory-pool.rb
483
- - test/test-type.rb
484
- - test/test-array.rb
485
- - test/test-variable-size-column.rb
486
- - test/test-error-message.rb
472
+ - test/test-record.rb
487
473
  - test/test-hash.rb
474
+ - test/test-logger.rb
475
+ - test/test-table-select-weight.rb
476
+ - test/test-version.rb
477
+ - test/test-table-select-normalize.rb
478
+ - test/test-config.rb
479
+ - test/test-flushable.rb
480
+ - test/test-encoding.rb
481
+ - test/test-thread.rb
482
+ - test/test-snippet.rb
483
+ - test/test-type.rb
484
+ - test/test-table.rb
485
+ - test/test-table-dumper.rb
486
+ - test/test-statistic-measurer.rb
487
+ - test/test-token-regexp.rb