rroonga 5.0.3 → 5.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/ext/groonga/rb-grn-column.c +2 -0
- data/ext/groonga/rb-grn-database.c +1 -0
- data/ext/groonga/rb-grn-flushable.c +81 -0
- data/ext/groonga/rb-grn-table.c +1 -0
- data/ext/groonga/rb-grn.h +3 -1
- data/ext/groonga/rb-groonga.c +1 -0
- data/rroonga-build.rb +3 -3
- data/test/test-flushable.rb +49 -0
- metadata +50 -47
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4775fe73dce23e5903d824e9aa15ce08ab2a7fcf
|
4
|
+
data.tar.gz: 42bef5aad29f73c0938b8016607c2b7a310fe98b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d71139c901226ef9ce502df03003efee23da0bc43e21787d10858816d2fb1416d8b2f739861c6dd15bfdf8f1b0dd00913e46d69397218e3513c3a5e1b8a9bab
|
7
|
+
data.tar.gz: 4c2276a3e98a3273f8d61dde5f5d198f73ed0850761d5eacc236e8205242c44e76501f393245b3a3ee0ae89ec26f95458a54cafe250af0f453fb63c0339a1323
|
data/README.md
CHANGED
data/ext/groonga/rb-grn-column.c
CHANGED
@@ -788,6 +788,8 @@ rb_grn_init_column (VALUE mGrn)
|
|
788
788
|
{
|
789
789
|
rb_cGrnColumn = rb_define_class_under(mGrn, "Column", rb_cGrnObject);
|
790
790
|
|
791
|
+
rb_include_module(rb_cGrnColumn, rb_mGrnFlushable);
|
792
|
+
|
791
793
|
rb_define_method(rb_cGrnColumn, "table", rb_grn_column_get_table, 0);
|
792
794
|
rb_define_method(rb_cGrnColumn, "local_name",
|
793
795
|
rb_grn_column_get_local_name, 0);
|
@@ -601,6 +601,7 @@ rb_grn_init_database (VALUE mGrn)
|
|
601
601
|
|
602
602
|
rb_include_module(rb_cGrnDatabase, rb_mEnumerable);
|
603
603
|
rb_include_module(rb_cGrnDatabase, rb_mGrnEncodingSupport);
|
604
|
+
rb_include_module(rb_cGrnDatabase, rb_mGrnFlushable);
|
604
605
|
|
605
606
|
rb_define_singleton_method(rb_cGrnDatabase, "create",
|
606
607
|
rb_grn_database_s_create, -1);
|
@@ -0,0 +1,81 @@
|
|
1
|
+
/* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2
|
+
/*
|
3
|
+
Copyright (C) 2015 Masafumi Yokoyama <yokoyama@clear-code.com>
|
4
|
+
|
5
|
+
This library is free software; you can redistribute it and/or
|
6
|
+
modify it under the terms of the GNU Lesser General Public
|
7
|
+
License version 2.1 as published by the Free Software Foundation.
|
8
|
+
|
9
|
+
This library is distributed in the hope that it will be useful,
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
+
Lesser General Public License for more details.
|
13
|
+
|
14
|
+
You should have received a copy of the GNU Lesser General Public
|
15
|
+
License along with this library; if not, write to the Free Software
|
16
|
+
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
17
|
+
*/
|
18
|
+
|
19
|
+
#include "rb-grn.h"
|
20
|
+
|
21
|
+
#define SELF(object) (RB_GRN_OBJECT(DATA_PTR(object)))
|
22
|
+
|
23
|
+
VALUE rb_mGrnFlushable;
|
24
|
+
|
25
|
+
/*
|
26
|
+
* Document-module: Groonga::Flushable
|
27
|
+
*
|
28
|
+
* It provides the ability to flush data on memory to disk.
|
29
|
+
*/
|
30
|
+
|
31
|
+
/*
|
32
|
+
* Flush memory mapped data to disk.
|
33
|
+
*
|
34
|
+
* @overload flush(options={})
|
35
|
+
* @param [::Hash] options
|
36
|
+
* @option options [Boolean] :recursive (true) Whether to flush objects
|
37
|
+
* which a target object has recursively.
|
38
|
+
* @return [void]
|
39
|
+
*/
|
40
|
+
static VALUE
|
41
|
+
rb_grn_flushable_flush (int argc, VALUE *argv, VALUE self)
|
42
|
+
{
|
43
|
+
grn_ctx *context = NULL;
|
44
|
+
grn_obj *object = NULL;
|
45
|
+
VALUE rb_recursive_p;
|
46
|
+
VALUE rb_options;
|
47
|
+
|
48
|
+
rb_scan_args(argc, argv, "01", &rb_options);
|
49
|
+
rb_grn_scan_options(rb_options,
|
50
|
+
"recursive", &rb_recursive_p,
|
51
|
+
NULL);
|
52
|
+
if (NIL_P(rb_recursive_p)) {
|
53
|
+
rb_recursive_p = Qtrue;
|
54
|
+
}
|
55
|
+
|
56
|
+
rb_grn_object_deconstruct(SELF(self), &object, &context,
|
57
|
+
NULL, NULL, NULL, NULL);
|
58
|
+
if (!object) {
|
59
|
+
rb_raise(rb_eGrnClosed,
|
60
|
+
"can't access already closed Groonga object: <%s>",
|
61
|
+
rb_grn_inspect(self));
|
62
|
+
}
|
63
|
+
|
64
|
+
if (RVAL2CBOOL(rb_recursive_p)) {
|
65
|
+
grn_obj_flush_recursive(context, object);
|
66
|
+
} else {
|
67
|
+
grn_obj_flush(context, object);
|
68
|
+
}
|
69
|
+
rb_grn_context_check(context, self);
|
70
|
+
|
71
|
+
return Qnil;
|
72
|
+
}
|
73
|
+
|
74
|
+
void
|
75
|
+
rb_grn_init_flushable (VALUE mGrn)
|
76
|
+
{
|
77
|
+
rb_mGrnFlushable = rb_define_module_under(mGrn, "Flushable");
|
78
|
+
|
79
|
+
rb_define_method(rb_mGrnFlushable, "flush",
|
80
|
+
rb_grn_flushable_flush, -1);
|
81
|
+
}
|
data/ext/groonga/rb-grn-table.c
CHANGED
@@ -2571,6 +2571,7 @@ rb_grn_init_table (VALUE mGrn)
|
|
2571
2571
|
rb_define_alloc_func(rb_cGrnTable, rb_grn_table_alloc);
|
2572
2572
|
|
2573
2573
|
rb_include_module(rb_cGrnTable, rb_mEnumerable);
|
2574
|
+
rb_include_module(rb_cGrnTable, rb_mGrnFlushable);
|
2574
2575
|
|
2575
2576
|
rb_define_method(rb_cGrnTable, "initialize", rb_grn_table_initialize, 0);
|
2576
2577
|
|
data/ext/groonga/rb-grn.h
CHANGED
@@ -101,7 +101,7 @@ RB_GRN_BEGIN_DECLS
|
|
101
101
|
|
102
102
|
#define RB_GRN_MAJOR_VERSION 5
|
103
103
|
#define RB_GRN_MINOR_VERSION 0
|
104
|
-
#define RB_GRN_MICRO_VERSION
|
104
|
+
#define RB_GRN_MICRO_VERSION 4
|
105
105
|
|
106
106
|
#define RB_GRN_QUERY_DEFAULT_MAX_EXPRESSIONS 32
|
107
107
|
|
@@ -257,6 +257,7 @@ RB_GRN_VAR VALUE rb_eGrnInvalidArgument;
|
|
257
257
|
RB_GRN_VAR VALUE rb_eGrnNoMemoryAvailable;
|
258
258
|
RB_GRN_VAR VALUE rb_cGrnObject;
|
259
259
|
RB_GRN_VAR VALUE rb_mGrnEncodingSupport;
|
260
|
+
RB_GRN_VAR VALUE rb_mGrnFlushable;
|
260
261
|
RB_GRN_VAR VALUE rb_cGrnDatabase;
|
261
262
|
RB_GRN_VAR VALUE rb_cGrnTable;
|
262
263
|
RB_GRN_VAR VALUE rb_mGrnTableKeySupport;
|
@@ -305,6 +306,7 @@ void rb_grn_init_utils (VALUE mGrn);
|
|
305
306
|
void rb_grn_init_exception (VALUE mGrn);
|
306
307
|
void rb_grn_init_encoding (VALUE mGrn);
|
307
308
|
void rb_grn_init_encoding_support (VALUE mGrn);
|
309
|
+
void rb_grn_init_flushable (VALUE mGrn);
|
308
310
|
void rb_grn_init_context (VALUE mGrn);
|
309
311
|
void rb_grn_init_object (VALUE mGrn);
|
310
312
|
void rb_grn_init_database (VALUE mGrn);
|
data/ext/groonga/rb-groonga.c
CHANGED
data/rroonga-build.rb
CHANGED
@@ -20,15 +20,15 @@ module RroongaBuild
|
|
20
20
|
module RequiredGroongaVersion
|
21
21
|
MAJOR = 5
|
22
22
|
MINOR = 0
|
23
|
-
MICRO =
|
23
|
+
MICRO = 5
|
24
24
|
VERSION = [MAJOR, MINOR, MICRO]
|
25
|
-
RELEASED_DATE = Time.utc(2015,
|
25
|
+
RELEASED_DATE = Time.utc(2015, 6, 29)
|
26
26
|
end
|
27
27
|
|
28
28
|
module LatestGroongaVersion
|
29
29
|
MAJOR = 5
|
30
30
|
MINOR = 0
|
31
|
-
MICRO =
|
31
|
+
MICRO = 5
|
32
32
|
VERSION = [MAJOR, MINOR, MICRO]
|
33
33
|
end
|
34
34
|
|
@@ -0,0 +1,49 @@
|
|
1
|
+
# Copyright (C) 2015 Masafumi Yokoyama <yokoyama@clear-code.com>
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License version 2.1 as published by the Free Software Foundation.
|
6
|
+
#
|
7
|
+
# This library is distributed in the hope that it will be useful,
|
8
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
10
|
+
# Lesser General Public License for more details.
|
11
|
+
#
|
12
|
+
# You should have received a copy of the GNU Lesser General Public
|
13
|
+
# License along with this library; if not, write to the Free Software
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
15
|
+
|
16
|
+
class FlushableTest < Test::Unit::TestCase
|
17
|
+
include GroongaTestUtils
|
18
|
+
|
19
|
+
setup :setup_database
|
20
|
+
|
21
|
+
def test_flush_table
|
22
|
+
table = Groonga::Hash.create
|
23
|
+
assert_nothing_raised do
|
24
|
+
table.flush
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def test_flush_column
|
29
|
+
table = Groonga::Hash.create(:name => "Users")
|
30
|
+
column = table.define_column("name", "ShortText")
|
31
|
+
assert_nothing_raised do
|
32
|
+
column.flush
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def test_flush_database
|
37
|
+
assert_nothing_raised do
|
38
|
+
@database.flush
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_flush_not_recursive
|
43
|
+
table = Groonga::Hash.create
|
44
|
+
table.extend(Groonga::Flushable)
|
45
|
+
assert_nothing_raised do
|
46
|
+
table.flush(:recursive => false)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
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: 5.0.
|
4
|
+
version: 5.0.4
|
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: 2015-
|
15
|
+
date: 2015-07-13 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: pkg-config
|
@@ -195,8 +195,8 @@ email:
|
|
195
195
|
- dara@shidara.net
|
196
196
|
executables:
|
197
197
|
- groonga-index-dump
|
198
|
-
- grndump
|
199
198
|
- groonga-database-inspect
|
199
|
+
- grndump
|
200
200
|
- grntest-log-analyze
|
201
201
|
extensions:
|
202
202
|
- ext/groonga/extconf.rb
|
@@ -238,6 +238,7 @@ files:
|
|
238
238
|
- ext/groonga/rb-grn-expression-builder.c
|
239
239
|
- ext/groonga/rb-grn-expression.c
|
240
240
|
- ext/groonga/rb-grn-fix-size-column.c
|
241
|
+
- ext/groonga/rb-grn-flushable.c
|
241
242
|
- ext/groonga/rb-grn-geo-point.c
|
242
243
|
- ext/groonga/rb-grn-greater-equal-operator.c
|
243
244
|
- ext/groonga/rb-grn-greater-operator.c
|
@@ -318,6 +319,7 @@ files:
|
|
318
319
|
- test/test-expression-builder.rb
|
319
320
|
- test/test-expression.rb
|
320
321
|
- test/test-fix-size-column.rb
|
322
|
+
- test/test-flushable.rb
|
321
323
|
- test/test-geo-point.rb
|
322
324
|
- test/test-gqtp.rb
|
323
325
|
- test/test-hash.rb
|
@@ -385,61 +387,62 @@ specification_version: 4
|
|
385
387
|
summary: Ruby bindings for Groonga that provide full text search and column store
|
386
388
|
features.
|
387
389
|
test_files:
|
388
|
-
- test/test-schema.rb
|
389
|
-
- test/test-snippet.rb
|
390
|
-
- test/test-variable.rb
|
391
|
-
- test/test-geo-point.rb
|
392
390
|
- test/test-plugin.rb
|
393
|
-
- test/test-
|
394
|
-
- test/test-accessor.rb
|
395
|
-
- test/test-double-array-trie.rb
|
396
|
-
- test/test-pagination.rb
|
397
|
-
- test/test-memory-pool.rb
|
398
|
-
- test/test-column.rb
|
399
|
-
- test/test-table-traverse.rb
|
400
|
-
- test/test-expression.rb
|
391
|
+
- test/test-query-logger.rb
|
401
392
|
- test/test-table-select.rb
|
402
|
-
- test/test-encoding.rb
|
403
|
-
- test/test-logger.rb
|
404
|
-
- test/test-schema-create-table.rb
|
405
|
-
- test/test-hash.rb
|
406
|
-
- test/test-type.rb
|
407
393
|
- test/test-table-offset-and-limit.rb
|
394
|
+
- test/test-token-regexp.rb
|
395
|
+
- test/test-sub-records.rb
|
396
|
+
- test/test-index-cursor.rb
|
397
|
+
- test/test-convert.rb
|
408
398
|
- test/test-version.rb
|
399
|
+
- test/test-table.rb
|
409
400
|
- test/test-lock-timeout.rb
|
401
|
+
- test/test-schema-create-table.rb
|
410
402
|
- test/test-index-column.rb
|
411
|
-
- test/test-table-key-support.rb
|
412
|
-
- test/test-vector-column.rb
|
413
|
-
- test/test-normalizer.rb
|
414
|
-
- test/test-table-select-weight.rb
|
415
|
-
- test/test-schema-type.rb
|
416
|
-
- test/test-sub-records.rb
|
417
|
-
- test/test-procedure.rb
|
418
|
-
- test/test-context.rb
|
419
|
-
- test/test-gqtp.rb
|
420
|
-
- test/test-remote.rb
|
421
|
-
- test/test-database-dumper.rb
|
422
|
-
- test/test-database-inspector.rb
|
423
|
-
- test/test-patricia-trie.rb
|
424
|
-
- test/run-test.rb
|
425
403
|
- test/test-fix-size-column.rb
|
426
|
-
- test/test-
|
404
|
+
- test/test-table-dumper.rb
|
427
405
|
- test/test-array.rb
|
428
|
-
- test/test-table.rb
|
429
|
-
- test/groonga-test-utils.rb
|
430
406
|
- test/test-record.rb
|
431
|
-
- test/test-exception.rb
|
432
|
-
- test/test-table-select-normalize.rb
|
433
407
|
- test/test-schema-dumper.rb
|
434
|
-
- test/test-token-regexp.rb
|
435
|
-
- test/test-table-dumper.rb
|
436
|
-
- test/test-database.rb
|
437
|
-
- test/test-query-logger.rb
|
438
408
|
- test/test-variable-size-column.rb
|
439
|
-
- test/test-
|
440
|
-
- test/test-
|
409
|
+
- test/test-type.rb
|
410
|
+
- test/test-pagination.rb
|
411
|
+
- test/test-database-dumper.rb
|
412
|
+
- test/test-table-group.rb
|
413
|
+
- test/test-accessor.rb
|
414
|
+
- test/test-database.rb
|
415
|
+
- test/test-database-inspector.rb
|
441
416
|
- test/test-operator.rb
|
442
|
-
- test/test-
|
443
|
-
- test/test-
|
417
|
+
- test/test-procedure.rb
|
418
|
+
- test/test-expression-builder.rb
|
444
419
|
- test/test-command-select.rb
|
420
|
+
- test/test-double-array-trie.rb
|
421
|
+
- test/test-vector-column.rb
|
422
|
+
- test/test-encoding.rb
|
423
|
+
- test/test-table-key-support.rb
|
424
|
+
- test/test-gqtp.rb
|
425
|
+
- test/run-test.rb
|
426
|
+
- test/test-patricia-trie.rb
|
427
|
+
- test/test-remote.rb
|
428
|
+
- test/test-table-select-weight.rb
|
429
|
+
- test/test-statistic-measurer.rb
|
430
|
+
- test/test-logger.rb
|
431
|
+
- test/test-hash.rb
|
432
|
+
- test/test-schema-type.rb
|
433
|
+
- test/test-normalizer.rb
|
434
|
+
- test/test-flushable.rb
|
435
|
+
- test/test-snippet.rb
|
436
|
+
- test/test-variable.rb
|
437
|
+
- test/test-memory-pool.rb
|
438
|
+
- test/test-exception.rb
|
439
|
+
- test/test-table-select-mecab.rb
|
440
|
+
- test/test-table-select-normalize.rb
|
441
|
+
- test/test-schema.rb
|
442
|
+
- test/test-geo-point.rb
|
443
|
+
- test/test-table-traverse.rb
|
444
|
+
- test/groonga-test-utils.rb
|
445
|
+
- test/test-column.rb
|
446
|
+
- test/test-context.rb
|
447
|
+
- test/test-expression.rb
|
445
448
|
has_rdoc:
|