Kouhei Sutou
null+****@clear*****
Fri Mar 7 15:14:39 JST 2014
Kouhei Sutou 2014-03-07 15:14:39 +0900 (Fri, 07 Mar 2014) New Revision: 2713786401383409c8747840488185aeecc3267b https://github.com/groonga/groonga/commit/2713786401383409c8747840488185aeecc3267b Message: Make GRN_JA_SEGREGATE_THRESHOLD customizable * configure: --with-ja-segregate-threshold=16 * CMake: -DGRN_JA_SEGREGATE_THRESHOLD=16 Because changing segregate threshold in ja breaks database compatibility. We can't introduce the breakage in 4.0.1. But this change will be usable for many users. So we provide a option to customize the value. Modified files: .travis.yml CMakeLists.txt config.h.cmake configure.ac lib/store.c tools/travis-before-script.sh Modified: .travis.yml (+2 -0) =================================================================== --- .travis.yml 2014-03-06 14:43:11 +0900 (e5c922c) +++ .travis.yml 2014-03-07 15:14:39 +0900 (3757615) @@ -8,7 +8,9 @@ compiler: env: - BUILD_TOOL=autotools - BUILD_TOOL=autotools ENABLE_MRUBY=yes + - BUILD_TOOL=autotools JA_SEGREGATE_THRESHOLD=16 - BUILD_TOOL=cmake + - BUILD_TOOL=cmake JA_SEGREGATE_THRESHOLD=16 install: - curl https://raw.github.com/clear-code/cutter/master/data/travis/setup.sh | sh - sudo apt-get install -qq -y autotools-dev zlib1g-dev liblzo2-dev libmsgpack-dev libevent-dev libmecab-dev mecab-naist-jdic cmake Modified: CMakeLists.txt (+18 -0) =================================================================== --- CMakeLists.txt 2014-03-06 14:43:11 +0900 (8563abd) +++ CMakeLists.txt 2014-03-07 15:14:39 +0900 (ca18733) @@ -67,6 +67,24 @@ set(GRN_STACK_SIZE 1024 CACHE STRING "DANGER!!! groonga stack size. Normarlly, you should not change this variable.") +set(GRN_JA_SEGREGATE_THRESHOLD + 7 + CACHE STRING + "DANGER!!! This option breaks database compatibility. + You can't use the same database with different + GRN_JA_SEGREGATE_THRESHOLD Groongas. + This option changes data management threshold for variable size columns + such as ShortText type column and COLUMN_VECTOR column. + (default=7) + + If you don't delete/update variable size column values, you don't need to + change it. If you delete/update variable size column values with + [128, 65535] size data, GRN_JA_SEGREGATE_THRESHOLD=16 will better + database size. + In the case, your database size will be increased unlimitedly with + the default GRN_JA_SEGREGATE_THRESHOLD (= 7). + Your database size will not be increased unlimitedly with + GRN_JA_SEGREGATE_THRESHOLD=16.") set(GRN_LOCK_TIMEOUT 10000000 CACHE STRING Modified: config.h.cmake (+3 -0) =================================================================== --- config.h.cmake 2014-03-06 14:43:11 +0900 (1744b19) +++ config.h.cmake 2014-03-07 15:14:39 +0900 (49a99d3) @@ -30,6 +30,9 @@ #define GRN_STACK_SIZE ${GRN_STACK_SIZE} +#define GRN_JA_SEGREGATE_THRESHOLD \ + ${GRN_JA_SEGREGATE_THRESHOLD} + #define GRN_LOCK_TIMEOUT ${GRN_LOCK_TIMEOUT} #define GRN_LOCK_WAIT_TIME_NANOSECOND \ ${GRN_LOCK_WAIT_TIME_NANOSECOND} Modified: configure.ac (+22 -0) =================================================================== --- configure.ac 2014-03-06 14:43:11 +0900 (b7bc89c) +++ configure.ac 2014-03-07 15:14:39 +0900 (ad36c92) @@ -440,6 +440,26 @@ AC_ARG_WITH(stack_size, GRN_STACK_SIZE="$withval") AC_DEFINE_UNQUOTED(GRN_STACK_SIZE, [$GRN_STACK_SIZE], [stack size]) +# Use at your own risk!!!: ja segregate threshold +GRN_JA_SEGREGATE_THRESHOLD=7 +AC_ARG_WITH(ja_segregate_threshold, + [AS_HELP_STRING([--with-ja-segregate-threshold=THRESHOLD], + [DANGER!!! This option breaks database compatibility. + You can't use the same database with different THRESHOLD Groongas. + This option changes data management threshold for variable size columns + such as ShortText type column and COLUMN_VECTOR column. + (default=7) + If you don't delete/update variable size column values, you don't need to + change it. If you delete/update variable size column values with + [128, 65535] size data, THRESHOLD=16 will better database size. + In the case, your database size will be increased unlimitedly with + the default THRESHOLD (= 7). Your database size will not be increased + unlimitedly with THRESHOLD=16.])], + GRN_JA_SEGREGATE_THRESHOLD="$withval") +AC_DEFINE_UNQUOTED(GRN_JA_SEGREGATE_THRESHOLD, + [$GRN_JA_SEGREGATE_THRESHOLD], + [segregate threshold for ja]) + # lock timeout GRN_LOCK_TIMEOUT=10000000 AC_ARG_WITH(lock_timeout, @@ -1414,6 +1434,8 @@ echo " CFLAGS: ${CFLAGS}" echo " CXXFLAGS: ${CXXFLAGS}" echo " Libraries: ${LIBS}" echo " Stack size: ${GRN_STACK_SIZE}" +echo " ja:" +echo " Segregate threshold: ${GRN_JA_SEGREGATE_THRESHOLD}" echo " Document: ${document_available}" echo " buildable: ${document_buildable}" echo " built: ${have_built_document}" Modified: lib/store.c (+5 -1) =================================================================== --- lib/store.c 2014-03-06 14:43:11 +0900 (2a1e356) +++ lib/store.c 2014-03-07 15:14:39 +0900 (3b6f247) @@ -203,7 +203,11 @@ grn_ra_cache_fin(grn_ctx *ctx, grn_ra *ra, grn_id id) /**** jagged arrays ****/ -#define GRN_JA_W_SEGREGATE_THRESH 16 +#ifdef GRN_JA_SEGREGATE_THRESHOLD +# define GRN_JA_W_SEGREGATE_THRESH GRN_JA_SEGREGATE_THRESHOLD +#else +# define GRN_JA_W_SEGREGATE_THRESH 7 +#endif #define GRN_JA_W_CAPACITY 38 #define GRN_JA_W_SEGMENT 22 Modified: tools/travis-before-script.sh (+6 -0) =================================================================== --- tools/travis-before-script.sh 2014-03-06 14:43:11 +0900 (c6cfc85) +++ tools/travis-before-script.sh 2014-03-07 15:14:39 +0900 (71504a6) @@ -13,6 +13,9 @@ case "${BUILD_TOOL}" in if [ "$ENABLE_MRUBY" = "yes" ]; then configure_args="${configure_args} --enable-mruby" fi + if [ -n "${JA_SEGREGATE_THRESHOLD}" ]; then + configure_args="${configure_args} --with-ja-segregate-threshold=${JA_SEGREGATE_THRESHOLD}" + fi ./configure --with-ruby19 ${configure_args} ;; @@ -22,6 +25,9 @@ case "${BUILD_TOOL}" in if [ "$ENABLE_MRUBY" = "yes" ]; then cmake_args="${cmake_args} -DGRN_WITH_MRUBY=yes" fi + if [ -n "${JA_SEGREGATE_THRESHOLD}" ]; then + cmake_args="${cmake_args} -DGRN_JA_SEGREGATE_THRESHOLD=${JA_SEGREGATE_THRESHOLD}" + fi cmake . ${cmake_args} ;; -------------- next part -------------- HTML����������������������������...Download