Kouhei Sutou
null+****@clear*****
Thu Aug 18 17:25:26 JST 2016
Kouhei Sutou 2016-08-18 17:25:26 +0900 (Thu, 18 Aug 2016) New Revision: 020c199d37884bcb105dc7aa9638108b86f605c5 https://github.com/groonga/groonga/commit/020c199d37884bcb105dc7aa9638108b86f605c5 Message: Rename INDEX_TINY to INDEX_SMALL Because we'll add INDEX_MEDIUM. Modified files: include/groonga/groonga.h lib/dump.c lib/grn_ii.h lib/ii.c lib/proc/proc_column.c test/command/suite/schema/tables/columns/type/index.expected test/command/suite/schema/tables/columns/type/index.test Renamed files: test/command/suite/dump/schema/column/index/index_small.expected (from test/command/suite/dump/schema/column/index/index_tiny.expected) test/command/suite/dump/schema/column/index/index_small.test (from test/command/suite/dump/schema/column/index/index_tiny.test) Modified: include/groonga/groonga.h (+1 -1) =================================================================== --- include/groonga/groonga.h 2016-08-18 17:21:09 +0900 (f8dc664) +++ include/groonga/groonga.h 2016-08-18 17:25:26 +0900 (72f2cfc) @@ -360,7 +360,7 @@ typedef uint32_t grn_column_flags; /* flags only for grn_column_flags */ -#define GRN_OBJ_INDEX_TINY (0x01<<16) +#define GRN_OBJ_INDEX_SMALL (0x01<<16) /* obj types */ Modified: lib/dump.c (+2 -2) =================================================================== --- lib/dump.c 2016-08-18 17:21:09 +0900 (cad2e57) +++ lib/dump.c 2016-08-18 17:25:26 +0900 (b796bbb) @@ -83,8 +83,8 @@ grn_dump_column_create_flags(grn_ctx *ctx, if (flags & GRN_OBJ_WITH_POSITION) { GRN_TEXT_PUTS(ctx, buffer, "|WITH_POSITION"); } - if (flags & GRN_OBJ_INDEX_TINY) { - GRN_TEXT_PUTS(ctx, buffer, "|INDEX_TINY"); + if (flags & GRN_OBJ_INDEX_SMALL) { + GRN_TEXT_PUTS(ctx, buffer, "|INDEX_SMALL"); } break; } Modified: lib/grn_ii.h (+1 -1) =================================================================== --- lib/grn_ii.h 2016-08-18 17:21:09 +0900 (7201291) +++ lib/grn_ii.h 2016-08-18 17:25:26 +0900 (5b24b7f) @@ -51,7 +51,7 @@ struct _grn_ii { #define GRN_II_MAX_CHUNK (1 << (GRN_II_W_TOTAL_CHUNK - GRN_II_W_CHUNK)) #define GRN_II_N_CHUNK_VARIATION (GRN_II_W_CHUNK - GRN_II_W_LEAST_CHUNK) -#define GRN_II_MAX_CHUNK_TINY (1 << (GRN_II_W_TOTAL_CHUNK - GRN_II_W_CHUNK - 8)) +#define GRN_II_MAX_CHUNK_SMALL (1 << (GRN_II_W_TOTAL_CHUNK - GRN_II_W_CHUNK - 8)) struct grn_ii_header { uint64_t total_chunk_size; Modified: lib/ii.c (+26 -26) =================================================================== --- lib/ii.c 2016-08-18 17:21:09 +0900 (c9a8178) +++ lib/ii.c 2016-08-18 17:25:26 +0900 (d24c7bb) @@ -44,7 +44,7 @@ #endif #define MAX_PSEG 0x20000 -#define MAX_PSEG_TINY 0x00200 +#define MAX_PSEG_SMALL 0x00200 #define S_CHUNK (1 << GRN_II_W_CHUNK) #define W_SEGMENT 18 #define S_SEGMENT (1 << W_SEGMENT) @@ -92,8 +92,8 @@ static double grn_ii_select_too_many_index_match_ratio = -1; static double grn_ii_estimate_size_for_query_reduce_ratio = 0.9; static grn_bool grn_ii_overlap_token_skip_enable = GRN_FALSE; static uint32_t grn_ii_builder_block_threshold_force = 0; -static uint32_t grn_ii_max_n_segments_tiny = MAX_PSEG_TINY; -static uint32_t grn_ii_max_n_chunks_tiny = GRN_II_MAX_CHUNK_TINY; +static uint32_t grn_ii_max_n_segments_small = MAX_PSEG_SMALL; +static uint32_t grn_ii_max_n_chunks_small = GRN_II_MAX_CHUNK_SMALL; void grn_ii_init_from_env(void) @@ -161,35 +161,35 @@ grn_ii_init_from_env(void) } { - char grn_ii_max_n_segments_tiny_env[GRN_ENV_BUFFER_SIZE]; - grn_getenv("GRN_II_MAX_N_SEGMENTS_TINY", - grn_ii_max_n_segments_tiny_env, + char grn_ii_max_n_segments_small_env[GRN_ENV_BUFFER_SIZE]; + grn_getenv("GRN_II_MAX_N_SEGMENTS_SMALL", + grn_ii_max_n_segments_small_env, GRN_ENV_BUFFER_SIZE); - if (grn_ii_max_n_segments_tiny_env[0]) { - grn_ii_max_n_segments_tiny = - grn_atoui(grn_ii_max_n_segments_tiny_env, - grn_ii_max_n_segments_tiny_env + - strlen(grn_ii_max_n_segments_tiny_env), + if (grn_ii_max_n_segments_small_env[0]) { + grn_ii_max_n_segments_small = + grn_atoui(grn_ii_max_n_segments_small_env, + grn_ii_max_n_segments_small_env + + strlen(grn_ii_max_n_segments_small_env), NULL); - if (grn_ii_max_n_segments_tiny > MAX_PSEG) { - grn_ii_max_n_segments_tiny = MAX_PSEG; + if (grn_ii_max_n_segments_small > MAX_PSEG) { + grn_ii_max_n_segments_small = MAX_PSEG; } } } { - char grn_ii_max_n_chunks_tiny_env[GRN_ENV_BUFFER_SIZE]; - grn_getenv("GRN_II_MAX_N_CHUNKS_TINY", - grn_ii_max_n_chunks_tiny_env, + char grn_ii_max_n_chunks_small_env[GRN_ENV_BUFFER_SIZE]; + grn_getenv("GRN_II_MAX_N_CHUNKS_SMALL", + grn_ii_max_n_chunks_small_env, GRN_ENV_BUFFER_SIZE); - if (grn_ii_max_n_chunks_tiny_env[0]) { - grn_ii_max_n_chunks_tiny = - grn_atoui(grn_ii_max_n_chunks_tiny_env, - grn_ii_max_n_chunks_tiny_env + - strlen(grn_ii_max_n_chunks_tiny_env), + if (grn_ii_max_n_chunks_small_env[0]) { + grn_ii_max_n_chunks_small = + grn_atoui(grn_ii_max_n_chunks_small_env, + grn_ii_max_n_chunks_small_env + + strlen(grn_ii_max_n_chunks_small_env), NULL); - if (grn_ii_max_n_chunks_tiny > GRN_II_MAX_CHUNK) { - grn_ii_max_n_chunks_tiny = GRN_II_MAX_CHUNK; + if (grn_ii_max_n_chunks_small > GRN_II_MAX_CHUNK) { + grn_ii_max_n_chunks_small = GRN_II_MAX_CHUNK; } } } @@ -4087,9 +4087,9 @@ _grn_ii_create(grn_ctx *ctx, grn_ii *ii, const char *path, grn_obj *lexicon, uin } if (path && strlen(path) + 6 >= PATH_MAX) { return NULL; } - if (flags & GRN_OBJ_INDEX_TINY) { - max_n_segments = grn_ii_max_n_segments_tiny; - max_n_chunks = grn_ii_max_n_chunks_tiny; + if (flags & GRN_OBJ_INDEX_SMALL) { + max_n_segments = grn_ii_max_n_segments_small; + max_n_chunks = grn_ii_max_n_chunks_small; } else { max_n_segments = MAX_PSEG; max_n_chunks = GRN_II_MAX_CHUNK; Modified: lib/proc/proc_column.c (+1 -1) =================================================================== --- lib/proc/proc_column.c 2016-08-18 17:21:09 +0900 (2d26b91) +++ lib/proc/proc_column.c 2016-08-18 17:25:26 +0900 (49be56c) @@ -57,7 +57,7 @@ grn_proc_column_parse_flags(grn_ctx *ctx, CHECK_FLAG(WITH_WEIGHT); CHECK_FLAG(WITH_POSITION); CHECK_FLAG(RING_BUFFER); - CHECK_FLAG(INDEX_TINY); + CHECK_FLAG(INDEX_SMALL); #undef CHECK_FLAG Renamed: test/command/suite/dump/schema/column/index/index_small.expected (+2 -2) 74% =================================================================== --- test/command/suite/dump/schema/column/index/index_tiny.expected 2016-08-18 17:21:09 +0900 (abfdef3) +++ test/command/suite/dump/schema/column/index/index_small.expected 2016-08-18 17:25:26 +0900 (8af0424) @@ -4,7 +4,7 @@ column_create Users name COLUMN_SCALAR ShortText [[0,0.0,0.0],true] table_create Names TABLE_HASH_KEY ShortText [[0,0.0,0.0],true] -column_create Names users COLUMN_INDEX|INDEX_TINY Users name +column_create Names users COLUMN_INDEX|INDEX_SMALL Users name [[0,0.0,0.0],true] dump table_create Names TABLE_HASH_KEY ShortText @@ -12,4 +12,4 @@ table_create Names TABLE_HASH_KEY ShortText table_create Users TABLE_HASH_KEY ShortText column_create Users name COLUMN_SCALAR ShortText -column_create Names users COLUMN_INDEX|INDEX_TINY Users name +column_create Names users COLUMN_INDEX|INDEX_SMALL Users name Renamed: test/command/suite/dump/schema/column/index/index_small.test (+1 -1) 69% =================================================================== --- test/command/suite/dump/schema/column/index/index_tiny.test 2016-08-18 17:21:09 +0900 (e9f89ed) +++ test/command/suite/dump/schema/column/index/index_small.test 2016-08-18 17:25:26 +0900 (0721aba) @@ -2,6 +2,6 @@ table_create Users TABLE_HASH_KEY ShortText column_create Users name COLUMN_SCALAR ShortText table_create Names TABLE_HASH_KEY ShortText -column_create Names users COLUMN_INDEX|INDEX_TINY Users name +column_create Names users COLUMN_INDEX|INDEX_SMALL Users name dump Modified: test/command/suite/schema/tables/columns/type/index.expected (+3 -3) =================================================================== --- test/command/suite/schema/tables/columns/type/index.expected 2016-08-18 17:21:09 +0900 (374d4bf) +++ test/command/suite/schema/tables/columns/type/index.expected 2016-08-18 17:25:26 +0900 (58bbc8b) @@ -6,7 +6,7 @@ column_create Posts content COLUMN_SCALAR Text [[0,0.0,0.0],true] table_create Terms TABLE_PAT_KEY ShortText --default_tokenizer TokenBigram --normalizer NormalizerAuto [[0,0.0,0.0],true] -column_create Terms index COLUMN_INDEX|WITH_SECTION|WITH_WEIGHT|WITH_POSITION|INDEX_TINY Posts _key,title,content +column_create Terms index COLUMN_INDEX|WITH_SECTION|WITH_WEIGHT|WITH_POSITION|INDEX_SMALL Posts _key,title,content [[0,0.0,0.0],true] schema [ @@ -350,11 +350,11 @@ schema "arguments": { "table": "Terms", "name": "index", - "flags": "COLUMN_INDEX|WITH_SECTION|WITH_WEIGHT|WITH_POSITION|INDEX_TINY", + "flags": "COLUMN_INDEX|WITH_SECTION|WITH_WEIGHT|WITH_POSITION|INDEX_SMALL", "type": "Posts", "sources": "_key,title,content" }, - "command_line": "column_create --table Terms --name index --flags COLUMN_INDEX|WITH_SECTION|WITH_WEIGHT|WITH_POSITION|INDEX_TINY --type Posts --sources _key,title,content" + "command_line": "column_create --table Terms --name index --flags COLUMN_INDEX|WITH_SECTION|WITH_WEIGHT|WITH_POSITION|INDEX_SMALL --type Posts --sources _key,title,content" } } } Modified: test/command/suite/schema/tables/columns/type/index.test (+1 -1) =================================================================== --- test/command/suite/schema/tables/columns/type/index.test 2016-08-18 17:21:09 +0900 (5c12b44) +++ test/command/suite/schema/tables/columns/type/index.test 2016-08-18 17:25:26 +0900 (73b8a4d) @@ -6,7 +6,7 @@ table_create Terms TABLE_PAT_KEY ShortText \ --default_tokenizer TokenBigram \ --normalizer NormalizerAuto column_create Terms index \ - COLUMN_INDEX|WITH_SECTION|WITH_WEIGHT|WITH_POSITION|INDEX_TINY \ + COLUMN_INDEX|WITH_SECTION|WITH_WEIGHT|WITH_POSITION|INDEX_SMALL \ Posts _key,title,content schema -------------- next part -------------- HTML����������������������������... Télécharger