diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index a847207bea80..2f4ece39f833 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -741,16 +741,14 @@ static int rocksdb_init_func(void *p) sql_print_information("RocksDB: Column Families at start:"); for (size_t i = 0; i < cf_names.size(); ++i) { - int tfsb= target_file_size_base_map.get_val(cf_names[i].c_str()); - size_t wbs= write_buffer_size_map.get_val(cf_names[i].c_str()); + rocksdb::ColumnFamilyOptions opts; + get_cf_options(cf_names[i], &opts); sql_print_information(" cf=%s", cf_names[i].c_str()); - sql_print_information(" write_buffer_size=%ld", wbs); - sql_print_information(" target_file_size_base=%d", tfsb); + sql_print_information(" write_buffer_size=%ld", opts.write_buffer_size); + sql_print_information(" target_file_size_base=%d", + opts.target_file_size_base); - rocksdb::ColumnFamilyOptions opts(default_cf_opts); - opts.write_buffer_size= wbs; - opts.target_file_size_base= tfsb; cf_descr.push_back(rocksdb::ColumnFamilyDescriptor(cf_names[i], opts)); } diff --git a/storage/rocksdb/rdb_cf_option.cc b/storage/rocksdb/rdb_cf_option.cc index aa861f53ded4..1962b26261d8 100644 --- a/storage/rocksdb/rdb_cf_option.cc +++ b/storage/rocksdb/rdb_cf_option.cc @@ -25,7 +25,7 @@ /* - Read a number from a string. The number may have a suffix Kk/Mm/Gg. + Read a number from a string. The number may have a suffix Kk/Mm/Gg/Tt. The code is copied from eval_num_suffix(). @param str INOUT string pointer @@ -52,6 +52,8 @@ bool read_number_and_suffix(const char **str, longlong *number) num*= 1024L * 1024L; else if (*endchar == 'g' || *endchar == 'G') num*= 1024L * 1024L * 1024L; + else if (*endchar == 't' || *endchar == 'T') + num*= 1024LL * 1024LL * 1024LL * 1024LL; else suffix_chars= 0; @@ -63,10 +65,10 @@ bool read_number_and_suffix(const char **str, longlong *number) /* - Read column family name, followed by semicolon ':' + Read column family name, followed by colon ':' @param str INOUT string pointer. On return points to right after - the semicolon. + the colon. @return 0 - OK 1 - Error */ @@ -79,17 +81,27 @@ bool read_cf_name(const char **str_arg) if (str[0] == ':') { *str_arg= str + 1; - return 0; /* OK */ + return false; /* OK */ } - return 1; /* Error */ + return true; /* Error */ } /* + @brief + Parse a per-Column Family numeric argument. It can be a single number of + specify value for each CF. + + @detail Parse a string value that maybe either - a single number-with-suffix - a line in form - cfname:value,cfname2:value2,... + + cfname:value,cfname2:value2,... + + where cfname='default' also sets the default value (which is used for + the column family named 'default' and also column families for which + the value wasn't specified explicitly.) @param str String with option value @param out OUT Parsed option value @@ -123,8 +135,9 @@ bool parse_per_cf_numeric(const char *str, Numeric_cf_option *out) out->name_map[cf_name_str]= num; /* - However, if there is column family named "DEFAULT" it is take in as - default. + If column family is named "default", its pameter value is also the + default value for column familes which dont have an explicitly specified + value. */ if (!strcmp(cf_name_str.c_str(), DEFAULT_CF_NAME)) out->default_val= num;