rroonga 7.0.2 → 7.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +2 -2
- data/doc/text/news.md +46 -7
- data/ext/groonga/rb-grn-array.c +1 -272
- data/ext/groonga/rb-grn-column-cache.c +240 -0
- data/ext/groonga/rb-grn-column.c +1 -1
- data/ext/groonga/rb-grn-context.c +28 -4
- data/ext/groonga/rb-grn-expression.c +23 -1
- data/ext/groonga/rb-grn-object.c +44 -1
- data/ext/groonga/rb-grn-procedure.c +16 -1
- data/ext/groonga/rb-grn-query-logger.c +55 -6
- data/ext/groonga/rb-grn-table.c +170 -1
- data/ext/groonga/rb-grn-utils.c +21 -2
- data/ext/groonga/rb-grn.h +18 -3
- data/ext/groonga/rb-groonga.c +2 -1
- data/lib/groonga.rb +8 -5
- data/lib/groonga/column.rb +0 -5
- data/lib/groonga/database.rb +0 -10
- data/lib/groonga/index-column.rb +0 -10
- data/lib/groonga/query-logger.rb +1 -1
- data/rroonga-build.rb +6 -6
- data/rroonga.gemspec +1 -1
- data/test/groonga-test-utils.rb +5 -8
- data/test/test-array.rb +1 -131
- data/test/test-column-cache.rb +46 -0
- data/test/test-command-select.rb +36 -1
- data/test/test-context.rb +1 -2
- data/test/test-database.rb +16 -2
- data/test/test-logger.rb +13 -1
- data/test/test-procedure.rb +7 -1
- data/test/test-query-logger.rb +12 -1
- data/test/test-table-arrow.rb +193 -0
- data/test/test-table-offset-and-limit.rb +3 -1
- metadata +65 -64
- data/lib/groonga/statistic-measurer.rb +0 -37
- data/lib/groonga/table.rb +0 -25
- data/test/test-statistic-measurer.rb +0 -55
@@ -1,37 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 Kouhei Sutou <kou@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
|
-
module Groonga
|
19
|
-
# Measures statistic.
|
20
|
-
class StatisticMeasurer
|
21
|
-
MAX_N_ADDITIONAL_PATHS = 4096
|
22
|
-
|
23
|
-
# @param path [String, nil] Measures disk usage of the path.
|
24
|
-
# @return [Integer] 0 if path is @nil@, disk usage of the path otherwise.
|
25
|
-
def measure_disk_usage(path)
|
26
|
-
return 0 if path.nil?
|
27
|
-
|
28
|
-
usage = File.size(path)
|
29
|
-
1.step(MAX_N_ADDITIONAL_PATHS) do |i|
|
30
|
-
additional_path = "%s.%03X" % [path, i]
|
31
|
-
break unless File.exist?(additional_path)
|
32
|
-
usage += File.size(additional_path)
|
33
|
-
end
|
34
|
-
usage
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
data/lib/groonga/table.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Copyright (C) 2013 Kouhei Sutou <kou@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
|
-
module Groonga
|
19
|
-
class Table
|
20
|
-
def disk_usage
|
21
|
-
measurer = StatisticMeasurer.new
|
22
|
-
measurer.measure_disk_usage(path)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
# Copyright (C) 2013 Kouhei Sutou <kou@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 StatisticMeasurerTest < Test::Unit::TestCase
|
17
|
-
include GroongaTestUtils
|
18
|
-
|
19
|
-
def setup
|
20
|
-
@measurer = Groonga::StatisticMeasurer.new
|
21
|
-
end
|
22
|
-
|
23
|
-
class DiskUsageTest < self
|
24
|
-
def test_nil
|
25
|
-
assert_equal(0, disk_usage(nil))
|
26
|
-
end
|
27
|
-
|
28
|
-
def test_path_only
|
29
|
-
size = 5
|
30
|
-
path = File.join(@tmp_dir, "db")
|
31
|
-
write(path, "X" * size)
|
32
|
-
assert_equal(size, disk_usage(path))
|
33
|
-
end
|
34
|
-
|
35
|
-
def test_additional_path
|
36
|
-
size_per_file = 5
|
37
|
-
path = File.join(@tmp_dir, "db")
|
38
|
-
write(path, "X" * size_per_file)
|
39
|
-
write("#{path}.001", "X" * size_per_file)
|
40
|
-
write("#{path}.002", "X" * size_per_file)
|
41
|
-
assert_equal(3 * size_per_file, disk_usage(path))
|
42
|
-
end
|
43
|
-
|
44
|
-
private
|
45
|
-
def disk_usage(path)
|
46
|
-
@measurer.measure_disk_usage(path)
|
47
|
-
end
|
48
|
-
|
49
|
-
def write(path, content)
|
50
|
-
File.open(path, "w") do |file|
|
51
|
-
file.write(content)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|