iproto: generate strings for vinyl constants
Currently, we fill vy_page_info_key_strs, vy_run_info_key_strs, and vy_row_index_key_strs manually, which is inconvenient and error-prone. Let's generate them automatically from enum member names, like we do for IPROTO keys. Note, we have to rename VY_RUN_INFO_BLOOM and VY_RUN_INFO_BLOOM_LEGACY to VY_RUN_INFO_BLOOM_FILTER and VY_RUN_INFO_BLOOM_FILTER_LEGACY to preserve the xlog reader output. Still, the result isn't exactly the same: - An underscore is used instead of a space. - Strings are upper case now, not lower case, as they used to be. - VY_ROW_INDEX_DATA is now translated to "data", not "row index". The key names are used for two purposes: - For reporting ER_INVALID_INDEX_FILE error in vy_run.c. The changes enumerated above don't really matter there. - In the xlog reader. We replace spaces with underscores anyway there and convert the names to the lower case so the only problem is that "row_index" is replaced with "data" in xlog reader output. This should be fine though because (a) from the context it's clear that the data belong to a row index section, (b) reading vinyl index files is only useful for debugging and introspection, and (c) the field is a part of vinyl internals and was never documented properly. After this change we can remove the code replacing spaces with underscores from the xlog reader because all IPROTO constant names now use underscores. Follow-up #8443 Follow-up commit b3fb883b ("iproto: export IPROTO constants to Lua automatically") NO_DOC=refactoring NO_TEST=refactoring NO_CHANGELOG=refactoring (cherry picked from commit 96599a5b)
Showing
- src/box/iproto_constants.c 21 additions, 27 deletionssrc/box/iproto_constants.c
- src/box/iproto_constants.h 51 additions, 39 deletionssrc/box/iproto_constants.h
- src/box/lua/xlog.c 2 additions, 4 deletionssrc/box/lua/xlog.c
- src/box/vy_run.c 4 additions, 4 deletionssrc/box/vy_run.c
- test/vinyl/layout.result 4 additions, 4 deletionstest/vinyl/layout.result
Loading
Please register or sign in to comment