mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 06:22:28 +01:00
closes #5206 merge c++ changes to mainline
git-svn-id: file:///svn/toku/tokudb@45903 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
18babb7812
commit
958c447641
1004 changed files with 7068 additions and 4499 deletions
|
@ -7,6 +7,7 @@ include(TokuSetupIntelCompiler)
|
|||
|
||||
project(TokuDB)
|
||||
|
||||
# suppress -rdynamic
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
|
||||
|
||||
|
@ -25,7 +26,7 @@ set(LIBTOKUDB "tokudb" CACHE STRING "Name of libtokudb.so")
|
|||
## add an option for cilk
|
||||
option(USE_CILK "Use cilk in tokudb." OFF)
|
||||
## can't use cilk without icc
|
||||
if (USE_CILK AND (NOT CMAKE_C_COMPILER_ID MATCHES Intel))
|
||||
if (USE_CILK AND (NOT CMAKE_CXX_COMPILER_ID MATCHES Intel))
|
||||
message(FATAL_ERROR "You specified USE_CILK=ON so you need INTEL_CC=ON.")
|
||||
endif ()
|
||||
|
||||
|
|
|
@ -143,8 +143,8 @@ if(NOT @RUN_PERF_TESTS@)
|
|||
endif()
|
||||
|
||||
## don't run perf tests with valgrind (that's slow)
|
||||
file(GLOB perf_test_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src/tests" perf_*.c)
|
||||
string(REGEX REPLACE "\\.c(;|$)" ".tdb\\1" perf_tests "${perf_test_srcs}")
|
||||
file(GLOB perf_test_srcs RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src/tests" perf_*.cc)
|
||||
string(REGEX REPLACE "\\.cc(;|$)" ".tdb\\1" perf_tests "${perf_test_srcs}")
|
||||
set(tdb_tests_that_should_fail "ydb/${perf_tests}")
|
||||
string(REGEX REPLACE ";" ";ydb/" perf_tests "${perf_tests}")
|
||||
list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE ${perf_tests})
|
||||
|
|
|
@ -4,7 +4,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/runcat.sh" "#!/bin/bash
|
|||
out=$1; shift
|
||||
exec \"$@\" >$out")
|
||||
|
||||
add_executable(make_tdb make_tdb.c)
|
||||
add_executable(make_tdb make_tdb)
|
||||
set_property(TARGET make_tdb APPEND PROPERTY COMPILE_DEFINITIONS _GNU_SOURCE)
|
||||
add_custom_command(
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/db.h"
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/*
|
||||
* See the file LICENSE for redistribution information.
|
||||
*
|
||||
* Copyright (c) 1996,2007 Oracle. All rights reserved.
|
||||
*
|
||||
* $Id: db.in,v 12.158 2007/06/28 14:23:35 mjc Exp $
|
||||
* $Id$
|
||||
*
|
||||
* db.h include file layout:
|
||||
* General.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "$Id$"
|
||||
/* LICENSE: This file is licensed under the GPL or from Tokutek. */
|
||||
|
@ -510,14 +510,14 @@ int main (int argc, char *const argv[] __attribute__((__unused__))) {
|
|||
|
||||
printf("#ifndef _DB_H\n");
|
||||
printf("#define _DB_H\n");
|
||||
printf("/* This code generated by make_db_h. Copyright (c) 2007-2011 Tokutek */\n");
|
||||
printf("#ident \"Copyright (c) 2007-2011 Tokutek Inc. All rights reserved.\"\n");
|
||||
printf("/* This code generated by make_db_h. Copyright (c) 2007-2012 Tokutek */\n");
|
||||
printf("#ident \"Copyright (c) 2007-2012 Tokutek Inc. All rights reserved.\"\n");
|
||||
printf("#include <sys/types.h>\n");
|
||||
printf("/*stdio is needed for the FILE* in db->verify*/\n");
|
||||
printf("#include <stdio.h>\n");
|
||||
printf("#include <stdint.h>\n");
|
||||
//printf("#include <inttypes.h>\n");
|
||||
printf("#if defined(__cplusplus)\nextern \"C\" {\n#endif\n");
|
||||
printf("#if defined(__cplusplus) || defined(__cilkplusplus)\nextern \"C\" {\n#endif\n");
|
||||
|
||||
printf("#define TOKUDB 1\n");
|
||||
printf("#define TOKUDB_NATIVE_H 1\n");
|
||||
|
@ -712,7 +712,7 @@ int main (int argc, char *const argv[] __attribute__((__unused__))) {
|
|||
printf("void db_env_enable_engine_status(u_int32_t) %s;\n", VISIBLE);
|
||||
printf("void db_env_set_flusher_thread_callback (void (*)(int, void*), void*) %s;\n", VISIBLE);
|
||||
|
||||
printf("#if defined(__cplusplus)\n}\n#endif\n");
|
||||
printf("#if defined(__cplusplus) || defined(__cilkplusplus)\n}\n#endif\n");
|
||||
printf("#endif\n");
|
||||
|
||||
return 0;
|
|
@ -27,6 +27,11 @@ SET(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
|
|||
SET(CMAKE_C_FLAGS "@CMAKE_C_FLAGS@")
|
||||
SET(CMAKE_C_FLAGS_DEBUG "@CMAKE_C_FLAGS_DEBUG@")
|
||||
SET(CMAKE_C_FLAGS_RELEASE "@CMAKE_C_FLAGS_RELEASE@")
|
||||
SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
|
||||
SET(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
|
||||
SET(CMAKE_CXX_FLAGS "@CMAKE_CXX_FLAGS@")
|
||||
SET(CMAKE_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@")
|
||||
SET(CMAKE_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@")
|
||||
SET(CMAKE_BUILD_TYPE "@CMAKE_BUILD_TYPE@")
|
||||
SET(CMAKE_TOP_BINARY_DIR "@CMAKE_TOP_BINARY_DIR@")
|
||||
SET(LIBTOKUPORTABILITY "@LIBTOKUPORTABILITY@")
|
||||
|
@ -67,11 +72,11 @@ ENDFOREACH()
|
|||
|
||||
SET(TARGET_O ${TARGET}_combined.o)
|
||||
|
||||
IF(CMAKE_BUILD_TYPE STREQUAL Release AND CMAKE_C_COMPILER_ID STREQUAL Intel)
|
||||
SET(flags "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_RELEASE}")
|
||||
IF(CMAKE_BUILD_TYPE STREQUAL Release AND CMAKE_CXX_COMPILER_ID STREQUAL Intel)
|
||||
SET(flags "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
|
||||
SEPARATE_ARGUMENTS(flags)
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${CMAKE_C_COMPILER} ${flags} -ipo1 -ipo-c -diag-disable 10015 -o ${TARGET_O} ${ALL_OBJECTS}
|
||||
COMMAND ${CMAKE_CXX_COMPILER} ${flags} -ipo1 -ipo-c -diag-disable 10015 -o ${TARGET_O} ${ALL_OBJECTS}
|
||||
WORKING_DIRECTORY ${TEMP_DIR}
|
||||
)
|
||||
SET(TARGET_OBJECTS ${TARGET_O} ${ALL_EXTRA_OBJECTS})
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
## set up lists of sources and headers for tags
|
||||
file(GLOB_RECURSE all_srcs
|
||||
include/*.c
|
||||
toku_include/*.c
|
||||
buildheader/*.c
|
||||
portability/*.c
|
||||
ft/*.c
|
||||
src/*.c
|
||||
utils/*.c
|
||||
db-benchmark-test/*.c
|
||||
include/*.cc
|
||||
toku_include/*.cc
|
||||
buildheader/*.cc
|
||||
portability/*.cc
|
||||
ft/*.cc
|
||||
src/*.cc
|
||||
utils/*.cc
|
||||
db-benchmark-test/*.cc
|
||||
)
|
||||
list(APPEND all_srcs
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ft/log_code.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ft/log_print.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ft/log_code.cc
|
||||
${CMAKE_CURRENT_BINARY_DIR}/ft/log_print.cc
|
||||
)
|
||||
file(GLOB_RECURSE all_hdrs
|
||||
include/*.h
|
||||
|
|
|
@ -21,7 +21,7 @@ MACRO(MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
|
|||
# To produce a library we need at least one source file.
|
||||
# It is created by ADD_CUSTOM_COMMAND below and will helps
|
||||
# also help to track dependencies.
|
||||
SET(SOURCE_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_depends.c)
|
||||
SET(SOURCE_FILE ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_depends.cc)
|
||||
ADD_LIBRARY(${TARGET} STATIC ${SOURCE_FILE})
|
||||
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME})
|
||||
|
||||
|
|
|
@ -101,9 +101,9 @@ endmacro(get_svn_wc_status)
|
|||
|
||||
## gather machine info
|
||||
uname("-m" machine_type)
|
||||
real_executable_name("${CMAKE_C_COMPILER}" real_c_compiler)
|
||||
get_svn_revision("${CMAKE_CURRENT_SOURCE_DIR}" svn_revision) ## unused since it confuses cdash about history
|
||||
get_svn_wc_status("${CMAKE_CURRENT_SOURCE_DIR}" wc_status) ## unused since it confuses cdash about history
|
||||
real_executable_name("${CMAKE_CXX_COMPILER}" real_cxx_compiler)
|
||||
#get_svn_revision("${CMAKE_CURRENT_SOURCE_DIR}" svn_revision) ## unused since it confuses cdash about history
|
||||
#get_svn_wc_status("${CMAKE_CURRENT_SOURCE_DIR}" wc_status) ## unused since it confuses cdash about history
|
||||
get_filename_component(branchname "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
|
||||
hostname(host)
|
||||
whoami(user)
|
||||
|
@ -111,7 +111,7 @@ whoami(user)
|
|||
## construct SITE, seems to have to happen before include(CTest)
|
||||
set(SITE "${user}@${host}")
|
||||
## construct BUILDNAME, seems to have to happen before include(CTest)
|
||||
set(BUILDNAME "${branchname} ${CMAKE_BUILD_TYPE} ${CMAKE_SYSTEM} ${machine_type} ${CMAKE_C_COMPILER_ID} ${real_c_compiler} ${CMAKE_C_COMPILER_VERSION}" CACHE STRING "CTest build name" FORCE)
|
||||
set(BUILDNAME "${branchname} ${CMAKE_BUILD_TYPE} ${CMAKE_SYSTEM} ${machine_type} ${CMAKE_CXX_COMPILER_ID} ${real_cxx_compiler} ${CMAKE_CXX_COMPILER_VERSION}" CACHE STRING "CTest build name" FORCE)
|
||||
|
||||
include(CTest)
|
||||
|
||||
|
@ -128,7 +128,7 @@ if (BUILD_TESTING)
|
|||
set(CMAKE_HELGRIND_COMMAND_STRING "valgrind --quiet --tool=helgrind --error-exitcode=1 --suppressions=${TokuDB_SOURCE_DIR}/src/tests/helgrind.suppressions --trace-children=yes --trace-children-skip=sh,*/sh,basename,*/basename,dirname,*/dirname,rm,*/rm,cp,*/cp,mv,*/mv,cat,*/cat,diff,*/diff,grep,*/grep,date,*/date,test,*/tokudb_dump* --trace-children-skip-by-arg=--only_create,--test,--no-shutdown,novalgrind")
|
||||
function(add_helgrind_test name)
|
||||
if (CMAKE_SYSTEM_NAME MATCHES Darwin OR
|
||||
((CMAKE_C_COMPILER_ID MATCHES Intel) AND
|
||||
((CMAKE_CXX_COMPILER_ID MATCHES Intel) AND
|
||||
(CMAKE_BUILD_TYPE MATCHES Release)) OR
|
||||
USE_GCOV)
|
||||
## can't use helgrind on osx or with optimized intel, no point in
|
||||
|
@ -150,7 +150,7 @@ if (BUILD_TESTING)
|
|||
set(CMAKE_DRD_COMMAND_STRING "valgrind --quiet --tool=drd --error-exitcode=1 --suppressions=${TokuDB_SOURCE_DIR}/src/tests/drd.suppressions --trace-children=yes --trace-children-skip=sh,*/sh,basename,*/basename,dirname,*/dirname,rm,*/rm,cp,*/cp,mv,*/mv,cat,*/cat,diff,*/diff,grep,*/grep,date,*/date,test,*/tokudb_dump* --trace-children-skip-by-arg=--only_create,--test,--no-shutdown,novalgrind")
|
||||
function(add_drd_test name)
|
||||
if (CMAKE_SYSTEM_NAME MATCHES Darwin OR
|
||||
((CMAKE_C_COMPILER_ID MATCHES Intel) AND
|
||||
((CMAKE_CXX_COMPILER_ID MATCHES Intel) AND
|
||||
(CMAKE_BUILD_TYPE MATCHES Release)) OR
|
||||
USE_GCOV)
|
||||
## can't use drd on osx or with optimized intel, no point in
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
## set c99 dialect
|
||||
add_definitions("-std=c99")
|
||||
|
||||
function(add_c_defines)
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${ARGN})
|
||||
endfunction(add_c_defines)
|
||||
|
||||
## os name detection (threadpool-test.c needs this)
|
||||
## os name detection (threadpool-test.cc needs this)
|
||||
if (CMAKE_SYSTEM_NAME MATCHES Darwin)
|
||||
add_c_defines(DARWIN=1 _DARWIN_C_SOURCE)
|
||||
elseif (CMAKE_SYSTEM_NAME MATCHES Linux)
|
||||
|
@ -18,9 +15,11 @@ add_c_defines(
|
|||
_XOPEN_SOURCE=600
|
||||
_FILE_OFFSET_BITS=64
|
||||
_LARGEFILE64_SOURCE
|
||||
__STDC_FORMAT_MACROS
|
||||
__STDC_LIMIT_MACROS
|
||||
)
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL Darwin OR CMAKE_C_COMPILER_ID MATCHES Clang)
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL Darwin OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
message(WARNING "Setting TOKU_ALLOW_DEPRECATED on Darwin and with clang. TODO: remove this.")
|
||||
add_c_defines(TOKU_ALLOW_DEPRECATED)
|
||||
endif ()
|
||||
|
@ -28,61 +27,90 @@ endif ()
|
|||
## coverage
|
||||
option(USE_GCOV "Use gcov for test coverage." OFF)
|
||||
if (USE_GCOV)
|
||||
if (NOT CMAKE_C_COMPILER_ID MATCHES GNU)
|
||||
if (NOT CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||
message(FATAL_ERROR "Must use the GNU compiler to compile for test coverage.")
|
||||
endif ()
|
||||
endif (USE_GCOV)
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
|
||||
## adds a compiler flag if the compiler supports it
|
||||
macro(set_cflags_if_supported)
|
||||
foreach(flag ${ARGN})
|
||||
check_c_compiler_flag(${flag} HAVE_${flag})
|
||||
if (HAVE_${flag})
|
||||
check_c_compiler_flag(${flag} HAVE_C_${flag})
|
||||
if (HAVE_C_${flag})
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
|
||||
endif ()
|
||||
check_cxx_compiler_flag(${flag} HAVE_CXX_${flag})
|
||||
if (HAVE_CXX_${flag})
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
|
||||
endif ()
|
||||
endforeach(flag)
|
||||
endmacro(set_cflags_if_supported)
|
||||
|
||||
## adds a linker flag if the compiler supports it
|
||||
macro(set_ldflags_if_supported)
|
||||
foreach(flag ${ARGN})
|
||||
check_cxx_compiler_flag(${flag} HAVE_${flag})
|
||||
if (HAVE_${flag})
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${flag}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${flag}")
|
||||
endif ()
|
||||
endforeach(flag)
|
||||
endmacro(set_ldflags_if_supported)
|
||||
|
||||
## disable some warnings
|
||||
set_cflags_if_supported(
|
||||
-Wno-self-assign
|
||||
-Wno-missing-field-initializers
|
||||
-Wno-maybe-uninitialized
|
||||
-Wno-error=strict-overflow
|
||||
)
|
||||
set_ldflags_if_supported(
|
||||
-Wno-error=strict-overflow
|
||||
)
|
||||
|
||||
## set extra debugging flags and preprocessor definitions
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g3 -ggdb -O1")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g3 -ggdb -O0")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -ggdb -O0")
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG FORTIFY_SOURCE=2)
|
||||
|
||||
## set extra release flags, we overwrite this because the default passes -DNDEBUG and we don't want that
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL Clang AND CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
||||
set(CMAKE_C_FLAGS_RELEASE "-g -O4")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-g -O4")
|
||||
else ()
|
||||
set(CMAKE_C_FLAGS_RELEASE "-g -O3")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-g -O3")
|
||||
|
||||
## check how to do inter-procedural optimization
|
||||
check_c_compiler_flag(-flto HAVE_CC_FLAG_FLTO)
|
||||
check_c_compiler_flag(-ipo HAVE_CC_FLAG_IPO)
|
||||
|
||||
## add inter-procedural optimization flags
|
||||
if (HAVE_CC_FLAG_FLTO)
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto")
|
||||
elseif (HAVE_CC_FLAG_IPO)
|
||||
check_c_compiler_flag(-flto HAVE_C_FLAG_FLTO)
|
||||
check_c_compiler_flag(-ipo HAVE_C_FLAG_IPO)
|
||||
if (HAVE_C_FLAG_FLTO)
|
||||
set(CMAKE_C_FLAGS_RELEASE "-O3 -flto")# -fuse-linker-plugin")
|
||||
elseif (HAVE_C_FLAG_IPO)
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ip -ipo1")
|
||||
endif ()
|
||||
check_cxx_compiler_flag(-flto HAVE_CXX_FLAG_FLTO)
|
||||
check_cxx_compiler_flag(-ipo HAVE_CXX_FLAG_IPO)
|
||||
if (HAVE_CXX_FLAG_FLTO)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -flto")# -fuse-linker-plugin")
|
||||
elseif (HAVE_CXX_FLAG_IPO)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ip -ipo1")
|
||||
endif ()
|
||||
endif ()
|
||||
## but we do want -DNVALGRIND
|
||||
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE NVALGRIND=1)
|
||||
|
||||
if (CMAKE_C_COMPILER_ID MATCHES Intel)
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES Intel)
|
||||
set(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
|
||||
## make sure intel libs are linked statically
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-intel")
|
||||
|
||||
## disable some intel-specific warnings
|
||||
set(intel_warnings
|
||||
94 # allow arrays of length 0
|
||||
411 # allow const struct members without a constructor
|
||||
589 # do not complain about goto that skips initialization
|
||||
1292 # icc lies (it says it is "__GNUC__", but it doesn't handle the resulting macroexpansions from glibc 2.15.37 (which is designed for gcc 4.7, and appears in Fedora 17)
|
||||
2259 # do not complain about "non-pointer conversion from int to u_int8_t (and other small types) may lose significant bits". this produces too many false positives
|
||||
|
@ -93,17 +121,21 @@ if (CMAKE_C_COMPILER_ID MATCHES Intel)
|
|||
)
|
||||
string(REGEX REPLACE ";" "," intel_warning_string "${intel_warnings}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -diag-disable ${intel_warning_string}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -diag-disable ${intel_warning_string}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -diag-disable ${intel_warning_string}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -diag-disable ${intel_warning_string}")
|
||||
|
||||
## icc does -g differently
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -debug all")
|
||||
|
||||
## set icc warnings
|
||||
set(CMAKE_C_FLAGS "-Wcheck ${CMAKE_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -debug all")
|
||||
set(CMAKE_CXX_FLAGS "-Wcheck ${CMAKE_CXX_FLAGS}")
|
||||
else()
|
||||
set(CMAKE_C_FLAGS "-std=c99 ${CMAKE_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
|
||||
## set gcc warnings
|
||||
set(CMAKE_C_FLAGS "-Wextra ${CMAKE_C_FLAGS}")
|
||||
## -Wc++-compat doesn't work with cmake's variable names so we do it individually here
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wc++-compat")
|
||||
set(CMAKE_CXX_FLAGS "-Wextra ${CMAKE_CXX_FLAGS}")
|
||||
set(WARN_CFLAGS
|
||||
-Wbad-function-cast
|
||||
-Wno-missing-noreturn
|
||||
|
@ -127,7 +159,7 @@ else()
|
|||
## -Wvector-optimization-performance
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL Darwin)
|
||||
message(WARNING "Disabling -Wcast-align and -Wshadow on osx. TODO: fix casting and shadowed declarations and re-enable them.")
|
||||
elseif (CMAKE_C_COMPILER_ID STREQUAL Clang)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
|
||||
message(WARNING "Disabling -Wcast-align with clang. TODO: fix casting and re-enable it.")
|
||||
list(APPEND WARN_CFLAGS -Wshadow)
|
||||
else ()
|
||||
|
@ -138,18 +170,19 @@ endif()
|
|||
set_cflags_if_supported(${WARN_CFLAGS})
|
||||
## always want these
|
||||
set(CMAKE_C_FLAGS "-Wall -Werror ${CMAKE_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "-Wall -Werror ${CMAKE_CXX_FLAGS}")
|
||||
|
||||
function(add_space_separated_property type obj propname val)
|
||||
get_property(oldval ${type} ${obj} PROPERTY ${propname})
|
||||
if (oldval MATCHES NOTFOUND)
|
||||
set_property(${type} ${obj} PROPERTY ${propname} "${val}")
|
||||
else ()
|
||||
set_property(${type} ${obj} PROPERTY ${propname} "${oldval} ${val}")
|
||||
set_property(${type} ${obj} PROPERTY ${propname} "${val} ${oldval}")
|
||||
endif ()
|
||||
endfunction(add_space_separated_property)
|
||||
|
||||
function(set_targets_need_intel_libs)
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL Intel)
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL Intel)
|
||||
foreach(tgt ${ARGN})
|
||||
target_link_libraries(${tgt} LINK_PUBLIC -Bstatic irc -Bdynamic c)
|
||||
endforeach(tgt)
|
||||
|
|
|
@ -10,6 +10,6 @@ if (INTEL_CC)
|
|||
CMAKE_CXX_COMPILER MATCHES CMAKE_CXX_COMPILER-NOTFOUND OR
|
||||
CMAKE_AR MATCHES CMAKE_AR-NOTFOUND OR
|
||||
CMAKE_LINKER MATCHES CMAKE_LINKER-NOTFOUND)
|
||||
message(FATAL_ERROR "Cannot find Intel compiler. You may need to run `. /opt/intel/bin/compilervars.sh intel64'")
|
||||
message(FATAL_ERROR "Cannot find Intel compiler. You may need to run `source /opt/intel/bin/compilervars.sh intel64'")
|
||||
endif ()
|
||||
endif (INTEL_CC)
|
|
@ -112,13 +112,11 @@ int DbEnv::maybe_throw_error(int err) throw (DbException) {
|
|||
return maybe_throw_error(err, this, do_no_exceptions);
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
void toku_ydb_error_all_cases(const DB_ENV * env,
|
||||
int error,
|
||||
BOOL include_stderrstring,
|
||||
BOOL use_stderr_if_nothing_else,
|
||||
const char *fmt, va_list ap);
|
||||
}
|
||||
extern "C" void toku_ydb_error_all_cases(const DB_ENV * env,
|
||||
int error,
|
||||
BOOL include_stderrstring,
|
||||
BOOL use_stderr_if_nothing_else,
|
||||
const char *fmt, va_list ap);
|
||||
|
||||
void DbEnv::err(int error, const char *fmt, ...) {
|
||||
va_list ap;
|
||||
|
|
|
@ -17,9 +17,9 @@ set(tokudbonly_bins
|
|||
|
||||
if(BDB_FOUND)
|
||||
foreach(bdb_bin ${both_bins})
|
||||
add_executable(${bdb_bin}-bdb ${bdb_bin}.c)
|
||||
add_executable(${bdb_bin}-bdb ${bdb_bin})
|
||||
set_property(TARGET ${bdb_bin}-bdb APPEND PROPERTY
|
||||
COMPILE_DEFINITIONS "DIRSUF=bdb;TOKU_ALLOW_DEPRECATED;ENVDIR=\"${bdb_bin}.c.bdb\"")
|
||||
COMPILE_DEFINITIONS "DIRSUF=bdb;TOKU_ALLOW_DEPRECATED;ENVDIR=\"${bdb_bin}.cc.bdb\"")
|
||||
set_target_properties(${bdb_bin}-bdb PROPERTIES
|
||||
INCLUDE_DIRECTORIES "${BDB_INCLUDE_DIR};${CMAKE_CURRENT_BINARY_DIR}/../toku_include;${CMAKE_CURRENT_SOURCE_DIR}/../toku_include;${CMAKE_CURRENT_SOURCE_DIR}/../portability;${CMAKE_CURRENT_SOURCE_DIR}/..")
|
||||
target_link_libraries(${bdb_bin}-bdb ${LIBTOKUPORTABILITY} ${BDB_LIBRARIES})
|
||||
|
@ -28,9 +28,9 @@ if(BDB_FOUND)
|
|||
endif()
|
||||
|
||||
foreach(tokudb_bin ${both_bins} ${tokudbonly_bins})
|
||||
add_executable(${tokudb_bin}-tokudb ${tokudb_bin}.c)
|
||||
add_executable(${tokudb_bin}-tokudb ${tokudb_bin})
|
||||
set_property(TARGET ${tokudb_bin}-tokudb APPEND PROPERTY
|
||||
COMPILE_DEFINITIONS "TOKUDB;ENVDIR=\"${tokudb_bin}.c.tdb\"")
|
||||
COMPILE_DEFINITIONS "TOKUDB;ENVDIR=\"${tokudb_bin}.cc.tdb\"")
|
||||
target_link_libraries(${tokudb_bin}-tokudb ${LIBTOKUDB} ${LIBTOKUPORTABILITY})
|
||||
add_common_options_to_binary_targets(${tokudb_bin}-tokudb)
|
||||
endforeach(tokudb_bin)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007, 2008 Tokutek Inc. All rights reserved."
|
||||
|
||||
/* Insert a bunch of stuff */
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdbool.h>
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
#include <config.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
#include <toku_portability.h>
|
||||
#include "tokudb_common_funcs.h"
|
||||
#include <toku_pthread.h>
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
/* Scan the bench.tokudb/bench.db over and over. */
|
||||
|
||||
#include <toku_portability.h>
|
||||
|
@ -107,7 +110,7 @@ struct extra_count {
|
|||
|
||||
static int
|
||||
counttotalbytes (DBT const *key, DBT const *data, void *extrav) {
|
||||
struct extra_count *e = cast_to_typeof(e) extrav;
|
||||
struct extra_count *CAST_FROM_VOIDP(e, extrav);
|
||||
e->totalbytes += key->size + data->size;
|
||||
e->rowcounter++;
|
||||
return 0;
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
/* Scan the bench.tokudb/bench.db over and over. */
|
||||
#define DONT_DEPRECATE_MALLOC
|
||||
|
||||
|
@ -170,8 +173,8 @@ static inline uint64_t mysql_get_bigint(unsigned char *d) {
|
|||
|
||||
static int mysql_key_compare(DB* file __attribute__((unused)),
|
||||
const DBT *adbt, const DBT *bdbt) {
|
||||
unsigned char *adata = cast_to_typeof(adata) adbt->data;
|
||||
unsigned char *bdata = cast_to_typeof(bdata) bdbt->data;
|
||||
unsigned char *CAST_FROM_VOIDP(adata, adbt->data);
|
||||
unsigned char *CAST_FROM_VOIDP(bdata, bdbt->data);
|
||||
uint64_t a, b;
|
||||
assert(adbt->size == 9 && bdbt->size == 9);
|
||||
assert(adata[0] == 0 && bdata[0] == 0);
|
||||
|
@ -286,7 +289,7 @@ struct extra_count {
|
|||
};
|
||||
|
||||
static int counttotalbytes (DBT const *key, DBT const *data, void *extrav) {
|
||||
struct extra_count *e = cast_to_typeof(e) extrav;
|
||||
struct extra_count *CAST_FROM_VOIDP(e, extrav);
|
||||
e->totalbytes += key->size + data->size;
|
||||
e->rowcounter++;
|
||||
if (do_mysql && 0) {
|
||||
|
@ -403,7 +406,7 @@ struct extra_verify {
|
|||
|
||||
static int
|
||||
checkbytes (DBT const *key, DBT const *data, void *extrav) {
|
||||
struct extra_verify *e = cast_to_typeof(e) extrav;
|
||||
struct extra_verify *CAST_FROM_VOIDP(e, extrav);
|
||||
e->totalbytes += key->size + data->size;
|
||||
e->rowcounter++;
|
||||
assert(e->k.size == key->size);
|
|
@ -1,5 +1,6 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#if !defined(TOKUDB_COMMON_FUNCS_H)
|
||||
#define TOKUDB_COMMON_FUNCS_H
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
// run txn begin commit on multiple threads and measure the throughput
|
||||
|
||||
#include "toku_portability.h"
|
|
@ -1,9 +1,9 @@
|
|||
install(
|
||||
FILES
|
||||
db-insert.c
|
||||
db-insert-multiple.c
|
||||
db-scan.c
|
||||
db-update.c
|
||||
db-insert.cc
|
||||
db-insert-multiple.cc
|
||||
db-scan.cc
|
||||
db-update.cc
|
||||
Makefile
|
||||
README.examples
|
||||
DESTINATION
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
// measure the performance of insertions into multiple dictionaries using ENV->put_multiple
|
||||
// the table schema is t(a bigint, b bigint, c bigint, d bigint, primary key(a), key(b), key(c,d), clustering key(d))
|
||||
// the primary key(a) is represented with key=a and value=b,c,d
|
|
@ -1,6 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
|
@ -1,6 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
|
||||
/* Scan the bench.tokudb/bench.db over and over. */
|
||||
#define DONT_DEPRECATE_MALLOC
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
// measure the performance of a simulated "insert on duplicate key update" operation
|
||||
// the table schema is t(a int, b int, c int, d int, primary key(a, b))
|
||||
// a and b are random
|
|
@ -1,83 +1,82 @@
|
|||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
## generate log_code.c, log_print.c, log_header.c
|
||||
## generate log_code.cc, log_print.cc, log_header.cc
|
||||
set_source_files_properties(
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/log_code.c"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/log_print.c"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/log_code"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/log_print"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
|
||||
PROPERTIES GENERATED TRUE)
|
||||
|
||||
add_executable(logformat logformat.c)
|
||||
add_executable(logformat logformat.cc)
|
||||
target_link_libraries(logformat ${LIBTOKUPORTABILITY})
|
||||
|
||||
add_custom_command(
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_code.c"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_print.c"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_code.cc"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_print.cc"
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
|
||||
COMMAND $<TARGET_FILE:logformat> .
|
||||
DEPENDS logformat
|
||||
)
|
||||
add_custom_target(
|
||||
generate_log_code
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/log_code.c" "${CMAKE_CURRENT_BINARY_DIR}/log_print.c" "${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
|
||||
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/log_code.cc" "${CMAKE_CURRENT_BINARY_DIR}/log_print.cc" "${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
|
||||
)
|
||||
|
||||
set(FT_SOURCES
|
||||
background_job_manager.c
|
||||
block_allocator.c
|
||||
block_table.c
|
||||
cachetable.c
|
||||
checkpoint.c
|
||||
compress.c
|
||||
dbufio.c
|
||||
fifo.c
|
||||
ft.c
|
||||
ft-cachetable-wrappers.c
|
||||
ft-flusher.c
|
||||
ft-hot-flusher.c
|
||||
ftloader.c
|
||||
ftloader-callback.c
|
||||
ft_msg.c
|
||||
ft_node-serialize.c
|
||||
ft-node-deserialize.c
|
||||
ft-ops.c
|
||||
ft-serialize.c
|
||||
ft-test-helpers.c
|
||||
ft-verify.c
|
||||
key.c
|
||||
kibbutz.c
|
||||
leafentry.c
|
||||
le-cursor.c
|
||||
logcursor.c
|
||||
logfilemgr.c
|
||||
logger.c
|
||||
log_upgrade.c
|
||||
memarena.c
|
||||
mempool.c
|
||||
minicron.c
|
||||
omt.c
|
||||
partitioned_counter.c
|
||||
pqueue.c
|
||||
queue.c
|
||||
quicklz.c
|
||||
recover.c
|
||||
rollback.c
|
||||
rollback-apply.c
|
||||
rollback-ct-callbacks.c
|
||||
roll.c
|
||||
sort.c
|
||||
sub_block.c
|
||||
threadpool.c
|
||||
txn.c
|
||||
txn_manager.c
|
||||
ule.c
|
||||
workqueue.c
|
||||
x1764.c
|
||||
xids.c
|
||||
ybt.c
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/log_code.c"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/log_header.h"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/log_print.c"
|
||||
background_job_manager
|
||||
block_allocator
|
||||
block_table
|
||||
cachetable
|
||||
checkpoint
|
||||
compress
|
||||
dbufio
|
||||
fifo
|
||||
ft
|
||||
ft-cachetable-wrappers
|
||||
ft-flusher
|
||||
ft-hot-flusher
|
||||
ftloader
|
||||
ftloader-callback
|
||||
ft_msg
|
||||
ft_node-serialize
|
||||
ft-node-deserialize
|
||||
ft-ops
|
||||
ft-serialize
|
||||
ft-test-helpers
|
||||
ft-verify
|
||||
key
|
||||
kibbutz
|
||||
leafentry
|
||||
le-cursor
|
||||
logcursor
|
||||
logfilemgr
|
||||
logger
|
||||
log_upgrade
|
||||
memarena
|
||||
mempool
|
||||
minicron
|
||||
omt
|
||||
partitioned_counter
|
||||
pqueue
|
||||
queue
|
||||
quicklz
|
||||
recover
|
||||
rollback
|
||||
rollback-apply
|
||||
rollback-ct-callbacks
|
||||
roll
|
||||
sort
|
||||
sub_block
|
||||
threadpool
|
||||
txn
|
||||
txn_manager
|
||||
ule
|
||||
workqueue
|
||||
x1764
|
||||
xids
|
||||
ybt
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/log_code"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/log_print"
|
||||
)
|
||||
|
||||
add_library(ft SHARED ${FT_SOURCES})
|
||||
|
@ -87,8 +86,8 @@ add_space_separated_property(TARGET ft_static COMPILE_FLAGS -fPIC)
|
|||
maybe_add_gcov_to_libraries(ft ft_static)
|
||||
|
||||
## depend on other generated targets
|
||||
add_dependencies(ft install_tdb_h build_lzma)
|
||||
add_dependencies(ft_static install_tdb_h build_lzma)
|
||||
add_dependencies(ft install_tdb_h generate_log_code build_lzma)
|
||||
add_dependencies(ft_static install_tdb_h generate_log_code build_lzma)
|
||||
|
||||
## link with lzma (which should be static) and link dependers with zlib
|
||||
target_link_libraries(ft LINK_PRIVATE lzma ${LIBTOKUPORTABILITY})
|
||||
|
@ -115,11 +114,11 @@ set(bins
|
|||
ftverify
|
||||
)
|
||||
foreach(bin ${bins})
|
||||
add_executable(${bin} ${bin}.c)
|
||||
add_executable(${bin} ${bin})
|
||||
add_dependencies(${bin} install_tdb_h)
|
||||
target_link_libraries(${bin} ft ${LIBTOKUPORTABILITY})
|
||||
|
||||
add_executable(${bin}_static ${bin}.c)
|
||||
add_executable(${bin}_static ${bin})
|
||||
add_dependencies(${bin}_static install_tdb_h)
|
||||
target_link_libraries(${bin}_static ft_static z lzma ${LIBTOKUPORTABILITY}_static ${CMAKE_THREAD_LIBS_INIT} dl)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2011 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
|
@ -1,9 +1,9 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef BACKGROUND_JOB_MANAGER_H
|
||||
#define BACKGROUND_JOB_MANAGER_H
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "Copyright (c) 2009-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
#ident "$Id$"
|
|
@ -1,17 +1,14 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef BLOCK_ALLOCATOR_H
|
||||
#define BLOCK_ALLOCATOR_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "fttypes.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define BLOCK_ALLOCATOR_ALIGNMENT 4096
|
||||
// How much must be reserved at the beginning for the block?
|
||||
|
@ -144,8 +141,5 @@ void block_allocator_merge_blockpairs_into (u_int64_t d, struct block_allo
|
|||
// No blocks may overlap.
|
||||
// Rationale: This is exposed so it can be tested by a glass box tester. Otherwise it would be static (file-scope) function inside block_allocator.c
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <toku_portability.h>
|
|
@ -1,16 +1,13 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef BLOCKTABLE_H
|
||||
#define BLOCKTABLE_H
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "fttypes.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct block_table *BLOCK_TABLE;
|
||||
|
||||
|
@ -85,9 +82,6 @@ enum {RESERVED_BLOCKNUM_NULL =0,
|
|||
RESERVED_BLOCKNUM_DESCRIPTOR =2,
|
||||
RESERVED_BLOCKNUMS};
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <toku_portability.h>
|
||||
|
@ -295,7 +295,7 @@ checkpoint_thread (void *cachetable_v)
|
|||
// If someone sets the checkpoint_shutdown boolean , then this thread exits.
|
||||
// This thread notices those changes by waiting on a condition variable.
|
||||
{
|
||||
CACHETABLE ct = (CACHETABLE) cachetable_v;
|
||||
CACHETABLE CAST_FROM_VOIDP(ct, cachetable_v);
|
||||
int r = toku_checkpoint(ct, ct->logger, NULL, NULL, NULL, NULL, SCHEDULED_CHECKPOINT);
|
||||
if (r) {
|
||||
fprintf(stderr, "%s:%d Got error %d while doing checkpoint\n", __FILE__, __LINE__, r);
|
||||
|
@ -2362,7 +2362,7 @@ struct pair_flush_for_close{
|
|||
};
|
||||
|
||||
static void cachetable_flush_pair_for_close(void* extra) {
|
||||
struct pair_flush_for_close *args = (struct pair_flush_for_close*) extra;
|
||||
struct pair_flush_for_close *CAST_FROM_VOIDP(args, extra);
|
||||
PAIR p = args->p;
|
||||
CACHEFILE cf = p->cachefile;
|
||||
CACHETABLE ct = cf->cachetable;
|
||||
|
@ -2665,10 +2665,11 @@ set_filenum_in_array(OMTVALUE hv, u_int32_t index, void*arrayv) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
log_open_txn (OMTVALUE txnv, u_int32_t UU(index), void *extra) {
|
||||
int
|
||||
log_open_txn (const TOKUTXN &txn, const uint32_t UU(index), CACHETABLE &ct);
|
||||
int
|
||||
log_open_txn (const TOKUTXN &txn, const uint32_t UU(index), CACHETABLE &ct) {
|
||||
int r;
|
||||
TOKUTXN txn = (TOKUTXN) txnv;
|
||||
TOKULOGGER logger = txn->logger;
|
||||
FILENUMS open_filenums;
|
||||
uint32_t num_filenums = toku_omt_size(txn->open_fts);
|
||||
|
@ -2677,7 +2678,6 @@ log_open_txn (OMTVALUE txnv, u_int32_t UU(index), void *extra) {
|
|||
goto cleanup;
|
||||
}
|
||||
else {
|
||||
CACHETABLE ct = (CACHETABLE) extra;
|
||||
ct->checkpoint_num_txns++;
|
||||
}
|
||||
|
||||
|
@ -2788,9 +2788,8 @@ toku_cachetable_begin_checkpoint (CACHETABLE ct, TOKULOGGER logger) {
|
|||
}
|
||||
// Log all the open transactions MUST BE AFTER OPEN FILES
|
||||
{
|
||||
int r = toku_txn_manager_iter_over_live_txns(
|
||||
int r = toku_txn_manager_iter_over_live_txns<CACHETABLE, log_open_txn>(
|
||||
logger->txn_manager,
|
||||
log_open_txn,
|
||||
ct
|
||||
);
|
||||
assert(r==0);
|
|
@ -1,19 +1,16 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef CACHETABLE_H
|
||||
#define CACHETABLE_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <fcntl.h>
|
||||
#include "fttypes.h"
|
||||
#include "workqueue.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Maintain a cache mapping from cachekeys to values (void*)
|
||||
// Some of the keys can be pinned. Don't pin too many or for too long.
|
||||
|
@ -511,8 +508,4 @@ int
|
|||
toku_cleaner_thread (void *cachetable_v);
|
||||
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "Copyright (c) 2009-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
#ident "$Id$"
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef TOKU_CHECKPOINT_H
|
||||
#define TOKU_CHECKPOINT_H
|
||||
|
||||
|
@ -7,9 +7,6 @@
|
|||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
#ident "$Id$"
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int toku_set_checkpoint_period(CACHETABLE ct, u_int32_t new_period);
|
||||
//Effect: Change [end checkpoint (n) - begin checkpoint (n+1)] delay to
|
||||
|
@ -118,8 +115,5 @@ typedef struct {
|
|||
|
||||
void toku_checkpoint_get_status(CACHETABLE ct, CHECKPOINT_STATUS stat);
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
#include <toku_assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "Copyright (c) 2011 Tokutek Inc. All rights reserved."
|
||||
#ident "$Id$"
|
||||
|
|
@ -1,9 +1,12 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#ifndef TOKU_COMPRESS_H
|
||||
#define TOKU_COMPRESS_H
|
||||
|
||||
#ident "$Id$"
|
||||
|
||||
#include <zlib.h>
|
||||
#include <db.h>
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
/* Measure the extent to which we can compress a file.
|
||||
* Works on version 8. */
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2010 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef TOKU_DBUFIO_H
|
||||
#define TOKU_DBUFIO_H
|
||||
#ident "$Id$"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "includes.h"
|
12
ft/fifo.h
12
ft/fifo.h
|
@ -1,18 +1,15 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef FIFO_H
|
||||
#define FIFO_H
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "fttypes.h"
|
||||
#include "xids-internal.h"
|
||||
#include "xids.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// If the fifo_entry is unpacked, the compiler aligns the xids array and we waste a lot of space
|
||||
#if TOKU_WINDOWS
|
||||
|
@ -101,8 +98,5 @@ BOOL toku_are_fifos_same(FIFO fifo1, FIFO fifo2);
|
|||
|
||||
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <ft-cachetable-wrappers.h>
|
|
@ -1,10 +1,10 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef FT_CACHETABLE_WRAPPERS_H
|
||||
#define FT_CACHETABLE_WRAPPERS_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <fttypes.h>
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef FT_FLUSHER_INTERNAL_H
|
||||
#define FT_FLUSHER_INTERNAL_H
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <fttypes.h>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <ft-internal.h>
|
||||
|
@ -547,11 +547,12 @@ handle_split_of_child(
|
|||
}
|
||||
|
||||
static int
|
||||
verify_in_mempool(OMTVALUE lev, u_int32_t UU(idx), void *vmp)
|
||||
verify_in_mempool(OMTVALUE lev, uint32_t UU(idx), void *mpv)
|
||||
{
|
||||
LEAFENTRY le = (LEAFENTRY) lev;
|
||||
struct mempool *mp = (struct mempool *) vmp;
|
||||
lazy_assert(toku_mempool_inrange(mp, le, leafentry_memsize(le)));
|
||||
LEAFENTRY CAST_FROM_VOIDP(le, lev);
|
||||
struct mempool *CAST_FROM_VOIDP(mp, mpv);
|
||||
int r = toku_mempool_inrange(mp, le, leafentry_memsize(le));
|
||||
lazy_assert(r);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -573,17 +574,14 @@ ftleaf_disk_size(FTNODE node)
|
|||
{
|
||||
assert(node->height == 0);
|
||||
toku_assert_entire_node_in_memory(node);
|
||||
u_int64_t retval = 0;
|
||||
int i;
|
||||
for (i = 0; i < node->n_children; i++) {
|
||||
uint64_t retval = 0;
|
||||
for (int i = 0; i < node->n_children; i++) {
|
||||
OMT curr_buffer = BLB_BUFFER(node, i);
|
||||
u_int32_t n_leafentries = toku_omt_size(curr_buffer);
|
||||
u_int32_t j;
|
||||
for (j=0; j < n_leafentries; j++) {
|
||||
const uint32_t n_leafentries = toku_omt_size(curr_buffer);
|
||||
for (uint32_t j=0; j < n_leafentries; j++) {
|
||||
OMTVALUE v;
|
||||
LEAFENTRY curr_le = NULL;
|
||||
int r = toku_omt_fetch(curr_buffer, j, &v);
|
||||
curr_le = (LEAFENTRY) v;
|
||||
LEAFENTRY CAST_FROM_VOIDP(curr_le, v);
|
||||
assert_zero(r);
|
||||
retval += leafentry_disksize(curr_le);
|
||||
}
|
||||
|
@ -604,17 +602,14 @@ ftleaf_get_split_loc(
|
|||
{
|
||||
assert(node->height == 0);
|
||||
u_int32_t size_so_far = 0;
|
||||
int i;
|
||||
for (i = 0; i < node->n_children; i++) {
|
||||
for (int i = 0; i < node->n_children; i++) {
|
||||
OMT curr_buffer = BLB_BUFFER(node, i);
|
||||
u_int32_t n_leafentries = toku_omt_size(curr_buffer);
|
||||
u_int32_t j;
|
||||
for (j=0; j < n_leafentries; j++) {
|
||||
LEAFENTRY curr_le = NULL;
|
||||
OMTVALUE v;
|
||||
int r = toku_omt_fetch(curr_buffer, j, &v);
|
||||
curr_le = (LEAFENTRY) v;
|
||||
uint32_t n_leafentries = toku_omt_size(curr_buffer);
|
||||
for (uint32_t j=0; j < n_leafentries; j++) {
|
||||
OMTVALUE lev;
|
||||
int r = toku_omt_fetch(curr_buffer, j, &lev);
|
||||
assert_zero(r);
|
||||
LEAFENTRY CAST_FROM_VOIDP(curr_le, lev);
|
||||
size_so_far += leafentry_disksize(curr_le);
|
||||
if (size_so_far >= sumlesizes/2) {
|
||||
*bn_index = i;
|
||||
|
@ -631,7 +626,7 @@ ftleaf_get_split_loc(
|
|||
} else {
|
||||
// we are trying to split a leaf with only one
|
||||
// leafentry in it
|
||||
assert(FALSE);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
goto exit;
|
||||
|
@ -642,24 +637,15 @@ exit:
|
|||
return;
|
||||
}
|
||||
|
||||
static LEAFENTRY
|
||||
fetch_from_buf(OMT omt, u_int32_t idx)
|
||||
{
|
||||
OMTVALUE v = 0;
|
||||
int r = toku_omt_fetch(omt, idx, &v);
|
||||
assert_zero(r);
|
||||
return (LEAFENTRY)v;
|
||||
}
|
||||
|
||||
// TODO: (Zardosht) possibly get rid of this function and use toku_omt_split_at in
|
||||
// ftleaf_split
|
||||
static void
|
||||
move_leafentries(
|
||||
BASEMENTNODE dest_bn,
|
||||
BASEMENTNODE src_bn,
|
||||
u_int32_t lbi, //lower bound inclusive
|
||||
u_int32_t ube, //upper bound exclusive
|
||||
u_int32_t* num_bytes_moved
|
||||
uint32_t lbi, //lower bound inclusive
|
||||
uint32_t ube, //upper bound exclusive
|
||||
uint32_t* num_bytes_moved
|
||||
)
|
||||
//Effect: move leafentries in the range [lbi, upe) from src_omt to newly created dest_omt
|
||||
{
|
||||
|
@ -671,29 +657,24 @@ move_leafentries(
|
|||
struct mempool *src_mp = &src_bn->buffer_mempool;
|
||||
toku_mempool_construct(dest_mp, mpsize);
|
||||
|
||||
u_int32_t i = 0;
|
||||
uint32_t i = 0;
|
||||
*num_bytes_moved = 0;
|
||||
for (i = lbi; i < ube; i++) {
|
||||
LEAFENTRY curr_le = NULL;
|
||||
curr_le = fetch_from_buf(src_bn->buffer, i);
|
||||
OMTVALUE lev;
|
||||
toku_omt_fetch(src_bn->buffer, i, &lev);
|
||||
LEAFENTRY CAST_FROM_VOIDP(curr_le, lev);
|
||||
size_t le_size = leafentry_memsize(curr_le);
|
||||
*num_bytes_moved += leafentry_disksize(curr_le);
|
||||
LEAFENTRY new_le = (LEAFENTRY) toku_mempool_malloc(dest_mp, le_size, 1);
|
||||
LEAFENTRY CAST_FROM_VOIDP(new_le, toku_mempool_malloc(dest_mp, le_size, 1));
|
||||
memcpy(new_le, curr_le, le_size);
|
||||
newleafpointers[i-lbi] = new_le;
|
||||
toku_mempool_mfree(src_mp, curr_le, le_size);
|
||||
}
|
||||
|
||||
int r = toku_omt_create_steal_sorted_array(
|
||||
&dest_bn->buffer,
|
||||
&newleafpointers,
|
||||
ube-lbi,
|
||||
ube-lbi
|
||||
);
|
||||
assert_zero(r);
|
||||
toku_omt_create_steal_sorted_array(&dest_bn->buffer, &newleafpointers, ube-lbi, ube-lbi);
|
||||
// now remove the elements from src_omt
|
||||
for (i=ube-1; i >= lbi; i--) {
|
||||
toku_omt_delete_at(src_bn->buffer,i);
|
||||
toku_omt_delete_at(src_bn->buffer, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -786,7 +767,7 @@ ftleaf_split(
|
|||
);
|
||||
}
|
||||
// did we split right on the boundary between basement nodes?
|
||||
BOOL split_on_boundary = (last_le_on_left_within_bn == ((int) toku_omt_size(BLB_BUFFER(node, last_bn_on_left)) - 1));
|
||||
const bool split_on_boundary = (last_le_on_left_within_bn == (int) toku_omt_size(BLB_BUFFER(node, last_bn_on_left)) - 1);
|
||||
// Now we know where we are going to break it
|
||||
// the two nodes will have a total of n_children+1 basement nodes
|
||||
// and n_children-1 pivots
|
||||
|
@ -884,10 +865,11 @@ ftleaf_split(
|
|||
}
|
||||
if (splitk) {
|
||||
memset(splitk, 0, sizeof *splitk);
|
||||
OMTVALUE lev = 0;
|
||||
int r=toku_omt_fetch(BLB_BUFFER(node, last_bn_on_left), toku_omt_size(BLB_BUFFER(node, last_bn_on_left))-1, &lev);
|
||||
OMTVALUE lev;
|
||||
OMT buffer = BLB_BUFFER(node, last_bn_on_left);
|
||||
int r = toku_omt_fetch(buffer, toku_omt_size(buffer) - 1, &lev);
|
||||
assert_zero(r); // that fetch should have worked.
|
||||
LEAFENTRY le = (LEAFENTRY) lev;
|
||||
LEAFENTRY CAST_FROM_VOIDP(le, lev);
|
||||
uint32_t keylen;
|
||||
void *key = le_key_and_len(le, &keylen);
|
||||
toku_fill_dbt(splitk, toku_xmemdup(key, keylen), keylen);
|
||||
|
@ -1097,10 +1079,11 @@ merge_leaf_nodes(FTNODE a, FTNODE b)
|
|||
a->dirty = 1;
|
||||
b->dirty = 1;
|
||||
|
||||
OMT a_last_buffer = BLB_BUFFER(a, a->n_children-1);
|
||||
// this BOOL states if the last basement node in a has any items or not
|
||||
// If it does, then it stays in the merge. If it does not, the last basement node
|
||||
// of a gets eliminated because we do not have a pivot to store for it (because it has no elements)
|
||||
BOOL a_has_tail = toku_omt_size(BLB_BUFFER(a, a->n_children-1));
|
||||
const bool a_has_tail = toku_omt_size(a_last_buffer) > 0;
|
||||
|
||||
// move each basement node from b to a
|
||||
// move the pivots, adding one of what used to be max(a)
|
||||
|
@ -1127,10 +1110,9 @@ merge_leaf_nodes(FTNODE a, FTNODE b)
|
|||
|
||||
// fill in pivot for what used to be max of node 'a', if it is needed
|
||||
if (a_has_tail) {
|
||||
LEAFENTRY le = fetch_from_buf(
|
||||
BLB_BUFFER(a, a->n_children-1),
|
||||
toku_omt_size(BLB_BUFFER(a, a->n_children-1))-1
|
||||
);
|
||||
OMTVALUE lev;
|
||||
toku_omt_fetch(a_last_buffer, toku_omt_size(a_last_buffer) - 1, &lev);
|
||||
LEAFENTRY CAST_FROM_VOIDP(le, lev);
|
||||
uint32_t keylen;
|
||||
void *key = le_key_and_len(le, &keylen);
|
||||
toku_fill_dbt(&a->childkeys[a->n_children-1], toku_xmemdup(key, keylen), keylen);
|
|
@ -1,9 +1,9 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef FT_FLUSHER_H
|
||||
#define FT_FLUSHER_H
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
// This must be first to make the 64-bit file mode work right in Linux
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <ft-flusher.h>
|
|
@ -1,10 +1,10 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef FT_INTERNAL_H
|
||||
#define FT_INTERNAL_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <config.h>
|
||||
|
@ -29,6 +29,7 @@
|
|||
#include "block_table.h"
|
||||
#include "mempool.h"
|
||||
#include "compress.h"
|
||||
#include "omt-tmpl.h"
|
||||
|
||||
// Uncomment the following to use quicklz
|
||||
|
||||
|
@ -103,7 +104,7 @@ struct toku_fifo_entry_key_msn_heaviside_extra {
|
|||
// comparison function for inserting messages into a
|
||||
// ftnode_nonleaf_childinfo's message_tree
|
||||
int
|
||||
toku_fifo_entry_key_msn_heaviside(OMTVALUE v, void *extrap);
|
||||
toku_fifo_entry_key_msn_heaviside(const long &v, const struct toku_fifo_entry_key_msn_heaviside_extra &extra);
|
||||
|
||||
struct toku_fifo_entry_key_msn_cmp_extra {
|
||||
DESCRIPTOR desc;
|
||||
|
@ -113,14 +114,16 @@ struct toku_fifo_entry_key_msn_cmp_extra {
|
|||
|
||||
// same thing for qsort_r
|
||||
int
|
||||
toku_fifo_entry_key_msn_cmp(void *extrap, const void *ap, const void *bp);
|
||||
toku_fifo_entry_key_msn_cmp(const struct toku_fifo_entry_key_msn_cmp_extra &extrap, const long &a, const long &b);
|
||||
|
||||
typedef toku::omt<long> off_omt_t;
|
||||
|
||||
// data of an available partition of a nonleaf ftnode
|
||||
struct ftnode_nonleaf_childinfo {
|
||||
FIFO buffer;
|
||||
OMT broadcast_list;
|
||||
OMT fresh_message_tree;
|
||||
OMT stale_message_tree;
|
||||
off_omt_t broadcast_list;
|
||||
off_omt_t fresh_message_tree;
|
||||
off_omt_t stale_message_tree;
|
||||
};
|
||||
|
||||
unsigned int toku_bnc_nbytesinbuf(NONLEAF_CHILDINFO bnc);
|
||||
|
@ -141,6 +144,7 @@ toku_ft_nonleaf_is_gorged(FTNODE node);
|
|||
enum reactivity get_nonleaf_reactivity (FTNODE node);
|
||||
enum reactivity get_node_reactivity (FTNODE node);
|
||||
|
||||
|
||||
// data of an available partition of a leaf ftnode
|
||||
struct ftnode_leaf_basement_node {
|
||||
OMT buffer; // pointers to individual leaf entries
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4 -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id: ft-node-serialize.c 43686 2012-05-18 23:21:00Z leifwalsh $"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <ft-internal.h>
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
/*
|
||||
|
@ -122,10 +122,11 @@ basement nodes, bulk fetch, and partial fetch:
|
|||
#include "ule.h"
|
||||
#include "xids.h"
|
||||
#include "sub_block.h"
|
||||
#include "sort.h"
|
||||
#include "sort-tmpl.h"
|
||||
#include <ft-cachetable-wrappers.h>
|
||||
#include <ft-flusher.h>
|
||||
#include <valgrind/helgrind.h>
|
||||
#include "txn_manager.h"
|
||||
|
||||
#if defined(HAVE_CILK)
|
||||
#include <cilk/cilk.h>
|
||||
|
@ -368,9 +369,9 @@ toku_bnc_memory_size(NONLEAF_CHILDINFO bnc)
|
|||
{
|
||||
return (sizeof(*bnc) +
|
||||
toku_fifo_memory_footprint(bnc->buffer) +
|
||||
toku_omt_memory_size(bnc->fresh_message_tree) +
|
||||
toku_omt_memory_size(bnc->stale_message_tree) +
|
||||
toku_omt_memory_size(bnc->broadcast_list));
|
||||
bnc->fresh_message_tree.memory_size() +
|
||||
bnc->stale_message_tree.memory_size() +
|
||||
bnc->broadcast_list.memory_size());
|
||||
}
|
||||
|
||||
// how much memory in this child buffer holds useful data?
|
||||
|
@ -380,9 +381,9 @@ toku_bnc_memory_used(NONLEAF_CHILDINFO bnc)
|
|||
{
|
||||
return (sizeof(*bnc) +
|
||||
toku_fifo_memory_size_in_use(bnc->buffer) +
|
||||
toku_omt_memory_size(bnc->fresh_message_tree) +
|
||||
toku_omt_memory_size(bnc->stale_message_tree) +
|
||||
toku_omt_memory_size(bnc->broadcast_list));
|
||||
bnc->fresh_message_tree.memory_size() +
|
||||
bnc->stale_message_tree.memory_size() +
|
||||
bnc->broadcast_list.memory_size());
|
||||
}
|
||||
|
||||
static long
|
||||
|
@ -1156,8 +1157,8 @@ leafval_heaviside_le (u_int32_t klen, void *kval,
|
|||
//TODO: #1125 optimize
|
||||
int
|
||||
toku_cmd_leafval_heaviside (OMTVALUE lev, void *extra) {
|
||||
LEAFENTRY le = cast_to_typeof(le) lev;
|
||||
struct cmd_leafval_heaviside_extra *be = cast_to_typeof(be) extra;
|
||||
LEAFENTRY CAST_FROM_VOIDP(le, lev);
|
||||
struct cmd_leafval_heaviside_extra *CAST_FROM_VOIDP(be, extra);
|
||||
u_int32_t keylen;
|
||||
void* key = le_key_and_len(le, &keylen);
|
||||
return leafval_heaviside_le(keylen, key,
|
||||
|
@ -1482,7 +1483,7 @@ struct setval_extra_s {
|
|||
* from setval_extra_s input arg to brt->update_fun().
|
||||
*/
|
||||
static void setval_fun (const DBT *new_val, void *svextra_v) {
|
||||
struct setval_extra_s *svextra = cast_to_typeof(svextra) svextra_v;
|
||||
struct setval_extra_s *CAST_FROM_VOIDP(svextra, svextra_v);
|
||||
assert(svextra->tag==setval_tag);
|
||||
assert(!svextra->did_set_val);
|
||||
svextra->did_set_val = TRUE;
|
||||
|
@ -1606,7 +1607,7 @@ toku_ft_bn_apply_cmd (
|
|||
idx = toku_omt_size(bn->buffer);
|
||||
r = toku_omt_fetch(bn->buffer, idx-1, &storeddatav);
|
||||
if (r != 0) goto fz;
|
||||
storeddata = cast_to_typeof(storeddata) storeddatav;
|
||||
CAST_FROM_VOIDP(storeddata, storeddatav);
|
||||
int cmp = toku_cmd_leafval_heaviside(storeddata, &be);
|
||||
if (cmp >= 0) goto fz;
|
||||
r = DB_NOTFOUND;
|
||||
|
@ -1619,7 +1620,7 @@ toku_ft_bn_apply_cmd (
|
|||
storeddata = 0;
|
||||
} else {
|
||||
assert(r==0);
|
||||
storeddata = cast_to_typeof(storeddata) storeddatav;
|
||||
CAST_FROM_VOIDP(storeddata, storeddatav);
|
||||
}
|
||||
toku_ft_bn_apply_cmd_once(bn, cmd, idx, storeddata, workdone, stats_to_update);
|
||||
|
||||
|
@ -1648,7 +1649,7 @@ toku_ft_bn_apply_cmd (
|
|||
&storeddatav, &idx);
|
||||
if (r == DB_NOTFOUND) break;
|
||||
assert(r==0);
|
||||
storeddata = cast_to_typeof(storeddata) storeddatav;
|
||||
CAST_FROM_VOIDP(storeddata, storeddatav);
|
||||
|
||||
while (1) {
|
||||
u_int32_t num_leafentries_before = toku_omt_size(bn->buffer);
|
||||
|
@ -1672,7 +1673,7 @@ toku_ft_bn_apply_cmd (
|
|||
r = toku_omt_fetch(bn->buffer, idx, &storeddatav);
|
||||
assert_zero(r);
|
||||
}
|
||||
storeddata = cast_to_typeof(storeddata) storeddatav;
|
||||
CAST_FROM_VOIDP(storeddata, storeddatav);
|
||||
{ // Continue only if the next record that we found has the same key.
|
||||
DBT adbt;
|
||||
u_int32_t keylen;
|
||||
|
@ -1696,7 +1697,7 @@ toku_ft_bn_apply_cmd (
|
|||
for (u_int32_t idx = 0; idx < omt_size; ) {
|
||||
r = toku_omt_fetch(bn->buffer, idx, &storeddatav);
|
||||
assert_zero(r);
|
||||
storeddata = cast_to_typeof(storeddata) storeddatav;
|
||||
CAST_FROM_VOIDP(storeddata, storeddatav);
|
||||
int deleted = 0;
|
||||
if (!le_is_clean(storeddata)) { //If already clean, nothing to do.
|
||||
toku_ft_bn_apply_cmd_once(bn, cmd, idx, storeddata, workdone, stats_to_update);
|
||||
|
@ -1722,7 +1723,7 @@ toku_ft_bn_apply_cmd (
|
|||
for (u_int32_t idx = 0; idx < omt_size; ) {
|
||||
r = toku_omt_fetch(bn->buffer, idx, &storeddatav);
|
||||
assert_zero(r);
|
||||
storeddata = cast_to_typeof(storeddata) storeddatav;
|
||||
CAST_FROM_VOIDP(storeddata, storeddatav);
|
||||
int deleted = 0;
|
||||
if (le_has_xids(storeddata, cmd->xids)) {
|
||||
toku_ft_bn_apply_cmd_once(bn, cmd, idx, storeddata, workdone, stats_to_update);
|
||||
|
@ -1748,7 +1749,7 @@ toku_ft_bn_apply_cmd (
|
|||
if (r==DB_NOTFOUND) {
|
||||
r = do_update(update_fun, desc, bn, cmd, idx, NULL, workdone, stats_to_update);
|
||||
} else if (r==0) {
|
||||
storeddata = cast_to_typeof(storeddata) storeddatav;
|
||||
CAST_FROM_VOIDP(storeddata, storeddatav);
|
||||
r = do_update(update_fun, desc, bn, cmd, idx, storeddata, workdone, stats_to_update);
|
||||
} // otherwise, a worse error, just return it
|
||||
break;
|
||||
|
@ -1760,7 +1761,7 @@ toku_ft_bn_apply_cmd (
|
|||
while (idx < (num_leafentries_before = toku_omt_size(bn->buffer))) {
|
||||
r = toku_omt_fetch(bn->buffer, idx, &storeddatav);
|
||||
assert(r==0);
|
||||
storeddata = cast_to_typeof(storeddata) storeddatav;
|
||||
CAST_FROM_VOIDP(storeddata, storeddatav);
|
||||
r = do_update(update_fun, desc, bn, cmd, idx, storeddata, workdone, stats_to_update);
|
||||
// TODO(leif): This early return means get_leaf_reactivity()
|
||||
// and VERIFY_NODE() never get called. Is this a problem?
|
||||
|
@ -1798,31 +1799,26 @@ key_msn_cmp(const DBT *a, const DBT *b, const MSN amsn, const MSN bmsn,
|
|||
}
|
||||
|
||||
int
|
||||
toku_fifo_entry_key_msn_heaviside(OMTVALUE v, void *extrap)
|
||||
toku_fifo_entry_key_msn_heaviside(const long &offset, const struct toku_fifo_entry_key_msn_heaviside_extra &extra)
|
||||
{
|
||||
const struct toku_fifo_entry_key_msn_heaviside_extra *extra = cast_to_typeof(extra) extrap;
|
||||
const long offset = (long) v;
|
||||
const struct fifo_entry *query = toku_fifo_get_entry(extra->fifo, offset);
|
||||
const struct fifo_entry *query = toku_fifo_get_entry(extra.fifo, offset);
|
||||
DBT qdbt;
|
||||
const DBT *query_key = fill_dbt_for_fifo_entry(&qdbt, query);
|
||||
const DBT *target_key = extra->key;
|
||||
return key_msn_cmp(query_key, target_key, query->msn, extra->msn,
|
||||
extra->desc, extra->cmp);
|
||||
const DBT *target_key = extra.key;
|
||||
return key_msn_cmp(query_key, target_key, query->msn, extra.msn,
|
||||
extra.desc, extra.cmp);
|
||||
}
|
||||
|
||||
int
|
||||
toku_fifo_entry_key_msn_cmp(void *extrap, const void *ap, const void *bp)
|
||||
toku_fifo_entry_key_msn_cmp(const struct toku_fifo_entry_key_msn_cmp_extra &extra, const long &ao, const long &bo)
|
||||
{
|
||||
const struct toku_fifo_entry_key_msn_cmp_extra *extra = cast_to_typeof(extra) extrap;
|
||||
const long ao = *(long *) ap;
|
||||
const long bo = *(long *) bp;
|
||||
const struct fifo_entry *a = toku_fifo_get_entry(extra->fifo, ao);
|
||||
const struct fifo_entry *b = toku_fifo_get_entry(extra->fifo, bo);
|
||||
const struct fifo_entry *a = toku_fifo_get_entry(extra.fifo, ao);
|
||||
const struct fifo_entry *b = toku_fifo_get_entry(extra.fifo, bo);
|
||||
DBT adbt, bdbt;
|
||||
const DBT *akey = fill_dbt_for_fifo_entry(&adbt, a);
|
||||
const DBT *bkey = fill_dbt_for_fifo_entry(&bdbt, b);
|
||||
return key_msn_cmp(akey, bkey, a->msn, b->msn,
|
||||
extra->desc, extra->cmp);
|
||||
extra.desc, extra.cmp);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -1840,18 +1836,18 @@ toku_bnc_insert_msg(NONLEAF_CHILDINFO bnc, const void *key, ITEMLEN keylen, cons
|
|||
DBT keydbt;
|
||||
struct toku_fifo_entry_key_msn_heaviside_extra extra = { .desc = desc, .cmp = cmp, .fifo = bnc->buffer, .key = toku_fill_dbt(&keydbt, key, keylen), .msn = msn };
|
||||
if (is_fresh) {
|
||||
r = toku_omt_insert(bnc->fresh_message_tree, (OMTVALUE) offset, toku_fifo_entry_key_msn_heaviside, &extra, NULL);
|
||||
r = bnc->fresh_message_tree.insert<struct toku_fifo_entry_key_msn_heaviside_extra, toku_fifo_entry_key_msn_heaviside>(offset, extra, nullptr);
|
||||
assert_zero(r);
|
||||
} else {
|
||||
r = toku_omt_insert(bnc->stale_message_tree, (OMTVALUE) offset, toku_fifo_entry_key_msn_heaviside, &extra, NULL);
|
||||
r = bnc->stale_message_tree.insert<struct toku_fifo_entry_key_msn_heaviside_extra, toku_fifo_entry_key_msn_heaviside>(offset, extra, nullptr);
|
||||
assert_zero(r);
|
||||
}
|
||||
} else if (ft_msg_type_applies_all(type) || ft_msg_type_does_nothing(type)) {
|
||||
u_int32_t idx = toku_omt_size(bnc->broadcast_list);
|
||||
r = toku_omt_insert_at(bnc->broadcast_list, (OMTVALUE) offset, idx);
|
||||
const uint32_t idx = bnc->broadcast_list.size();
|
||||
r = bnc->broadcast_list.insert_at(offset, idx);
|
||||
assert_zero(r);
|
||||
} else {
|
||||
assert(FALSE);
|
||||
abort();
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
@ -2096,9 +2092,9 @@ static void
|
|||
ft_basement_node_gc_once(BASEMENTNODE bn,
|
||||
u_int32_t index,
|
||||
LEAFENTRY leaf_entry,
|
||||
OMT snapshot_xids,
|
||||
OMT referenced_xids,
|
||||
OMT live_root_txns,
|
||||
const xid_omt_t &snapshot_xids,
|
||||
const rx_omt_t &referenced_xids,
|
||||
const xid_omt_t &live_root_txns,
|
||||
STAT64INFO_S * delta)
|
||||
{
|
||||
assert(leaf_entry);
|
||||
|
@ -2174,9 +2170,9 @@ exit:
|
|||
// Garbage collect all leaf entries for a given basement node.
|
||||
static void
|
||||
basement_node_gc_all_les(BASEMENTNODE bn,
|
||||
OMT snapshot_xids,
|
||||
OMT referenced_xids,
|
||||
OMT live_root_txns,
|
||||
const xid_omt_t &snapshot_xids,
|
||||
const rx_omt_t &referenced_xids,
|
||||
const xid_omt_t &live_root_txns,
|
||||
STAT64INFO_S * delta)
|
||||
{
|
||||
int r = 0;
|
||||
|
@ -2187,7 +2183,7 @@ basement_node_gc_all_les(BASEMENTNODE bn,
|
|||
LEAFENTRY leaf_entry;
|
||||
r = toku_omt_fetch(bn->buffer, index, &storedatav);
|
||||
assert(r == 0);
|
||||
leaf_entry = cast_to_typeof(leaf_entry) storedatav;
|
||||
CAST_FROM_VOIDP(leaf_entry, storedatav);
|
||||
ft_basement_node_gc_once(bn, index, leaf_entry, snapshot_xids, referenced_xids, live_root_txns, delta);
|
||||
// Check if the leaf entry was deleted or not.
|
||||
if (num_leafentries_before == toku_omt_size(bn->buffer)) {
|
||||
|
@ -2200,9 +2196,9 @@ basement_node_gc_all_les(BASEMENTNODE bn,
|
|||
static void
|
||||
ft_leaf_gc_all_les(FTNODE node,
|
||||
FT h,
|
||||
OMT snapshot_xids,
|
||||
OMT referenced_xids,
|
||||
OMT live_root_txns)
|
||||
const xid_omt_t &snapshot_xids,
|
||||
const rx_omt_t &referenced_xids,
|
||||
const xid_omt_t &live_root_txns)
|
||||
{
|
||||
toku_assert_entire_node_in_memory(node);
|
||||
assert(node->height == 0);
|
||||
|
@ -2250,14 +2246,14 @@ toku_bnc_flush_to_child(
|
|||
// Run garbage collection, if we are a leaf entry.
|
||||
TOKULOGGER logger = toku_cachefile_logger(h->cf);
|
||||
if (child->height == 0 && logger) {
|
||||
OMT snapshot_txnids = NULL;
|
||||
OMT referenced_xids = NULL;
|
||||
OMT live_root_txns = NULL;
|
||||
xid_omt_t snapshot_txnids;
|
||||
rx_omt_t referenced_xids;
|
||||
xid_omt_t live_root_txns;
|
||||
toku_txn_manager_clone_state_for_gc(
|
||||
logger->txn_manager,
|
||||
&snapshot_txnids,
|
||||
&referenced_xids,
|
||||
&live_root_txns
|
||||
snapshot_txnids,
|
||||
referenced_xids,
|
||||
live_root_txns
|
||||
);
|
||||
size_t buffsize = toku_fifo_buffer_size_in_use(bnc->buffer);
|
||||
STATUS_VALUE(FT_MSG_BYTES_OUT) += buffsize;
|
||||
|
@ -2267,10 +2263,9 @@ toku_bnc_flush_to_child(
|
|||
ft_leaf_gc_all_les(child, h, snapshot_txnids, referenced_xids, live_root_txns);
|
||||
|
||||
// Free the OMT's we used for garbage collecting.
|
||||
toku_omt_destroy(&snapshot_txnids);
|
||||
toku_omt_destroy(&live_root_txns);
|
||||
toku_omt_free_items_pool(referenced_xids);
|
||||
toku_omt_destroy(&referenced_xids);
|
||||
snapshot_txnids.deinit();
|
||||
live_root_txns.deinit();
|
||||
referenced_xids.deinit();
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -2935,11 +2930,11 @@ struct omt_compressor_state {
|
|||
};
|
||||
|
||||
static int move_it (OMTVALUE lev, u_int32_t idx, void *v) {
|
||||
LEAFENTRY le = cast_to_typeof(le) lev;
|
||||
struct omt_compressor_state *oc = cast_to_typeof(oc) v;
|
||||
LEAFENTRY CAST_FROM_VOIDP(le, lev);
|
||||
struct omt_compressor_state *CAST_FROM_VOIDP(oc, v);
|
||||
u_int32_t size = leafentry_memsize(le);
|
||||
LEAFENTRY newdata = cast_to_typeof(newdata) toku_mempool_malloc(oc->new_kvspace, size, 1);
|
||||
lazy_assert(newdata); // we do this on a fresh mempool, so nothing bad shouldhapepn
|
||||
LEAFENTRY CAST_FROM_VOIDP(newdata, toku_mempool_malloc(oc->new_kvspace, size, 1));
|
||||
lazy_assert(newdata); // we do this on a fresh mempool, so nothing bad should happen
|
||||
memcpy(newdata, le, size);
|
||||
toku_omt_set_at(oc->omt, newdata, idx);
|
||||
return 0;
|
||||
|
@ -3472,7 +3467,7 @@ ft_compare_func toku_ft_get_bt_compare (FT_HANDLE brt) {
|
|||
|
||||
static void
|
||||
ft_remove_handle_ref_callback(FT UU(ft), void *extra) {
|
||||
FT_HANDLE handle = cast_to_typeof(handle) extra;
|
||||
FT_HANDLE CAST_FROM_VOIDP(handle, extra);
|
||||
toku_list_remove(&handle->live_ft_handle_link);
|
||||
}
|
||||
|
||||
|
@ -3553,7 +3548,7 @@ does_txn_read_entry(TXNID id, TOKUTXN context) {
|
|||
if (id < oldest_live_in_snapshot || id == context->ancestor_txnid64) {
|
||||
rval = TOKUDB_ACCEPT;
|
||||
}
|
||||
else if (id > context->snapshot_txnid64 || toku_is_txn_in_live_root_txn_list(context->live_root_txn_list, id)) {
|
||||
else if (id > context->snapshot_txnid64 || toku_is_txn_in_live_root_txn_list(*context->live_root_txn_list, id)) {
|
||||
rval = 0;
|
||||
}
|
||||
else {
|
||||
|
@ -3604,7 +3599,7 @@ int toku_ft_cursor (
|
|||
return TOKUDB_MVCC_DICTIONARY_TOO_NEW;
|
||||
}
|
||||
}
|
||||
FT_CURSOR cursor = cast_to_typeof(cursor) toku_malloc(sizeof *cursor);
|
||||
FT_CURSOR MALLOC(cursor);
|
||||
// if this cursor is to do read_committed fetches, then the txn objects must be valid.
|
||||
if (cursor == 0)
|
||||
return ENOMEM;
|
||||
|
@ -3712,8 +3707,8 @@ pair_leafval_heaviside_le (u_int32_t klen, void *kval,
|
|||
|
||||
static int
|
||||
heaviside_from_search_t (OMTVALUE lev, void *extra) {
|
||||
LEAFENTRY le = cast_to_typeof(le) lev;
|
||||
ft_search_t *search = cast_to_typeof(search) extra;
|
||||
LEAFENTRY CAST_FROM_VOIDP(le, lev);
|
||||
ft_search_t *CAST_FROM_VOIDP(search, extra);
|
||||
u_int32_t keylen;
|
||||
void* key = le_key_and_len(le, &keylen);
|
||||
|
||||
|
@ -3779,17 +3774,17 @@ struct copy_to_stale_extra {
|
|||
NONLEAF_CHILDINFO bnc;
|
||||
};
|
||||
|
||||
static int
|
||||
copy_to_stale(OMTVALUE v, u_int32_t UU(idx), void *extrap)
|
||||
// template-only function, but must be extern
|
||||
int copy_to_stale(const long &offset, const uint32_t UU(idx), struct copy_to_stale_extra &extra);
|
||||
int
|
||||
copy_to_stale(const long &offset, const uint32_t UU(idx), struct copy_to_stale_extra &extra)
|
||||
{
|
||||
struct copy_to_stale_extra *extra = cast_to_typeof(extra) extrap;
|
||||
const long offset = (long) v;
|
||||
struct fifo_entry *entry = (struct fifo_entry *) toku_fifo_get_entry(extra->bnc->buffer, offset);
|
||||
struct fifo_entry *entry = (struct fifo_entry *) toku_fifo_get_entry(extra.bnc->buffer, offset);
|
||||
entry->is_fresh = false;
|
||||
DBT keydbt;
|
||||
DBT *key = fill_dbt_for_fifo_entry(&keydbt, entry);
|
||||
struct toku_fifo_entry_key_msn_heaviside_extra heaviside_extra = { .desc = &extra->ft_handle->ft->cmp_descriptor, .cmp = extra->ft_handle->ft->compare_fun, .fifo = extra->bnc->buffer, .key = key, .msn = entry->msn };
|
||||
int r = toku_omt_insert(extra->bnc->stale_message_tree, (OMTVALUE) offset, toku_fifo_entry_key_msn_heaviside, &heaviside_extra, NULL);
|
||||
struct toku_fifo_entry_key_msn_heaviside_extra heaviside_extra = { .desc = &extra.ft_handle->ft->cmp_descriptor, .cmp = extra.ft_handle->ft->compare_fun, .fifo = extra.bnc->buffer, .key = key, .msn = entry->msn };
|
||||
int r = extra.bnc->stale_message_tree.insert<struct toku_fifo_entry_key_msn_heaviside_extra, toku_fifo_entry_key_msn_heaviside>(offset, heaviside_extra, nullptr);
|
||||
assert_zero(r);
|
||||
return r;
|
||||
}
|
||||
|
@ -3799,13 +3794,13 @@ struct store_fifo_offset_extra {
|
|||
int i;
|
||||
};
|
||||
|
||||
static int
|
||||
store_fifo_offset(OMTVALUE v, u_int32_t UU(idx), void *extrap)
|
||||
// template-only function, but must be extern
|
||||
int store_fifo_offset(const long &offset, const uint32_t UU(idx), struct store_fifo_offset_extra &extra);
|
||||
int
|
||||
store_fifo_offset(const long &offset, const uint32_t UU(idx), struct store_fifo_offset_extra &extra)
|
||||
{
|
||||
struct store_fifo_offset_extra *extra = cast_to_typeof(extra) extrap;
|
||||
const long offset = (long) v;
|
||||
extra->offsets[extra->i] = offset;
|
||||
extra->i++;
|
||||
extra.offsets[extra.i] = offset;
|
||||
extra.i++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3814,14 +3809,13 @@ store_fifo_offset(OMTVALUE v, u_int32_t UU(idx), void *extrap)
|
|||
* figure out the MSN of each message, and compare those MSNs. Returns 1,
|
||||
* 0, or -1 if a is larger than, equal to, or smaller than b.
|
||||
*/
|
||||
static int
|
||||
fifo_offset_msn_cmp(void *extrap, const void *va, const void *vb)
|
||||
// template-only function, but must be extern
|
||||
int fifo_offset_msn_cmp(FIFO &fifo, const long &ao, const long &bo);
|
||||
int
|
||||
fifo_offset_msn_cmp(FIFO &fifo, const long &ao, const long &bo)
|
||||
{
|
||||
FIFO fifo = cast_to_typeof(fifo) extrap;
|
||||
const long *ao = cast_to_typeof(ao) va;
|
||||
const long *bo = cast_to_typeof(bo) vb;
|
||||
const struct fifo_entry *a = toku_fifo_get_entry(fifo, *ao);
|
||||
const struct fifo_entry *b = toku_fifo_get_entry(fifo, *bo);
|
||||
const struct fifo_entry *a = toku_fifo_get_entry(fifo, ao);
|
||||
const struct fifo_entry *b = toku_fifo_get_entry(fifo, bo);
|
||||
if (a->msn.msn > b->msn.msn) {
|
||||
return +1;
|
||||
}
|
||||
|
@ -3878,14 +3872,14 @@ struct iterate_do_bn_apply_cmd_extra {
|
|||
STAT64INFO stats_to_update;
|
||||
};
|
||||
|
||||
static int
|
||||
iterate_do_bn_apply_cmd(OMTVALUE v, u_int32_t UU(idx), void *extrap)
|
||||
// template-only function, but must be extern
|
||||
int iterate_do_bn_apply_cmd(const long &offset, const uint32_t UU(idx), struct iterate_do_bn_apply_cmd_extra &e);
|
||||
int
|
||||
iterate_do_bn_apply_cmd(const long &offset, const uint32_t UU(idx), struct iterate_do_bn_apply_cmd_extra &e)
|
||||
{
|
||||
struct iterate_do_bn_apply_cmd_extra *e = cast_to_typeof(e) extrap;
|
||||
const long offset = (long) v;
|
||||
NONLEAF_CHILDINFO bnc = BNC(e->ancestor, e->childnum);
|
||||
NONLEAF_CHILDINFO bnc = BNC(e.ancestor, e.childnum);
|
||||
const struct fifo_entry *entry = toku_fifo_get_entry(bnc->buffer, offset);
|
||||
do_bn_apply_cmd(e->t, e->bn, e->ancestor, e->childnum, entry, e->stats_to_update);
|
||||
do_bn_apply_cmd(e.t, e.bn, e.ancestor, e.childnum, entry, e.stats_to_update);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -3908,11 +3902,11 @@ static void
|
|||
find_bounds_within_message_tree(
|
||||
DESCRIPTOR desc, /// used for cmp
|
||||
ft_compare_func cmp, /// used to compare keys
|
||||
OMT message_tree, /// tree holding FIFO offsets, in which we want to look for indices
|
||||
const off_omt_t &message_tree, /// tree holding FIFO offsets, in which we want to look for indices
|
||||
FIFO buffer, /// buffer in which messages are found
|
||||
struct pivot_bounds const * const bounds, /// key bounds within the basement node we're applying messages to
|
||||
u_int32_t *lbi, /// (output) "lower bound inclusive" (index into message_tree)
|
||||
u_int32_t *ube /// (output) "upper bound exclusive" (index into message_tree)
|
||||
uint32_t *lbi, /// (output) "lower bound inclusive" (index into message_tree)
|
||||
uint32_t *ube /// (output) "upper bound exclusive" (index into message_tree)
|
||||
)
|
||||
{
|
||||
int r = 0;
|
||||
|
@ -3928,9 +3922,8 @@ find_bounds_within_message_tree(
|
|||
.fifo = buffer,
|
||||
.key = bounds->lower_bound_exclusive,
|
||||
.msn = MAX_MSN };
|
||||
OMTVALUE found_lb;
|
||||
r = toku_omt_find(message_tree, toku_fifo_entry_key_msn_heaviside,
|
||||
&lbi_extra, +1, &found_lb, lbi);
|
||||
long found_lb;
|
||||
r = message_tree.find<struct toku_fifo_entry_key_msn_heaviside_extra, toku_fifo_entry_key_msn_heaviside>(lbi_extra, +1, &found_lb, lbi);
|
||||
if (r == DB_NOTFOUND) {
|
||||
// There is no relevant data (the lower bound is bigger than
|
||||
// any message in this tree), so we have no range and we're
|
||||
|
@ -3975,18 +3968,17 @@ find_bounds_within_message_tree(
|
|||
.fifo = buffer,
|
||||
.key = bounds->upper_bound_inclusive,
|
||||
.msn = MAX_MSN };
|
||||
r = toku_omt_find(message_tree, toku_fifo_entry_key_msn_heaviside,
|
||||
&ube_extra, +1, NULL, ube);
|
||||
r = message_tree.find<struct toku_fifo_entry_key_msn_heaviside_extra, toku_fifo_entry_key_msn_heaviside>(ube_extra, +1, nullptr, ube);
|
||||
if (r == DB_NOTFOUND) {
|
||||
// Couldn't find anything in the buffer bigger than our key,
|
||||
// so we need to look at everything up to the end of
|
||||
// message_tree.
|
||||
*ube = toku_omt_size(message_tree);
|
||||
*ube = message_tree.size();
|
||||
}
|
||||
} else {
|
||||
// No upper bound given, it's positive infinity, so we need to go
|
||||
// through the end of the OMT.
|
||||
*ube = toku_omt_size(message_tree);
|
||||
*ube = message_tree.size();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4013,7 +4005,7 @@ bnc_apply_messages_to_basement_node(
|
|||
// Determine the offsets in the message trees between which we need to
|
||||
// apply messages from this buffer
|
||||
STAT64INFO_S stats_delta = {0,0};
|
||||
u_int32_t stale_lbi, stale_ube;
|
||||
uint32_t stale_lbi, stale_ube;
|
||||
if (!bn->stale_ancestor_messages_applied) {
|
||||
find_bounds_within_message_tree(&t->ft->cmp_descriptor, t->ft->compare_fun, bnc->stale_message_tree, bnc->buffer, bounds, &stale_lbi, &stale_ube);
|
||||
} else {
|
||||
|
@ -4031,29 +4023,29 @@ bnc_apply_messages_to_basement_node(
|
|||
// 2. only fresh messages
|
||||
// 3. only stale messages
|
||||
// 4. fresh and stale messages but no broadcasts
|
||||
if (toku_omt_size(bnc->broadcast_list) > 0) {
|
||||
if (bnc->broadcast_list.size() > 0) {
|
||||
// We have some broadcasts, which don't have keys, so we grab all
|
||||
// the relevant messages' offsets and sort them by MSN, then apply
|
||||
// them in MSN order.
|
||||
const int buffer_size = ((stale_ube - stale_lbi) + (fresh_ube - fresh_lbi) + toku_omt_size(bnc->broadcast_list));
|
||||
const int buffer_size = ((stale_ube - stale_lbi) + (fresh_ube - fresh_lbi) + bnc->broadcast_list.size());
|
||||
long *XMALLOC_N(buffer_size, offsets);
|
||||
struct store_fifo_offset_extra sfo_extra = { .offsets = offsets, .i = 0 };
|
||||
|
||||
// Populate offsets array with offsets to stale messages
|
||||
r = toku_omt_iterate_on_range(bnc->stale_message_tree, stale_lbi, stale_ube, store_fifo_offset, &sfo_extra);
|
||||
r = bnc->stale_message_tree.iterate_on_range<struct store_fifo_offset_extra, store_fifo_offset>(stale_lbi, stale_ube, sfo_extra);
|
||||
assert_zero(r);
|
||||
|
||||
// Then store fresh offsets
|
||||
r = toku_omt_iterate_on_range(bnc->fresh_message_tree, fresh_lbi, fresh_ube, store_fifo_offset, &sfo_extra);
|
||||
r = bnc->fresh_message_tree.iterate_on_range<struct store_fifo_offset_extra, store_fifo_offset>(fresh_lbi, fresh_ube, sfo_extra);
|
||||
assert_zero(r);
|
||||
|
||||
// Store offsets of all broadcast messages.
|
||||
r = toku_omt_iterate(bnc->broadcast_list, store_fifo_offset, &sfo_extra);
|
||||
r = bnc->broadcast_list.iterate<struct store_fifo_offset_extra, store_fifo_offset>(sfo_extra);
|
||||
assert_zero(r);
|
||||
invariant(sfo_extra.i == buffer_size);
|
||||
|
||||
// Sort by MSN.
|
||||
r = mergesort_r(offsets, buffer_size, sizeof offsets[0], bnc->buffer, fifo_offset_msn_cmp);
|
||||
r = toku::sort<long, FIFO, fifo_offset_msn_cmp>::mergesort_r(offsets, buffer_size, bnc->buffer);
|
||||
assert_zero(r);
|
||||
|
||||
// Apply the messages in MSN order.
|
||||
|
@ -4068,7 +4060,7 @@ bnc_apply_messages_to_basement_node(
|
|||
// No stale messages to apply, we just apply fresh messages.
|
||||
struct iterate_do_bn_apply_cmd_extra iter_extra = { .t = t, .bn = bn, .ancestor = ancestor, .childnum = childnum, .stats_to_update = &stats_delta};
|
||||
if (fresh_ube - fresh_lbi > 0) *msgs_applied = TRUE;
|
||||
r = toku_omt_iterate_on_range(bnc->fresh_message_tree, fresh_lbi, fresh_ube, iterate_do_bn_apply_cmd, &iter_extra);
|
||||
r = bnc->fresh_message_tree.iterate_on_range<struct iterate_do_bn_apply_cmd_extra, iterate_do_bn_apply_cmd>(fresh_lbi, fresh_ube, iter_extra);
|
||||
assert_zero(r);
|
||||
} else if (fresh_lbi == fresh_ube) {
|
||||
// No fresh messages to apply, we just apply stale messages.
|
||||
|
@ -4076,7 +4068,7 @@ bnc_apply_messages_to_basement_node(
|
|||
if (stale_ube - stale_lbi > 0) *msgs_applied = TRUE;
|
||||
struct iterate_do_bn_apply_cmd_extra iter_extra = { .t = t, .bn = bn, .ancestor = ancestor, .childnum = childnum , .stats_to_update = &stats_delta};
|
||||
|
||||
r = toku_omt_iterate_on_range(bnc->stale_message_tree, stale_lbi, stale_ube, iterate_do_bn_apply_cmd, &iter_extra);
|
||||
r = bnc->stale_message_tree.iterate_on_range<struct iterate_do_bn_apply_cmd_extra, iterate_do_bn_apply_cmd>(stale_lbi, stale_ube, iter_extra);
|
||||
assert_zero(r);
|
||||
} else {
|
||||
// We have stale and fresh messages but no broadcasts. We can
|
||||
|
@ -4084,11 +4076,11 @@ bnc_apply_messages_to_basement_node(
|
|||
|
||||
// For the loop, we'll keep the indices into both the fresh and
|
||||
// stale trees, and also the OMTVALUE at those indices.
|
||||
u_int32_t stale_i = stale_lbi, fresh_i = fresh_lbi;
|
||||
OMTVALUE stale_v, fresh_v;
|
||||
r = toku_omt_fetch(bnc->stale_message_tree, stale_i, &stale_v);
|
||||
uint32_t stale_i = stale_lbi, fresh_i = fresh_lbi;
|
||||
long stale_offset, fresh_offset;
|
||||
r = bnc->stale_message_tree.fetch(stale_i, &stale_offset);
|
||||
assert_zero(r);
|
||||
r = toku_omt_fetch(bnc->fresh_message_tree, fresh_i, &fresh_v);
|
||||
r = bnc->fresh_message_tree.fetch(fresh_i, &fresh_offset);
|
||||
assert_zero(r);
|
||||
|
||||
// This comparison extra struct won't change during iteration.
|
||||
|
@ -4098,9 +4090,7 @@ bnc_apply_messages_to_basement_node(
|
|||
// order) message at each step
|
||||
while (stale_i < stale_ube && fresh_i < fresh_ube) {
|
||||
*msgs_applied = TRUE;
|
||||
const long stale_offset = (long) stale_v;
|
||||
const long fresh_offset = (long) fresh_v;
|
||||
int c = toku_fifo_entry_key_msn_cmp(&extra, &stale_offset, &fresh_offset);
|
||||
int c = toku_fifo_entry_key_msn_cmp(extra, stale_offset, fresh_offset);
|
||||
if (c < 0) {
|
||||
// The stale message we're pointing to either has a
|
||||
// smaller key than the fresh message, or has the same key
|
||||
|
@ -4111,7 +4101,7 @@ bnc_apply_messages_to_basement_node(
|
|||
stale_i++;
|
||||
if (stale_i != stale_ube) {
|
||||
invariant(stale_i < stale_ube);
|
||||
r = toku_omt_fetch(bnc->stale_message_tree, stale_i, &stale_v);
|
||||
r = bnc->stale_message_tree.fetch(stale_i, &stale_offset);
|
||||
assert_zero(r);
|
||||
}
|
||||
} else if (c > 0) {
|
||||
|
@ -4124,37 +4114,35 @@ bnc_apply_messages_to_basement_node(
|
|||
fresh_i++;
|
||||
if (fresh_i != fresh_ube) {
|
||||
invariant(fresh_i < fresh_ube);
|
||||
r = toku_omt_fetch(bnc->fresh_message_tree, fresh_i, &fresh_v);
|
||||
r = bnc->fresh_message_tree.fetch(fresh_i, &fresh_offset);
|
||||
assert_zero(r);
|
||||
}
|
||||
} else {
|
||||
// We have found the same MSN in both trees. This means a
|
||||
// single message showing up in both trees. This should
|
||||
// not happen.
|
||||
assert(false);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
// Apply the rest of the stale messages, if any exist
|
||||
while (stale_i < stale_ube) {
|
||||
const long stale_offset = (long) stale_v;
|
||||
const struct fifo_entry *stale_entry = toku_fifo_get_entry(bnc->buffer, stale_offset);
|
||||
do_bn_apply_cmd(t, bn, ancestor, childnum, stale_entry, &stats_delta);
|
||||
stale_i++;
|
||||
if (stale_i != stale_ube) {
|
||||
r = toku_omt_fetch(bnc->stale_message_tree, stale_i, &stale_v);
|
||||
r = bnc->stale_message_tree.fetch(stale_i, &stale_offset);
|
||||
assert_zero(r);
|
||||
}
|
||||
}
|
||||
|
||||
// Apply the rest of the fresh messages, if any exist
|
||||
while (fresh_i < fresh_ube) {
|
||||
const long fresh_offset = (long) fresh_v;
|
||||
const struct fifo_entry *fresh_entry = toku_fifo_get_entry(bnc->buffer, fresh_offset);
|
||||
do_bn_apply_cmd(t, bn, ancestor, childnum, fresh_entry, &stats_delta);
|
||||
fresh_i++;
|
||||
if (fresh_i != fresh_ube) {
|
||||
r = toku_omt_fetch(bnc->fresh_message_tree, fresh_i, &fresh_v);
|
||||
r = bnc->fresh_message_tree.fetch(fresh_i, &fresh_offset);
|
||||
assert_zero(r);
|
||||
}
|
||||
}
|
||||
|
@ -4169,12 +4157,12 @@ bnc_apply_messages_to_basement_node(
|
|||
// procedures because we're still looking at the fresh tree. Instead
|
||||
// we have to move messages after we're done looking at it.
|
||||
struct copy_to_stale_extra cts_extra = { .ft_handle = t, .bnc = bnc };
|
||||
r = toku_omt_iterate_on_range(bnc->fresh_message_tree, fresh_lbi, fresh_ube, copy_to_stale, &cts_extra);
|
||||
r = bnc->fresh_message_tree.iterate_on_range<struct copy_to_stale_extra, copy_to_stale>(fresh_lbi, fresh_ube, cts_extra);
|
||||
assert_zero(r);
|
||||
for (u_int32_t ube = fresh_ube; fresh_lbi < ube; --ube) {
|
||||
for (uint32_t ube = fresh_ube; fresh_lbi < ube; --ube) {
|
||||
// When we delete the message at the fresh_lbi index, everything
|
||||
// to the right moves down one spot, including the offset at ube.
|
||||
r = toku_omt_delete_at(bnc->fresh_message_tree, fresh_lbi);
|
||||
r = bnc->fresh_message_tree.delete_at(fresh_lbi);
|
||||
assert_zero(r);
|
||||
}
|
||||
return r;
|
||||
|
@ -4272,7 +4260,7 @@ ok: ;
|
|||
&datav, &idx);
|
||||
if (r!=0) return r;
|
||||
|
||||
LEAFENTRY le = cast_to_typeof(le) datav;
|
||||
LEAFENTRY CAST_FROM_VOIDP(le, datav);
|
||||
if (toku_ft_cursor_is_leaf_mode(ftcursor))
|
||||
goto got_a_good_value; // leaf mode cursors see all leaf entries
|
||||
if (is_le_val_del(le,ftcursor)) {
|
||||
|
@ -4295,7 +4283,7 @@ ok: ;
|
|||
}
|
||||
r = toku_omt_fetch(bn->buffer, idx, &datav);
|
||||
assert_zero(r); // we just validated the index
|
||||
le = cast_to_typeof(le) datav;
|
||||
CAST_FROM_VOIDP(le, datav);
|
||||
if (!is_le_val_del(le,ftcursor)) goto got_a_good_value;
|
||||
}
|
||||
}
|
||||
|
@ -4371,7 +4359,7 @@ static int
|
|||
ftnode_fetch_callback_and_free_bfe(CACHEFILE cf, int fd, BLOCKNUM nodename, u_int32_t fullhash, void **ftnode_pv, void** UU(disk_data), PAIR_ATTR *sizep, int *dirtyp, void *extraargs)
|
||||
{
|
||||
int r = toku_ftnode_fetch_callback(cf, fd, nodename, fullhash, ftnode_pv, disk_data, sizep, dirtyp, extraargs);
|
||||
struct ftnode_fetch_extra *ffe = cast_to_typeof(ffe) extraargs;
|
||||
struct ftnode_fetch_extra *CAST_FROM_VOIDP(ffe, extraargs);
|
||||
destroy_bfe_for_prefetch(ffe);
|
||||
toku_free(ffe);
|
||||
return r;
|
||||
|
@ -4381,7 +4369,7 @@ static int
|
|||
ftnode_pf_callback_and_free_bfe(void *ftnode_pv, void* disk_data, void *read_extraargs, int fd, PAIR_ATTR *sizep)
|
||||
{
|
||||
int r = toku_ftnode_pf_callback(ftnode_pv, disk_data, read_extraargs, fd, sizep);
|
||||
struct ftnode_fetch_extra *ffe = cast_to_typeof(ffe) read_extraargs;
|
||||
struct ftnode_fetch_extra *CAST_FROM_VOIDP(ffe, read_extraargs);
|
||||
destroy_bfe_for_prefetch(ffe);
|
||||
toku_free(ffe);
|
||||
return r;
|
||||
|
@ -4430,7 +4418,7 @@ struct unlock_ftnode_extra {
|
|||
// When this is called, the cachetable lock is held
|
||||
static void
|
||||
unlock_ftnode_fun (void *v) {
|
||||
struct unlock_ftnode_extra *x = cast_to_typeof(x) v;
|
||||
struct unlock_ftnode_extra *CAST_FROM_VOIDP(x, v);
|
||||
FT_HANDLE brt = x->ft_handle;
|
||||
FTNODE node = x->node;
|
||||
// CT lock is held
|
||||
|
@ -4897,7 +4885,7 @@ ft_cursor_compare_one(ft_search_t *search __attribute__((__unused__)), DBT *x __
|
|||
}
|
||||
|
||||
static int ft_cursor_compare_set(ft_search_t *search, DBT *x) {
|
||||
FT_HANDLE brt = cast_to_typeof(brt) search->context;
|
||||
FT_HANDLE CAST_FROM_VOIDP(brt, search->context);
|
||||
return compare_k_x(brt, search->k, x) <= 0; /* return min xy: kv <= xy */
|
||||
}
|
||||
|
||||
|
@ -4905,7 +4893,7 @@ static int
|
|||
ft_cursor_current_getf(ITEMLEN keylen, bytevec key,
|
||||
ITEMLEN vallen, bytevec val,
|
||||
void *v, bool lock_only) {
|
||||
struct ft_cursor_search_struct *bcss = cast_to_typeof(bcss) v;
|
||||
struct ft_cursor_search_struct *CAST_FROM_VOIDP(bcss, v);
|
||||
int r;
|
||||
if (key==NULL) {
|
||||
r = bcss->getf(0, NULL, 0, NULL, bcss->getf_v, lock_only);
|
||||
|
@ -4957,7 +4945,7 @@ toku_ft_cursor_last(FT_CURSOR cursor, FT_GET_CALLBACK_FUNCTION getf, void *getf_
|
|||
}
|
||||
|
||||
static int ft_cursor_compare_next(ft_search_t *search, DBT *x) {
|
||||
FT_HANDLE brt = cast_to_typeof(brt) search->context;
|
||||
FT_HANDLE CAST_FROM_VOIDP(brt, search->context);
|
||||
return compare_k_x(brt, search->k, x) < 0; /* return min xy: kv < xy */
|
||||
}
|
||||
|
||||
|
@ -4987,7 +4975,7 @@ ft_cursor_shortcut (
|
|||
index += direction;
|
||||
r = toku_omt_fetch(omt, index, &lev);
|
||||
assert_zero(r);
|
||||
LEAFENTRY le = cast_to_typeof(le) lev;
|
||||
LEAFENTRY CAST_FROM_VOIDP(le, lev);
|
||||
|
||||
if (toku_ft_cursor_is_leaf_mode(cursor) || !is_le_val_del(le, cursor)) {
|
||||
|
||||
|
@ -5031,7 +5019,7 @@ static int
|
|||
ft_cursor_search_eq_k_x_getf(ITEMLEN keylen, bytevec key,
|
||||
ITEMLEN vallen, bytevec val,
|
||||
void *v, bool lock_only) {
|
||||
struct ft_cursor_search_struct *bcss = cast_to_typeof(bcss) v;
|
||||
struct ft_cursor_search_struct *CAST_FROM_VOIDP(bcss, v);
|
||||
int r;
|
||||
if (key==NULL) {
|
||||
r = bcss->getf(0, NULL, 0, NULL, bcss->getf_v, false);
|
||||
|
@ -5059,7 +5047,7 @@ ft_cursor_search_eq_k_x(FT_CURSOR cursor, ft_search_t *search, FT_GET_CALLBACK_F
|
|||
}
|
||||
|
||||
static int ft_cursor_compare_prev(ft_search_t *search, DBT *x) {
|
||||
FT_HANDLE brt = cast_to_typeof(brt) search->context;
|
||||
FT_HANDLE CAST_FROM_VOIDP(brt, search->context);
|
||||
return compare_k_x(brt, search->k, x) > 0; /* return max xy: kv > xy */
|
||||
}
|
||||
|
||||
|
@ -5073,7 +5061,7 @@ toku_ft_cursor_prev(FT_CURSOR cursor, FT_GET_CALLBACK_FUNCTION getf, void *getf_
|
|||
}
|
||||
|
||||
static int ft_cursor_compare_set_range(ft_search_t *search, DBT *x) {
|
||||
FT_HANDLE brt = cast_to_typeof(brt) search->context;
|
||||
FT_HANDLE CAST_FROM_VOIDP(brt, search->context);
|
||||
return compare_k_x(brt, search->k, x) <= 0; /* return kv <= xy */
|
||||
}
|
||||
|
||||
|
@ -5096,7 +5084,7 @@ toku_ft_cursor_set_range(FT_CURSOR cursor, DBT *key, FT_GET_CALLBACK_FUNCTION ge
|
|||
}
|
||||
|
||||
static int ft_cursor_compare_set_range_reverse(ft_search_t *search, DBT *x) {
|
||||
FT_HANDLE brt = cast_to_typeof(brt) search->context;
|
||||
FT_HANDLE CAST_FROM_VOIDP(brt, search->context);
|
||||
return compare_k_x(brt, search->k, x) >= 0; /* return kv >= xy */
|
||||
}
|
||||
|
||||
|
@ -5228,12 +5216,12 @@ struct keyrange_compare_s {
|
|||
|
||||
static int
|
||||
keyrange_compare (OMTVALUE lev, void *extra) {
|
||||
LEAFENTRY le = cast_to_typeof(le) lev;
|
||||
LEAFENTRY CAST_FROM_VOIDP(le, lev);
|
||||
u_int32_t keylen;
|
||||
void* key = le_key_and_len(le, &keylen);
|
||||
DBT omt_dbt;
|
||||
toku_fill_dbt(&omt_dbt, key, keylen);
|
||||
struct keyrange_compare_s *s = cast_to_typeof(s) extra;
|
||||
struct keyrange_compare_s *CAST_FROM_VOIDP(s, extra);
|
||||
// TODO: maybe put a const fake_db in the header
|
||||
FAKE_DB(db, &s->ft_handle->ft->cmp_descriptor);
|
||||
return s->ft_handle->ft->compare_fun(&db, &omt_dbt, s->key);
|
||||
|
@ -5428,7 +5416,7 @@ toku_dump_ftnode (FILE *file, FT_HANDLE brt, BLOCKNUM blocknum, int depth, const
|
|||
&bfe
|
||||
);
|
||||
assert_zero(r);
|
||||
node = cast_to_typeof(node) node_v;
|
||||
CAST_FROM_VOIDP(node, node_v);
|
||||
assert(node->fullhash==fullhash);
|
||||
fprintf(file, "%*sNode=%p\n", depth, "", node);
|
||||
|
||||
|
@ -5460,7 +5448,7 @@ toku_dump_ftnode (FILE *file, FT_HANDLE brt, BLOCKNUM blocknum, int depth, const
|
|||
OMTVALUE v = 0;
|
||||
r = toku_omt_fetch(BLB_BUFFER(node, i), j, &v);
|
||||
assert_zero(r);
|
||||
LEAFENTRY le = cast_to_typeof(le) v;
|
||||
LEAFENTRY CAST_FROM_VOIDP(le, v);
|
||||
fprintf(file, " [%d]=", j);
|
||||
print_leafentry(file, le);
|
||||
fprintf(file, "\n");
|
||||
|
@ -5473,7 +5461,7 @@ toku_dump_ftnode (FILE *file, FT_HANDLE brt, BLOCKNUM blocknum, int depth, const
|
|||
for (i=0; i<node->n_children; i++) {
|
||||
fprintf(file, "%*schild %d\n", depth, "", i);
|
||||
if (i>0) {
|
||||
char *key = cast_to_typeof(key) node->childkeys[i-1].data;
|
||||
char *CAST_FROM_VOIDP(key, node->childkeys[i-1].data);
|
||||
fprintf(file, "%*spivot %d len=%u %u\n", depth+1, "", i-1, node->childkeys[i-1].size, (unsigned)toku_dtoh32(*(int*)key));
|
||||
}
|
||||
toku_dump_ftnode(file, brt, BP_BLOCKNUM(node, i), depth+4,
|
||||
|
@ -5574,7 +5562,7 @@ toku_ft_unlink_on_commit(FT_HANDLE handle, TOKUTXN txn) {
|
|||
|
||||
assert(txn);
|
||||
cf = handle->ft->cf;
|
||||
FT ft = cast_to_typeof(ft) toku_cachefile_get_userdata(cf);
|
||||
FT CAST_FROM_VOIDP(ft, toku_cachefile_get_userdata(cf));
|
||||
|
||||
toku_txn_maybe_note_ft(txn, ft);
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef FT_OPS_H
|
||||
#define FT_OPS_H
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
// This must be first to make the 64-bit file mode work right in Linux
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#ifndef FT_SEARCH_H
|
||||
#define FT_SEARCH_H
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum ft_search_direction_e {
|
||||
FT_SEARCH_LEFT = 1, /* search left -> right, finds min xy as defined by the compare function */
|
||||
|
@ -71,8 +68,5 @@ static inline void ft_search_finish(ft_search_t *so) {
|
|||
if (so->have_pivot_bound) toku_free(so->pivot_bound.data);
|
||||
}
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "includes.h"
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "includes.h"
|
||||
|
@ -97,7 +97,7 @@ int toku_testsetup_get_sersize(FT_HANDLE brt, BLOCKNUM diskoff) // Return the si
|
|||
&bfe
|
||||
);
|
||||
assert(r==0);
|
||||
FTNODE node = cast_to_typeof(node) node_v;
|
||||
FTNODE CAST_FROM_VOIDP(node, node_v);
|
||||
int size = toku_serialize_ftnode_size(node);
|
||||
toku_unpin_ftnode(brt->ft, node);
|
||||
return size;
|
||||
|
@ -125,7 +125,7 @@ int toku_testsetup_insert_to_leaf (FT_HANDLE brt, BLOCKNUM blocknum, const char
|
|||
&bfe
|
||||
);
|
||||
if (r!=0) return r;
|
||||
FTNODE node = cast_to_typeof(node) node_v;
|
||||
FTNODE CAST_FROM_VOIDP(node, node_v);
|
||||
toku_verify_or_set_counts(node);
|
||||
assert(node->height==0);
|
||||
|
||||
|
@ -154,7 +154,7 @@ int toku_testsetup_insert_to_leaf (FT_HANDLE brt, BLOCKNUM blocknum, const char
|
|||
static int
|
||||
testhelper_string_key_cmp(DB *UU(e), const DBT *a, const DBT *b)
|
||||
{
|
||||
char *s = cast_to_typeof(s) a->data, *t = cast_to_typeof(t) b->data;
|
||||
char *CAST_FROM_VOIDP(s, a->data), *CAST_FROM_VOIDP(t, b->data);
|
||||
return strcmp(s, t);
|
||||
}
|
||||
|
||||
|
@ -198,7 +198,7 @@ int toku_testsetup_insert_to_nonleaf (FT_HANDLE brt, BLOCKNUM blocknum, enum ft_
|
|||
&bfe
|
||||
);
|
||||
if (r!=0) return r;
|
||||
FTNODE node = cast_to_typeof(node) node_v;
|
||||
FTNODE CAST_FROM_VOIDP(node, node_v);
|
||||
assert(node->height>0);
|
||||
|
||||
DBT k;
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
/* Verify a BRT. */
|
||||
|
@ -105,14 +105,14 @@ struct count_msgs_extra {
|
|||
FIFO fifo;
|
||||
};
|
||||
|
||||
static int
|
||||
count_msgs(OMTVALUE v, u_int32_t UU(idx), void *ve)
|
||||
// template-only function, but must be extern
|
||||
int count_msgs(const long &offset, const uint32_t UU(idx), struct count_msgs_extra &e);
|
||||
int
|
||||
count_msgs(const long &offset, const uint32_t UU(idx), struct count_msgs_extra &e)
|
||||
{
|
||||
struct count_msgs_extra *e = cast_to_typeof(e) ve;
|
||||
long offset = (long) v;
|
||||
const struct fifo_entry *entry = toku_fifo_get_entry(e->fifo, offset);
|
||||
if (entry->msn.msn == e->msn.msn) {
|
||||
e->count++;
|
||||
const struct fifo_entry *entry = toku_fifo_get_entry(e.fifo, offset);
|
||||
if (entry->msn.msn == e.msn.msn) {
|
||||
e.count++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -127,28 +127,28 @@ struct verify_message_tree_extra {
|
|||
int keep_going_on_failure;
|
||||
};
|
||||
|
||||
static int
|
||||
verify_message_tree(OMTVALUE v, u_int32_t UU(idx), void *ve)
|
||||
// template-only function, but must be extern
|
||||
int verify_message_tree(const long &offset, const uint32_t UU(idx), struct verify_message_tree_extra &e);
|
||||
int
|
||||
verify_message_tree(const long &offset, const uint32_t UU(idx), struct verify_message_tree_extra &e)
|
||||
{
|
||||
struct verify_message_tree_extra *e = cast_to_typeof(e) ve;
|
||||
int verbose = e->verbose;
|
||||
BLOCKNUM blocknum = e->blocknum;
|
||||
int keep_going_on_failure = e->keep_going_on_failure;
|
||||
int verbose = e.verbose;
|
||||
BLOCKNUM blocknum = e.blocknum;
|
||||
int keep_going_on_failure = e.keep_going_on_failure;
|
||||
int result = 0;
|
||||
long offset = (long) v;
|
||||
const struct fifo_entry *entry = toku_fifo_get_entry(e->fifo, offset);
|
||||
if (e->broadcast) {
|
||||
const struct fifo_entry *entry = toku_fifo_get_entry(e.fifo, offset);
|
||||
if (e.broadcast) {
|
||||
VERIFY_ASSERTION(ft_msg_type_applies_all((enum ft_msg_type) entry->type) || ft_msg_type_does_nothing((enum ft_msg_type) entry->type),
|
||||
e->i, "message found in broadcast list that is not a broadcast");
|
||||
e.i, "message found in broadcast list that is not a broadcast");
|
||||
} else {
|
||||
VERIFY_ASSERTION(ft_msg_type_applies_once((enum ft_msg_type) entry->type),
|
||||
e->i, "message found in fresh or stale message tree that does not apply once");
|
||||
if (e->is_fresh) {
|
||||
e.i, "message found in fresh or stale message tree that does not apply once");
|
||||
if (e.is_fresh) {
|
||||
VERIFY_ASSERTION(entry->is_fresh,
|
||||
e->i, "message found in fresh message tree that is not fresh");
|
||||
e.i, "message found in fresh message tree that is not fresh");
|
||||
} else {
|
||||
VERIFY_ASSERTION(!entry->is_fresh,
|
||||
e->i, "message found in stale message tree that is fresh");
|
||||
e.i, "message found in stale message tree that is fresh");
|
||||
}
|
||||
}
|
||||
done:
|
||||
|
@ -156,17 +156,16 @@ done:
|
|||
}
|
||||
|
||||
static int
|
||||
verify_sorted_by_key_msn(FT_HANDLE brt, FIFO fifo, OMT mt) {
|
||||
verify_sorted_by_key_msn(FT_HANDLE brt, FIFO fifo, const off_omt_t &mt) {
|
||||
int result = 0;
|
||||
size_t last_offset = 0;
|
||||
for (u_int32_t i = 0; i < toku_omt_size(mt); i++) {
|
||||
OMTVALUE v;
|
||||
int r = toku_omt_fetch(mt, i, &v);
|
||||
for (u_int32_t i = 0; i < mt.size(); i++) {
|
||||
long offset;
|
||||
int r = mt.fetch(i, &offset);
|
||||
assert_zero(r);
|
||||
size_t offset = (size_t) v;
|
||||
if (i > 0) {
|
||||
struct toku_fifo_entry_key_msn_cmp_extra extra = { .desc = &brt->ft->cmp_descriptor, .cmp = brt->ft->compare_fun, .fifo = fifo };
|
||||
if (toku_fifo_entry_key_msn_cmp(&extra, &last_offset, &offset) >= 0) {
|
||||
if (toku_fifo_entry_key_msn_cmp(extra, last_offset, offset) >= 0) {
|
||||
result = TOKUDB_NEEDS_REPAIR;
|
||||
break;
|
||||
}
|
||||
|
@ -177,12 +176,11 @@ verify_sorted_by_key_msn(FT_HANDLE brt, FIFO fifo, OMT mt) {
|
|||
}
|
||||
|
||||
static int
|
||||
count_eq_key_msn(FT_HANDLE brt, FIFO fifo, OMT mt, const DBT *key, MSN msn) {
|
||||
struct toku_fifo_entry_key_msn_heaviside_extra extra = {
|
||||
count_eq_key_msn(FT_HANDLE brt, FIFO fifo, const off_omt_t &mt, const DBT *key, MSN msn) {
|
||||
struct toku_fifo_entry_key_msn_heaviside_extra extra = {
|
||||
.desc = &brt->ft->cmp_descriptor, .cmp = brt->ft->compare_fun, .fifo = fifo, .key = key, .msn = msn
|
||||
};
|
||||
OMTVALUE v; u_int32_t idx;
|
||||
int r = toku_omt_find_zero(mt, toku_fifo_entry_key_msn_heaviside, &extra, &v, &idx);
|
||||
int r = mt.find_zero<struct toku_fifo_entry_key_msn_heaviside_extra, toku_fifo_entry_key_msn_heaviside>(extra, nullptr, nullptr);
|
||||
int count;
|
||||
if (r == 0) {
|
||||
count = 1;
|
||||
|
@ -298,19 +296,19 @@ toku_verify_ftnode (FT_HANDLE brt,
|
|||
} else {
|
||||
VERIFY_ASSERTION(ft_msg_type_applies_all(type) || ft_msg_type_does_nothing(type), i, "a message was found that does not apply either to all or to only one key");
|
||||
struct count_msgs_extra extra = { .count = 0, .msn = msn, .fifo = bnc->buffer };
|
||||
toku_omt_iterate(bnc->broadcast_list, count_msgs, &extra);
|
||||
bnc->broadcast_list.iterate<struct count_msgs_extra, count_msgs>(extra);
|
||||
VERIFY_ASSERTION(extra.count == 1, i, "a broadcast message was not found in the broadcast list");
|
||||
}
|
||||
last_msn = msn;
|
||||
}));
|
||||
struct verify_message_tree_extra extra = { .fifo = bnc->buffer, .broadcast = false, .is_fresh = true, .i = i, .verbose = verbose, .blocknum = node->thisnodename, .keep_going_on_failure = keep_going_on_failure };
|
||||
int r = toku_omt_iterate(bnc->fresh_message_tree, verify_message_tree, &extra);
|
||||
int r = bnc->fresh_message_tree.iterate<struct verify_message_tree_extra, verify_message_tree>(extra);
|
||||
if (r != 0) { result = r; goto done; }
|
||||
extra.is_fresh = false;
|
||||
r = toku_omt_iterate(bnc->stale_message_tree, verify_message_tree, &extra);
|
||||
r = bnc->stale_message_tree.iterate<struct verify_message_tree_extra, verify_message_tree>(extra);
|
||||
if (r != 0) { result = r; goto done; }
|
||||
extra.broadcast = true;
|
||||
r = toku_omt_iterate(bnc->broadcast_list, verify_message_tree, &extra);
|
||||
r = bnc->broadcast_list.iterate<struct verify_message_tree_extra, verify_message_tree>(extra);
|
||||
if (r != 0) { result = r; goto done; }
|
||||
}
|
||||
else {
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id: ft-ops.c 43396 2012-05-11 17:24:47Z zardosht $"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
|
8
ft/ft.h
8
ft/ft.h
|
@ -1,9 +1,9 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef FT_H
|
||||
#define FT_H
|
||||
#ident "$Id: ft.h 43422 2012-05-12 17:51:02Z zardosht $"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "fttypes.h"
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef FT_LAYOUT_VERSION_H
|
||||
#define FT_LAYOUT_VERSION_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
//Must be defined before other recursive headers could include logger.h
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
|
||||
|
||||
#include <toku_portability.h>
|
12
ft/ft_msg.h
12
ft/ft_msg.h
|
@ -1,5 +1,5 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
|
||||
/* The purpose of this file is to provide access to the ft_msg,
|
||||
* which is the ephemeral version of the fifo_msg.
|
||||
|
@ -9,12 +9,9 @@
|
|||
#define FT_MSG_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
u_int32_t ft_msg_get_keylen(FT_MSG ft_msg);
|
||||
|
||||
|
@ -36,9 +33,6 @@ void ft_msg_from_dbts(FT_MSG ft_msg, DBT *key, DBT *val, XIDS xids, enum ft_msg_
|
|||
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#endif // FT_MSG_H
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id: ft-serialize.c 43686 2012-05-18 23:21:00Z leifwalsh $"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "includes.h"
|
||||
#include "sort.h"
|
||||
#include "sort-tmpl.h"
|
||||
#include "threadpool.h"
|
||||
#include <compress.h>
|
||||
|
||||
|
@ -214,10 +214,10 @@ serialize_node_header(FTNODE node, FTNODE_DISK_DATA ndd, struct wbuf *wbuf) {
|
|||
}
|
||||
|
||||
static int
|
||||
wbufwriteleafentry (OMTVALUE lev, u_int32_t UU(idx), void *v) {
|
||||
LEAFENTRY le = (LEAFENTRY) lev;
|
||||
struct wbuf *thisw = (struct wbuf *) v;
|
||||
wbuf_nocrc_LEAFENTRY(thisw, le);
|
||||
wbufwriteleafentry(OMTVALUE lev, const uint32_t UU(idx), void *wbv) {
|
||||
const LEAFENTRY CAST_FROM_VOIDP(le, lev);
|
||||
struct wbuf *CAST_FROM_VOIDP(wb, wbv);
|
||||
wbuf_nocrc_LEAFENTRY(wb, le);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -284,13 +284,14 @@ serialize_ftnode_partition(FTNODE node, int i, struct sub_block *sb) {
|
|||
}
|
||||
else {
|
||||
unsigned char ch = FTNODE_PARTITION_OMT_LEAVES;
|
||||
OMT buffer = BLB_BUFFER(node, i);
|
||||
wbuf_nocrc_char(&wb, ch);
|
||||
wbuf_nocrc_uint(&wb, toku_omt_size(BLB_BUFFER(node, i)));
|
||||
wbuf_nocrc_uint(&wb, toku_omt_size(buffer));
|
||||
|
||||
//
|
||||
// iterate over leafentries and place them into the buffer
|
||||
//
|
||||
toku_omt_iterate(BLB_BUFFER(node, i), wbufwriteleafentry, &wb);
|
||||
toku_omt_iterate(buffer, wbufwriteleafentry, &wb);
|
||||
}
|
||||
u_int32_t end_to_end_checksum = x1764_memory(sb->uncompressed_ptr, wbuf_get_woffset(&wb));
|
||||
wbuf_nocrc_int(&wb, end_to_end_checksum);
|
||||
|
@ -429,8 +430,8 @@ struct array_info {
|
|||
};
|
||||
|
||||
static int
|
||||
array_item (OMTVALUE lev, u_int32_t idx, void *vsi) {
|
||||
struct array_info *ai = (struct array_info *) vsi;
|
||||
array_item (OMTVALUE lev, const uint32_t idx, void *aiv) {
|
||||
struct array_info *CAST_FROM_VOIDP(ai, aiv);
|
||||
ai->array[idx+ai->offset] = lev;
|
||||
return 0;
|
||||
}
|
||||
|
@ -464,7 +465,6 @@ rebalance_ftnode_leaf(FTNODE node, unsigned int basementnodesize)
|
|||
// Count number of leaf entries in this leaf (num_le).
|
||||
u_int32_t num_le = 0;
|
||||
for (uint32_t i = 0; i < num_orig_basements; i++) {
|
||||
invariant(BLB_BUFFER(node, i));
|
||||
num_le += toku_omt_size(BLB_BUFFER(node, i));
|
||||
}
|
||||
|
||||
|
@ -569,7 +569,7 @@ rebalance_ftnode_leaf(FTNODE node, unsigned int basementnodesize)
|
|||
|
||||
// first the pivots
|
||||
for (int i = 0; i < num_pivots; i++) {
|
||||
LEAFENTRY curr_le_pivot = (LEAFENTRY) leafpointers[new_pivots[i]];
|
||||
LEAFENTRY CAST_FROM_VOIDP(curr_le_pivot, leafpointers[new_pivots[i]]);
|
||||
uint32_t keylen;
|
||||
void *key = le_key_and_len(curr_le_pivot, &keylen);
|
||||
toku_fill_dbt(&node->childkeys[i],
|
||||
|
@ -594,19 +594,19 @@ rebalance_ftnode_leaf(FTNODE node, unsigned int basementnodesize)
|
|||
invariant(baseindex_this_bn == curr_start);
|
||||
uint32_t num_les_to_copy = num_les_this_bn[i];
|
||||
invariant(num_les_to_copy == num_in_bn);
|
||||
|
||||
|
||||
// construct mempool for this basement
|
||||
size_t size_this_bn = bn_sizes[i];
|
||||
BASEMENTNODE bn = BLB(node, i);
|
||||
struct mempool * mp = &bn->buffer_mempool;
|
||||
struct mempool *mp = &bn->buffer_mempool;
|
||||
toku_mempool_construct(mp, size_this_bn);
|
||||
|
||||
OMTVALUE *XMALLOC_N(num_in_bn, bn_array);
|
||||
for (uint32_t le_index = 0; le_index < num_les_to_copy; le_index++) {
|
||||
uint32_t le_within_node = baseindex_this_bn + le_index;
|
||||
size_t le_size = le_sizes[le_within_node];
|
||||
void * new_le = toku_mempool_malloc(mp, le_size, 1); // point to new location
|
||||
void * old_le = leafpointers[le_within_node];
|
||||
void *new_le = toku_mempool_malloc(mp, le_size, 1); // point to new location
|
||||
void *old_le = leafpointers[le_within_node];
|
||||
memcpy(new_le, old_le, le_size); // put le data at new location
|
||||
bn_array[le_index] = new_le; // point to new location (in new mempool)
|
||||
}
|
||||
|
@ -918,8 +918,8 @@ deserialize_child_buffer(NONLEAF_CHILDINFO bnc, struct rbuf *rbuf,
|
|||
DESCRIPTOR desc, ft_compare_func cmp) {
|
||||
int r;
|
||||
int n_in_this_buffer = rbuf_int(rbuf);
|
||||
void **fresh_offsets = NULL, **stale_offsets = NULL;
|
||||
void **broadcast_offsets = NULL;
|
||||
long *fresh_offsets = NULL, *stale_offsets = NULL;
|
||||
long *broadcast_offsets = NULL;
|
||||
int nfresh = 0, nstale = 0;
|
||||
int nbroadcast_offsets = 0;
|
||||
if (cmp) {
|
||||
|
@ -944,14 +944,14 @@ deserialize_child_buffer(NONLEAF_CHILDINFO bnc, struct rbuf *rbuf,
|
|||
if (cmp) {
|
||||
if (ft_msg_type_applies_once(type)) {
|
||||
if (is_fresh) {
|
||||
dest = (long *) &fresh_offsets[nfresh];
|
||||
dest = &fresh_offsets[nfresh];
|
||||
nfresh++;
|
||||
} else {
|
||||
dest = (long *) &stale_offsets[nstale];
|
||||
dest = &stale_offsets[nstale];
|
||||
nstale++;
|
||||
}
|
||||
} else if (ft_msg_type_applies_all(type) || ft_msg_type_does_nothing(type)) {
|
||||
dest = (long *) &broadcast_offsets[nbroadcast_offsets];
|
||||
dest = &broadcast_offsets[nbroadcast_offsets];
|
||||
nbroadcast_offsets++;
|
||||
} else {
|
||||
assert(FALSE);
|
||||
|
@ -968,19 +968,16 @@ deserialize_child_buffer(NONLEAF_CHILDINFO bnc, struct rbuf *rbuf,
|
|||
|
||||
if (cmp) {
|
||||
struct toku_fifo_entry_key_msn_cmp_extra extra = { .desc = desc, .cmp = cmp, .fifo = bnc->buffer };
|
||||
r = mergesort_r(fresh_offsets, nfresh, sizeof fresh_offsets[0], &extra, toku_fifo_entry_key_msn_cmp);
|
||||
r = toku::sort<long, const struct toku_fifo_entry_key_msn_cmp_extra, toku_fifo_entry_key_msn_cmp>::mergesort_r(fresh_offsets, nfresh, extra);
|
||||
assert_zero(r);
|
||||
toku_omt_destroy(&bnc->fresh_message_tree);
|
||||
r = toku_omt_create_steal_sorted_array(&bnc->fresh_message_tree, &fresh_offsets, nfresh, n_in_this_buffer);
|
||||
assert_zero(r);
|
||||
r = mergesort_r(stale_offsets, nstale, sizeof stale_offsets[0], &extra, toku_fifo_entry_key_msn_cmp);
|
||||
assert_zero(r);
|
||||
toku_omt_destroy(&bnc->stale_message_tree);
|
||||
r = toku_omt_create_steal_sorted_array(&bnc->stale_message_tree, &stale_offsets, nstale, n_in_this_buffer);
|
||||
assert_zero(r);
|
||||
toku_omt_destroy(&bnc->broadcast_list);
|
||||
r = toku_omt_create_steal_sorted_array(&bnc->broadcast_list, &broadcast_offsets, nbroadcast_offsets, n_in_this_buffer);
|
||||
bnc->fresh_message_tree.deinit();
|
||||
bnc->fresh_message_tree.init_steal_sorted_array(fresh_offsets, nfresh, n_in_this_buffer);
|
||||
r = toku::sort<long, const struct toku_fifo_entry_key_msn_cmp_extra, toku_fifo_entry_key_msn_cmp>::mergesort_r(stale_offsets, nstale, extra);
|
||||
assert_zero(r);
|
||||
bnc->stale_message_tree.deinit();
|
||||
bnc->stale_message_tree.init_steal_sorted_array(stale_offsets, nstale, n_in_this_buffer);
|
||||
bnc->broadcast_list.deinit();
|
||||
bnc->broadcast_list.init_steal_sorted_array(broadcast_offsets, nbroadcast_offsets, n_in_this_buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1022,9 +1019,8 @@ dump_bad_block(unsigned char *vp, u_int64_t size) {
|
|||
|
||||
BASEMENTNODE toku_create_empty_bn(void) {
|
||||
BASEMENTNODE bn = toku_create_empty_bn_no_buffer();
|
||||
int r;
|
||||
r = toku_omt_create(&bn->buffer);
|
||||
assert_zero(r);
|
||||
int r = toku_omt_create(&bn->buffer);
|
||||
lazy_assert_zero(r);
|
||||
return bn;
|
||||
}
|
||||
|
||||
|
@ -1035,13 +1031,13 @@ struct mp_pair {
|
|||
};
|
||||
|
||||
static int fix_mp_offset(OMTVALUE v, u_int32_t i, void* extra) {
|
||||
struct mp_pair* p = (struct mp_pair *) extra;
|
||||
struct mp_pair *CAST_FROM_VOIDP(p, extra);
|
||||
char* old_value = (char *) v;
|
||||
char *new_value = old_value - (char *)p->orig_base + (char *)p->new_base;
|
||||
toku_omt_set_at(p->omt, (OMTVALUE) new_value, i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
BASEMENTNODE toku_clone_bn(BASEMENTNODE orig_bn) {
|
||||
BASEMENTNODE bn = toku_create_empty_bn_no_buffer();
|
||||
bn->max_msn_applied = orig_bn->max_msn_applied;
|
||||
|
@ -1078,19 +1074,19 @@ BASEMENTNODE toku_create_empty_bn_no_buffer(void) {
|
|||
NONLEAF_CHILDINFO toku_create_empty_nl(void) {
|
||||
NONLEAF_CHILDINFO XMALLOC(cn);
|
||||
int r = toku_fifo_create(&cn->buffer); assert_zero(r);
|
||||
r = toku_omt_create(&cn->fresh_message_tree); assert_zero(r);
|
||||
r = toku_omt_create(&cn->stale_message_tree); assert_zero(r);
|
||||
r = toku_omt_create(&cn->broadcast_list); assert_zero(r);
|
||||
cn->fresh_message_tree.init();
|
||||
cn->stale_message_tree.init();
|
||||
cn->broadcast_list.init();
|
||||
return cn;
|
||||
}
|
||||
|
||||
// does NOT create OMTs, just the FIFO
|
||||
NONLEAF_CHILDINFO toku_clone_nl(NONLEAF_CHILDINFO orig_childinfo) {
|
||||
NONLEAF_CHILDINFO XMALLOC(cn);
|
||||
cn->fresh_message_tree = NULL;
|
||||
cn->stale_message_tree = NULL;
|
||||
cn->broadcast_list = NULL;
|
||||
toku_fifo_clone(orig_childinfo->buffer, &cn->buffer);
|
||||
cn->fresh_message_tree.init_no_array();
|
||||
cn->stale_message_tree.init_no_array();
|
||||
cn->broadcast_list.init_no_array();
|
||||
return cn;
|
||||
}
|
||||
|
||||
|
@ -1106,9 +1102,9 @@ void destroy_basement_node (BASEMENTNODE bn)
|
|||
void destroy_nonleaf_childinfo (NONLEAF_CHILDINFO nl)
|
||||
{
|
||||
toku_fifo_free(&nl->buffer);
|
||||
if (nl->fresh_message_tree) toku_omt_destroy(&nl->fresh_message_tree);
|
||||
if (nl->stale_message_tree) toku_omt_destroy(&nl->stale_message_tree);
|
||||
if (nl->broadcast_list) toku_omt_destroy(&nl->broadcast_list);
|
||||
nl->fresh_message_tree.deinit();
|
||||
nl->stale_message_tree.deinit();
|
||||
nl->broadcast_list.deinit();
|
||||
toku_free(nl);
|
||||
}
|
||||
|
||||
|
@ -1455,18 +1451,18 @@ deserialize_ftnode_partition(
|
|||
// TODO 3988 Count empty basements (data_size == 0)
|
||||
if (data_size == 0) {
|
||||
// printf("#### Deserialize empty basement, childnum = %d\n", childnum);
|
||||
invariant_zero(num_entries);
|
||||
invariant_zero(num_entries);
|
||||
}
|
||||
OMTVALUE *XMALLOC_N(num_entries, array); // create array of pointers to leafentries
|
||||
BASEMENTNODE bn = BLB(node, childnum);
|
||||
toku_mempool_copy_construct(&bn->buffer_mempool, &rb.buf[rb.ndone], data_size);
|
||||
uint8_t * le_base = (uint8_t *) toku_mempool_get_base(&bn->buffer_mempool); // point to first le in mempool
|
||||
uint8_t *CAST_FROM_VOIDP(le_base, toku_mempool_get_base(&bn->buffer_mempool)); // point to first le in mempool
|
||||
for (u_int32_t i = 0; i < num_entries; i++) { // now set up the pointers in the omt
|
||||
LEAFENTRY le = (LEAFENTRY)&le_base[rb.ndone - start_of_data]; // point to durable mempool, not to transient rbuf
|
||||
u_int32_t disksize = leafentry_disksize(le);
|
||||
LEAFENTRY le = reinterpret_cast<LEAFENTRY>(&le_base[rb.ndone - start_of_data]); // point to durable mempool, not to transient rbuf
|
||||
uint32_t disksize = leafentry_disksize(le);
|
||||
rb.ndone += disksize;
|
||||
invariant(rb.ndone<=rb.size);
|
||||
array[i]=(OMTVALUE)le;
|
||||
array[i] = le;
|
||||
}
|
||||
u_int32_t end_of_data = rb.ndone;
|
||||
|
||||
|
@ -1794,8 +1790,8 @@ deserialize_and_upgrade_internal_node(FTNODE node,
|
|||
NONLEAF_CHILDINFO bnc = BNC(node, i);
|
||||
int n_in_this_buffer = rbuf_int(rb);
|
||||
|
||||
void **fresh_offsets = NULL;
|
||||
void **broadcast_offsets = NULL;
|
||||
long *fresh_offsets = NULL;
|
||||
long *broadcast_offsets = NULL;
|
||||
int nfresh = 0;
|
||||
int nbroadcast_offsets = 0;
|
||||
|
||||
|
@ -1829,10 +1825,10 @@ deserialize_and_upgrade_internal_node(FTNODE node,
|
|||
long *dest;
|
||||
if (bfe->h->compare_fun) {
|
||||
if (ft_msg_type_applies_once(type)) {
|
||||
dest = (long *) &fresh_offsets[nfresh];
|
||||
dest = &fresh_offsets[nfresh];
|
||||
nfresh++;
|
||||
} else if (ft_msg_type_applies_all(type) || ft_msg_type_does_nothing(type)) {
|
||||
dest = (long *) &broadcast_offsets[nbroadcast_offsets];
|
||||
dest = &broadcast_offsets[nbroadcast_offsets];
|
||||
nbroadcast_offsets++;
|
||||
} else {
|
||||
assert(false);
|
||||
|
@ -1862,24 +1858,13 @@ deserialize_and_upgrade_internal_node(FTNODE node,
|
|||
struct toku_fifo_entry_key_msn_cmp_extra extra = { .desc = &bfe->h->cmp_descriptor,
|
||||
.cmp = bfe->h->compare_fun,
|
||||
.fifo = bnc->buffer };
|
||||
r = mergesort_r(fresh_offsets,
|
||||
nfresh,
|
||||
sizeof fresh_offsets[0],
|
||||
&extra,
|
||||
toku_fifo_entry_key_msn_cmp);
|
||||
assert_zero(r);
|
||||
toku_omt_destroy(&bnc->fresh_message_tree);
|
||||
r = toku_omt_create_steal_sorted_array(&bnc->fresh_message_tree,
|
||||
&fresh_offsets,
|
||||
nfresh,
|
||||
n_in_this_buffer);
|
||||
assert_zero(r);
|
||||
toku_omt_destroy(&bnc->broadcast_list);
|
||||
r = toku_omt_create_steal_sorted_array(&bnc->broadcast_list,
|
||||
&broadcast_offsets,
|
||||
nbroadcast_offsets,
|
||||
n_in_this_buffer);
|
||||
typedef toku::sort<long, const struct toku_fifo_entry_key_msn_cmp_extra, toku_fifo_entry_key_msn_cmp> key_msn_sort;
|
||||
r = key_msn_sort::mergesort_r(fresh_offsets, nfresh, extra);
|
||||
assert_zero(r);
|
||||
bnc->fresh_message_tree.deinit();
|
||||
bnc->fresh_message_tree.init_steal_sorted_array(fresh_offsets, nfresh, n_in_this_buffer);
|
||||
bnc->broadcast_list.deinit();
|
||||
bnc->broadcast_list.init_steal_sorted_array(broadcast_offsets, nbroadcast_offsets, n_in_this_buffer);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1979,7 +1964,7 @@ deserialize_and_upgrade_leaf_node(FTNODE node,
|
|||
|
||||
// The current end of the buffer, read from disk and decompressed,
|
||||
// is the start of the leaf entries.
|
||||
u_int32_t start_of_data = rb->ndone;
|
||||
uint32_t start_of_data = rb->ndone;
|
||||
|
||||
// 13. Read the leaf entries from the buffer, advancing the buffer
|
||||
// as we go.
|
||||
|
@ -1990,8 +1975,8 @@ deserialize_and_upgrade_leaf_node(FTNODE node,
|
|||
struct mempool *mp = &BLB_BUFFER_MEMPOOL(node, 0);
|
||||
// Loop through
|
||||
for (int i = 0; i < n_in_buf; ++i) {
|
||||
LEAFENTRY_13 le = (LEAFENTRY_13)(&rb->buf[rb->ndone]);
|
||||
u_int32_t disksize = leafentry_disksize_13(le);
|
||||
LEAFENTRY_13 le = reinterpret_cast<LEAFENTRY_13>(&rb->buf[rb->ndone]);
|
||||
uint32_t disksize = leafentry_disksize_13(le);
|
||||
rb->ndone += disksize;
|
||||
invariant(rb->ndone<=rb->size);
|
||||
LEAFENTRY new_le;
|
||||
|
@ -2003,13 +1988,13 @@ deserialize_and_upgrade_leaf_node(FTNODE node,
|
|||
mp);
|
||||
assert_zero(r);
|
||||
// Copy the pointer value straight into the OMT
|
||||
r = toku_omt_insert_at(omt, (OMTVALUE) new_le, i);
|
||||
r = toku_omt_insert_at(omt, new_le, i);
|
||||
assert_zero(r);
|
||||
bn->n_bytes_in_buffer += new_le_size;
|
||||
}
|
||||
} else {
|
||||
u_int32_t end_of_data;
|
||||
u_int32_t data_size;
|
||||
uint32_t end_of_data;
|
||||
uint32_t data_size;
|
||||
|
||||
// Leaf Entry creation for version 14 and above:
|
||||
// Allocate space for our leaf entry pointers.
|
||||
|
@ -2018,11 +2003,11 @@ deserialize_and_upgrade_leaf_node(FTNODE node,
|
|||
// Iterate over leaf entries copying their addresses into our
|
||||
// temporary array.
|
||||
for (int i = 0; i < n_in_buf; ++i) {
|
||||
LEAFENTRY le = (LEAFENTRY)(&rb->buf[rb->ndone]);
|
||||
u_int32_t disksize = leafentry_disksize(le);
|
||||
LEAFENTRY le = reinterpret_cast<LEAFENTRY>(&rb->buf[rb->ndone]);
|
||||
uint32_t disksize = leafentry_disksize(le);
|
||||
rb->ndone += disksize;
|
||||
invariant(rb->ndone <= rb->size);
|
||||
array[i] = (OMTVALUE) le;
|
||||
array[i] = le;
|
||||
}
|
||||
|
||||
end_of_data = rb->ndone;
|
||||
|
@ -2049,10 +2034,7 @@ deserialize_and_upgrade_leaf_node(FTNODE node,
|
|||
|
||||
toku_omt_destroy(&BLB_BUFFER(node, 0));
|
||||
// Construct the omt.
|
||||
r = toku_omt_create_steal_sorted_array(&BLB_BUFFER(node, 0),
|
||||
&array,
|
||||
n_in_buf,
|
||||
n_in_buf);
|
||||
r = toku_omt_create_steal_sorted_array(&BLB_BUFFER(node, 0), &array, n_in_buf, n_in_buf);
|
||||
invariant_zero(r);
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
/* Tell me the diff between two brt files. */
|
||||
|
@ -117,7 +117,7 @@ dump_header (int f, FT *header, CACHEFILE cf) {
|
|||
|
||||
static int
|
||||
print_le (OMTVALUE lev, u_int32_t UU(idx), void *UU(v)) {
|
||||
LEAFENTRY le = cast_to_typeof(le) lev;
|
||||
LEAFENTRY CAST_FROM_VOIDP(le, lev);
|
||||
print_leafentry(stdout, le);
|
||||
printf("\n");
|
||||
return 0;
|
||||
|
@ -229,7 +229,7 @@ typedef struct {
|
|||
|
||||
static int
|
||||
fragmentation_helper(BLOCKNUM b, int64_t size, int64_t UU(address), void *extra) {
|
||||
frag_help_extra *info = cast_to_typeof(info) extra;
|
||||
frag_help_extra *CAST_FROM_VOIDP(info, extra);
|
||||
FTNODE n;
|
||||
FTNODE_DISK_DATA ndd = NULL;
|
||||
struct ftnode_fetch_extra bfe;
|
||||
|
@ -278,8 +278,8 @@ typedef struct {
|
|||
|
||||
static int
|
||||
garbage_leafentry_helper(OMTVALUE v, u_int32_t UU(idx), void *extra) {
|
||||
garbage_help_extra *info = cast_to_typeof(info) extra;
|
||||
LEAFENTRY le = cast_to_typeof(le) v;
|
||||
garbage_help_extra *CAST_FROM_VOIDP(info, extra);
|
||||
LEAFENTRY CAST_FROM_VOIDP(le, v);
|
||||
info->total_space += leafentry_disksize(le);
|
||||
info->used_space += LE_CLEAN_MEMSIZE(le_latest_keylen(le), le_latest_vallen(le));
|
||||
return 0;
|
||||
|
@ -287,7 +287,7 @@ garbage_leafentry_helper(OMTVALUE v, u_int32_t UU(idx), void *extra) {
|
|||
|
||||
static int
|
||||
garbage_helper(BLOCKNUM b, int64_t UU(size), int64_t UU(address), void *extra) {
|
||||
garbage_help_extra *info = cast_to_typeof(info) extra;
|
||||
garbage_help_extra *CAST_FROM_VOIDP(info, extra);
|
||||
FTNODE n;
|
||||
FTNODE_DISK_DATA ndd = NULL;
|
||||
struct ftnode_fetch_extra bfe;
|
||||
|
@ -394,7 +394,7 @@ dump_block(int f, BLOCKNUM blocknum, FT h) {
|
|||
toku_translate_blocknum_to_offset_size(h->blocktable, blocknum, &offset, &size);
|
||||
printf("%" PRId64 " at %" PRId64 " size %" PRId64 "\n", blocknum.b, offset, size);
|
||||
|
||||
unsigned char *vp = cast_to_typeof(vp) toku_malloc(size);
|
||||
unsigned char *CAST_FROM_VOIDP(vp, toku_malloc(size));
|
||||
u_int64_t r = pread(f, vp, size, offset);
|
||||
if (r == (u_int64_t)size) {
|
||||
verify_block(vp, offset, size);
|
||||
|
@ -459,7 +459,7 @@ typedef struct __dump_node_extra {
|
|||
|
||||
static int
|
||||
dump_node_wrapper(BLOCKNUM b, int64_t UU(size), int64_t UU(address), void *extra) {
|
||||
dump_node_extra *info = cast_to_typeof(info) extra;
|
||||
dump_node_extra *CAST_FROM_VOIDP(info, extra);
|
||||
dump_node(info->f, b, info->h);
|
||||
return 0;
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <toku_portability.h>
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef FTLOADER_INTERNAL_H
|
||||
#define FTLOADER_INTERNAL_H
|
||||
#ident "$Id$"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <toku_portability.h>
|
|
@ -1,10 +1,10 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef FTLOADER_H
|
||||
#define FTLOADER_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
// The loader callbacks are C functions and need to be defined as such
|
||||
|
|
14
ft/fttypes.h
14
ft/fttypes.h
|
@ -1,10 +1,10 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef FTTYPES_H
|
||||
#define FTTYPES_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -17,9 +17,6 @@
|
|||
#include <db.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdbool.h>
|
||||
#ifndef TRUE
|
||||
|
@ -78,7 +75,7 @@ typedef struct pair_attr_s {
|
|||
} PAIR_ATTR;
|
||||
|
||||
static inline PAIR_ATTR make_pair_attr(long size) {
|
||||
#if !defined(__cplusplus)
|
||||
#if 1 || (!defined(__cplusplus) && !defined(__cilkplusplus))
|
||||
PAIR_ATTR result={
|
||||
.size = size,
|
||||
.nonleaf_size = 0,
|
||||
|
@ -289,9 +286,6 @@ enum reactivity {
|
|||
RE_FISSIBLE
|
||||
};
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4 -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id: ftverify.c 43686 2012-05-18 23:21:00Z leifwalsh $"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -192,7 +192,7 @@ check_block(BLOCKNUM blocknum, int64_t UU(blocksize), int64_t UU(address), void
|
|||
{
|
||||
int r = 0;
|
||||
int failure = 0;
|
||||
struct check_block_table_extra *cbte = cast_to_typeof(cbte) extra;
|
||||
struct check_block_table_extra *CAST_FROM_VOIDP(cbte, extra);
|
||||
int fd = cbte->fd;
|
||||
FT ft = cbte->h;
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
/* Benchmark various hash functions. */
|
||||
|
||||
#include <sys/time.h>
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
/* Benchmark various hash functions. */
|
||||
|
||||
#include <sys/time.h>
|
13
ft/hashfun.h
13
ft/hashfun.h
|
@ -1,16 +1,12 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef TOKU_HASHFUN_H
|
||||
#define TOKU_HASHFUN_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
// FNV Hash: From an idea sent by Glenn Fowler and Phong Vo to the IEEE POSIX 1003.2 committee. Landon Curt Noll improved it.
|
||||
// See: http://isthe.com/chongo/tech/comp/fnv/
|
||||
|
@ -48,8 +44,5 @@ static unsigned int hash_key (const char *key, ITEMLEN keylen) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
// Clip horizontally (100 chars by default)
|
|
@ -1,10 +1,10 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef SYSINCLUDES_H
|
||||
#define SYSINCLUDES_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <config.h>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "includes.h"
|
||||
|
@ -74,7 +74,7 @@ int toku_keycompare (bytevec key1, ITEMLEN key1len, bytevec key2, ITEMLEN key2le
|
|||
int comparelen = key1len<key2len ? key1len : key2len;
|
||||
const unsigned char *k1;
|
||||
const unsigned char *k2;
|
||||
for (k1 = cast_to_typeof(k1) key1, k2 = cast_to_typeof(k2) key2;
|
||||
for (CAST_FROM_VOIDP(k1, key1), CAST_FROM_VOIDP(k2, key2);
|
||||
comparelen>4;
|
||||
k1+=4, k2+=4, comparelen-=4) {
|
||||
{ int v1=k1[0], v2=k2[0]; if (v1!=v2) return v1-v2; }
|
12
ft/key.h
12
ft/key.h
|
@ -1,18 +1,15 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef TOKU_KEY_H
|
||||
#define TOKU_KEY_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "ybt.h"
|
||||
#include "fttypes.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int toku_keycompare (bytevec key1, ITEMLEN key1len, bytevec key2, ITEMLEN key2len);
|
||||
void toku_test_keycompare (void) ;
|
||||
|
@ -20,9 +17,6 @@ void toku_test_keycompare (void) ;
|
|||
int toku_builtin_compare_fun (DB *, const DBT *, const DBT*) __attribute__((__visibility__("default")));
|
||||
int toku_dont_call_this_compare_fun (DB *, const DBT *, const DBT*);
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2011 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
@ -72,7 +72,7 @@ static void ksignal (KIBBUTZ k) {
|
|||
// to avoid deadlocks in flusher threads.
|
||||
//
|
||||
static void *work_on_kibbutz (void *kidv) {
|
||||
struct kid *kid = cast_to_typeof(kid) kidv;
|
||||
struct kid *CAST_FROM_VOIDP(kid, kidv);
|
||||
KIBBUTZ k = kid->k;
|
||||
klock(k);
|
||||
while (1) {
|
|
@ -1,9 +1,9 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef KIBBUTZ_H
|
||||
#define KIBBUTZ_H
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
//
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2010 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
|
@ -1,5 +1,5 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2010 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "includes.h"
|
|
@ -1,9 +1,9 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef LEAFENTRY_H
|
||||
#define LEAFENTRY_H
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
|
||||
|
@ -16,9 +16,6 @@
|
|||
#include "x1764.h"
|
||||
#include "mempool.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
Memory format of packed nodup leaf entry
|
||||
|
@ -176,9 +173,6 @@ toku_le_upgrade_13_14(LEAFENTRY_13 old_leafentry, // NULL if there was no stored
|
|||
struct mempool *mp);
|
||||
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
12
ft/lock.h
12
ft/lock.h
|
@ -1,15 +1,12 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef TOKU_LOCK_H
|
||||
#define TOKU_LOCK_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(__x86_64) || defined(__i386)
|
||||
|
||||
|
@ -66,9 +63,6 @@ static inline void spin_unlock (SPINLOCK v) {
|
|||
#error Need to define architecture-specific stuff for other machines.
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
/* Time {m,l,s}fence vs.xchgl for a memory barrier. */
|
||||
|
||||
/* Timing numbers:
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
/* Test pthread rwlocks in multiprocess environment. */
|
||||
|
||||
/* How expensive is
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
/* How expensive is
|
||||
* - Obtaining a read-only lock for the first obtainer.
|
||||
* - Obtaining it for the second one?
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
/* Like trylock, except use rdstc */
|
||||
#define _MULTI_THREADED
|
||||
#include <pthread.h>
|
|
@ -1,5 +1,8 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
#define _MULTI_THREADED
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
|
@ -1,10 +1,10 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef LOG_INTERNAL_H
|
||||
#define LOG_INTERNAL_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "ft-internal.h"
|
||||
|
@ -21,10 +21,6 @@
|
|||
#include <dirent.h>
|
||||
#include "txn_manager.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// Locking for the logger
|
||||
// For most purposes we use the big ydb lock.
|
||||
// To log: grab the buf lock
|
||||
|
@ -149,7 +145,7 @@ struct tokutxn {
|
|||
// These don't either but they're created in a way that's hard to make
|
||||
// strictly const.
|
||||
DB_TXN *container_db_txn; // reference to DB_TXN that contains this tokutxn
|
||||
OMT live_root_txn_list; // the root txns live when the root ancestor (self if a root) started.
|
||||
xid_omt_t *live_root_txn_list; // the root txns live when the root ancestor (self if a root) started.
|
||||
XIDS xids; // Represents the xid list
|
||||
|
||||
bool begin_was_logged;
|
||||
|
@ -261,9 +257,4 @@ static inline char *fixup_fname(BYTESTRING *f) {
|
|||
return fname;
|
||||
}
|
||||
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
14
ft/log.h
14
ft/log.h
|
@ -1,10 +1,10 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef TOKU_LOGGGER_H
|
||||
#define TOKU_LOGGGER_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <toku_portability.h>
|
||||
|
@ -15,10 +15,6 @@
|
|||
#include "memory.h"
|
||||
#include "x1764.h"
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct roll_entry;
|
||||
|
||||
#include "logger.h"
|
||||
|
@ -50,8 +46,4 @@ int toku_maybe_upgrade_log (const char *env_dir, const char *log_dir, LSN * lsn_
|
|||
uint64_t toku_log_upgrade_get_footprint(void);
|
||||
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "includes.h"
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "includes.h"
|
|
@ -1,17 +1,14 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef TOKULOGCURSOR_H
|
||||
#define TOKULOGCURSOR_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <ft/log_header.h>
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct toku_logcursor;
|
||||
typedef struct toku_logcursor *TOKULOGCURSOR;
|
||||
|
@ -46,8 +43,5 @@ int toku_logcursor_log_exists(const TOKULOGCURSOR lc);
|
|||
|
||||
void toku_logcursor_print(TOKULOGCURSOR lc);
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // TOKULOGCURSOR_H
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "includes.h"
|
|
@ -1,17 +1,14 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ifndef TOKULOGFILEMGR_H
|
||||
#define TOKULOGFILEMGR_H
|
||||
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2010 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include <ft/log_header.h>
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// this is the basic information we need to keep per logfile
|
||||
struct toku_logfile_info {
|
||||
|
@ -37,8 +34,5 @@ void toku_logfilemgr_update_last_lsn(TOKULOGFILEMGR lfm, LSN lsn);
|
|||
|
||||
void toku_logfilemgr_print(TOKULOGFILEMGR lfm);
|
||||
|
||||
#if defined(__cplusplus) || defined(__cilkplusplus)
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif //TOKULOGFILEMGR_H
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
/* This file defines the logformat in an executable fashion.
|
||||
|
@ -650,7 +650,7 @@ generate_rollbacks (void) {
|
|||
}
|
||||
fprintf(cf, " struct roll_entry *v;\n");
|
||||
fprintf(cf, " size_t mem_needed = sizeof(v->u.%s) + __builtin_offsetof(struct roll_entry, u.%s);\n", lt->name, lt->name);
|
||||
fprintf(cf, " v = cast_to_typeof(v) toku_malloc_in_rollback(log, mem_needed);\n");
|
||||
fprintf(cf, " CAST_FROM_VOIDP(v, toku_malloc_in_rollback(log, mem_needed));\n");
|
||||
fprintf(cf, " assert(v);\n");
|
||||
fprintf(cf, " v->cmd = (enum rt_cmd)%u;\n", lt->command_and_flags&0xff);
|
||||
DO_FIELDS(field_type, lt, fprintf(cf, " v->u.%s.%s = %s;\n", lt->name, field_type->name, field_type->name));
|
||||
|
@ -728,7 +728,7 @@ generate_rollbacks (void) {
|
|||
DO_ROLLBACKS(lt, {
|
||||
fprintf(cf, " case RT_%s:\n", lt->name);
|
||||
fprintf(cf, " mem_needed = sizeof(item->u.%s) + __builtin_offsetof(struct roll_entry, u.%s);\n", lt->name, lt->name);
|
||||
fprintf(cf, " item = cast_to_typeof(item) malloc_in_memarena(ma, mem_needed);\n");
|
||||
fprintf(cf, " CAST_FROM_VOIDP(item, malloc_in_memarena(ma, mem_needed));\n");
|
||||
fprintf(cf, " item->cmd = cmd;\n");
|
||||
DO_FIELDS(field_type, lt, fprintf(cf, " rbuf_ma_%s(&rc, ma, &item->u.%s.%s);\n", field_type->type, lt->name, field_type->name));
|
||||
fprintf(cf, " *itemp = item;\n");
|
||||
|
@ -745,8 +745,8 @@ generate_log_entry_functions(void) {
|
|||
fprintf(cf, "}\n");
|
||||
}
|
||||
|
||||
const char codefile[] = "log_code.c";
|
||||
const char printfile[] = "log_print.c";
|
||||
const char codefile[] = "log_code.cc";
|
||||
const char printfile[] = "log_print.cc";
|
||||
const char headerfile[] = "log_header.h";
|
||||
int main (int argc, const char *const argv[]) {
|
||||
assert(argc==2); // the single argument is the directory into which to put things
|
||||
|
@ -769,16 +769,15 @@ int main (int argc, const char *const argv[]) {
|
|||
assert(cf!=0);
|
||||
hf = fopen(headerpath, "w"); assert(hf!=0);
|
||||
pf = fopen(printpath, "w"); assert(pf!=0);
|
||||
fprintf2(cf, hf, "/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n");
|
||||
fprintf2(cf, hf, "// vim: expandtab:ts=8:sw=4:softtabstop=4:\n");
|
||||
fprintf2(cf, hf, "/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */\n");
|
||||
fprintf2(cf, hf, "// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:\n");
|
||||
fprintf(hf, "#ifndef LOG_HEADER_H\n");
|
||||
fprintf(hf, "#define LOG_HEADER_H\n");
|
||||
fprintf2(cf, hf, "/* Do not edit this file. This code generated by logformat.c. Copyright 2007-2010 Tokutek. */\n");
|
||||
fprintf2(cf, hf, "#ident \"Copyright (c) 2007-2010 Tokutek Inc. All rights reserved.\"\n");
|
||||
fprintf2(cf, hf, "/* Do not edit this file. This code generated by logformat.c. Copyright 2007-2012 Tokutek. */\n");
|
||||
fprintf2(cf, hf, "#ident \"Copyright (c) 2007-2012 Tokutek Inc. All rights reserved.\"\n");
|
||||
fprintf2(cf, pf, "#include <ft/includes.h>\n");
|
||||
fprintf(hf, "#include <ft/ft-internal.h>\n");
|
||||
fprintf(hf, "#include <ft/memarena.h>\n");
|
||||
fprintf(hf, "#if defined(__cplusplus)\nextern \"C\" {\n#endif\n");
|
||||
generate_enum();
|
||||
generate_log_struct();
|
||||
generate_dispatch();
|
||||
|
@ -787,7 +786,6 @@ int main (int argc, const char *const argv[]) {
|
|||
generate_rollbacks();
|
||||
generate_log_entry_functions();
|
||||
generate_logprint();
|
||||
fprintf(hf, "#if defined(__cplusplus)\n};\n#endif\n");
|
||||
fprintf(hf, "#endif\n");
|
||||
{
|
||||
int r=fclose(hf); assert(r==0);
|
|
@ -1,7 +1,7 @@
|
|||
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: expandtab:ts=8:sw=4:softtabstop=4:
|
||||
/* -*- mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
|
||||
// vim: ft=cpp:expandtab:ts=8:sw=4:softtabstop=4:
|
||||
#ident "$Id$"
|
||||
#ident "Copyright (c) 2007-2011 Tokutek Inc. All rights reserved."
|
||||
#ident "Copyright (c) 2007-2012 Tokutek Inc. All rights reserved."
|
||||
#ident "The technology is licensed by the Massachusetts Institute of Technology, Rutgers State University of New Jersey, and the Research Foundation of State University of New York at Stony Brook under United States of America Serial No. 11/760379 and to the patents and/or patent applications resulting from it."
|
||||
|
||||
#include "includes.h"
|
||||
|
@ -214,7 +214,7 @@ toku_logger_close_rollback(TOKULOGGER logger, BOOL recovery_failed) {
|
|||
if (!logger->is_panicked && cf) {
|
||||
FT_HANDLE ft_to_close;
|
||||
{ //Find "brt"
|
||||
FT ft = cast_to_typeof(ft) toku_cachefile_get_userdata(cf);
|
||||
FT CAST_FROM_VOIDP(ft, toku_cachefile_get_userdata(cf));
|
||||
if (!ft->panic && recovery_failed) {
|
||||
r = toku_ft_set_panic(ft, EINVAL, "Recovery failed");
|
||||
assert_zero(r);
|
||||
|
@ -1282,7 +1282,7 @@ int toku_logger_log_archive (TOKULOGGER logger, char ***logs_p, int flags) {
|
|||
if (i==0) {
|
||||
result=0;
|
||||
} else {
|
||||
result = cast_to_typeof(result) toku_xmalloc((1+n_to_archive)*sizeof(*result) + count_bytes);
|
||||
CAST_FROM_VOIDP(result, toku_xmalloc((1+n_to_archive)*sizeof(*result) + count_bytes));
|
||||
char *base = (char*)(result+1+n_to_archive);
|
||||
for (i=0; i<n_to_archive; i++) {
|
||||
int len=1+strlen(all_logs[i]);
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue