Compare commits
6 Commits
main
...
2.6.fb.bra
Author | SHA1 | Date | |
---|---|---|---|
|
0c5d4f05ac | ||
|
553274217d | ||
|
3dc6a33b2b | ||
|
4ec2fc42cd | ||
|
2b079d1292 | ||
|
16e206cbaf |
4
Makefile
4
Makefile
@ -18,7 +18,7 @@ $(shell (export ROCKSDB_ROOT=$(CURDIR); $(CURDIR)/build_tools/build_detect_platf
|
|||||||
# this file is generated by the previous line to set build flags and sources
|
# this file is generated by the previous line to set build flags and sources
|
||||||
include build_config.mk
|
include build_config.mk
|
||||||
|
|
||||||
WARNING_FLAGS = -Wall -Werror
|
WARNING_FLAGS = -Wall -Wmaybe-uninitialized
|
||||||
CFLAGS += -g $(WARNING_FLAGS) -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
|
CFLAGS += -g $(WARNING_FLAGS) -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
|
||||||
CXXFLAGS += -g $(WARNING_FLAGS) -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -std=gnu++0x -Woverloaded-virtual
|
CXXFLAGS += -g $(WARNING_FLAGS) -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -std=gnu++0x -Woverloaded-virtual
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ all: $(LIBRARY) $(PROGRAMS)
|
|||||||
|
|
||||||
release:
|
release:
|
||||||
$(MAKE) clean
|
$(MAKE) clean
|
||||||
OPT=-DNDEBUG $(MAKE) -j32
|
OPT=-DNDEBUG $(MAKE) $(LIBRARY) $(TOOLS) db_bench -j32
|
||||||
|
|
||||||
coverage:
|
coverage:
|
||||||
$(MAKE) clean
|
$(MAKE) clean
|
||||||
|
@ -30,11 +30,7 @@ fi
|
|||||||
|
|
||||||
# Default to fbcode gcc on internal fb machines
|
# Default to fbcode gcc on internal fb machines
|
||||||
if [ -d /mnt/gvfs/third-party -a -z "$CXX" ]; then
|
if [ -d /mnt/gvfs/third-party -a -z "$CXX" ]; then
|
||||||
if [ -z "$USE_CLANG" ]; then
|
source "$PWD/build_tools/fbcode_config.sh"
|
||||||
source $PWD/build_tools/fbcode.gcc471.sh
|
|
||||||
else
|
|
||||||
source $PWD/build_tools/fbcode.clang31.sh
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Delete existing output, if it exists
|
# Delete existing output, if it exists
|
||||||
@ -183,7 +179,7 @@ EOF
|
|||||||
int main() {}
|
int main() {}
|
||||||
EOF
|
EOF
|
||||||
if [ "$?" = 0 ]; then
|
if [ "$?" = 0 ]; then
|
||||||
COMMON_FLAGS="$COMMON_FLAGS -DGFLAGS"
|
COMMON_FLAGS="$COMMON_FLAGS -DGFLAGS=gflags"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test whether zlib library is installed
|
# Test whether zlib library is installed
|
||||||
|
19
build_tools/dependencies.sh
Normal file
19
build_tools/dependencies.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||||
|
GCC_BASE=/mnt/gvfs/third-party2/gcc/7331085db891a2ef4a88a48a751d834e8d68f4cb/7.x/centos7-native/b2ef2b6
|
||||||
|
CLANG_BASE=/mnt/gvfs/third-party2/llvm-fb/963d9aeda70cc4779885b1277484fe7544a04e3e/9.0.0/platform007/9e92d53/
|
||||||
|
LIBGCC_BASE=/mnt/gvfs/third-party2/libgcc/6ace84e956873d53638c738b6f65f3f469cca74c/7.x/platform007/5620abc
|
||||||
|
GLIBC_BASE=/mnt/gvfs/third-party2/glibc/192b0f42d63dcf6210d6ceae387b49af049e6e0c/2.26/platform007/f259413
|
||||||
|
SNAPPY_BASE=/mnt/gvfs/third-party2/snappy/7f9bdaada18f59bc27ec2b0871eb8a6144343aef/1.1.3/platform007/ca4da3d
|
||||||
|
ZLIB_BASE=/mnt/gvfs/third-party2/zlib/2d9f0b9a4274cc21f61272a9e89bdb859bce8f1f/1.2.8/platform007/ca4da3d
|
||||||
|
BZIP2_BASE=/mnt/gvfs/third-party2/bzip2/dc49a21c5fceec6456a7a28a94dcd16690af1337/1.0.6/platform007/ca4da3d
|
||||||
|
LZ4_BASE=/mnt/gvfs/third-party2/lz4/0f607f8fc442ea7d6b876931b1898bb573d5e5da/1.9.1/platform007/ca4da3d
|
||||||
|
ZSTD_BASE=/mnt/gvfs/third-party2/zstd/ca22bc441a4eb709e9e0b1f9fec9750fed7b31c5/1.4.x/platform007/15a3614
|
||||||
|
GFLAGS_BASE=/mnt/gvfs/third-party2/gflags/0b9929d2588991c65a57168bf88aff2db87c5d48/2.2.0/platform007/ca4da3d
|
||||||
|
JEMALLOC_BASE=/mnt/gvfs/third-party2/jemalloc/c26f08f47ac35fc31da2633b7da92d6b863246eb/master/platform007/c26c002
|
||||||
|
NUMA_BASE=/mnt/gvfs/third-party2/numa/3f3fb57a5ccc5fd21c66416c0b83e0aa76a05376/2.0.11/platform007/ca4da3d
|
||||||
|
LIBUNWIND_BASE=/mnt/gvfs/third-party2/libunwind/40c73d874898b386a71847f1b99115d93822d11f/1.4/platform007/6f3e0a9
|
||||||
|
TBB_BASE=/mnt/gvfs/third-party2/tbb/4ce8e8dba77cdbd81b75d6f0c32fd7a1b76a11ec/2018_U5/platform007/ca4da3d
|
||||||
|
KERNEL_HEADERS_BASE=/mnt/gvfs/third-party2/kernel-headers/fb251ecd2f5ae16f8671f7014c246e52a748fe0b/fb/platform007/da39a3e
|
||||||
|
BINUTILS_BASE=/mnt/gvfs/third-party2/binutils/ab9f09bba370e7066cafd4eb59752db93f2e8312/2.29.1/platform007/15a3614
|
||||||
|
VALGRIND_BASE=/mnt/gvfs/third-party2/valgrind/d42d152a15636529b0861ec493927200ebebca8e/3.15.0/platform007/ca4da3d
|
||||||
|
LUA_BASE=/mnt/gvfs/third-party2/lua/f0cd714433206d5139df61659eb7b28b1dea6683/5.3.4/platform007/5007832
|
78
build_tools/fbcode.gcc481.sh
Normal file
78
build_tools/fbcode.gcc481.sh
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Set environment variables so that we can compile rocksdb using
|
||||||
|
# fbcode settings. It uses the latest g++ compiler and also
|
||||||
|
# uses jemalloc
|
||||||
|
|
||||||
|
GCC_BASE=/mnt/gvfs/third-party2/gcc/8219ec1bcedf8ad9da05e121e193364de2cc4f61/5.x/centos6-native/c447969
|
||||||
|
CLANG_BASE=/mnt/gvfs/third-party2/llvm-fb/64d8d58e3d84f8bde7a029763d4f5baf39d0d5b9/stable/centos6-native/6aaf4de
|
||||||
|
LIBGCC_BASE=/mnt/gvfs/third-party2/libgcc/ba9be983c81de7299b59fe71950c664a84dcb5f8/5.x/gcc-5-glibc-2.23/339d858
|
||||||
|
GLIBC_BASE=/mnt/gvfs/third-party2/glibc/f20197cf3d4bd50339c9777aaa0b2ccadad9e2cb/2.23/gcc-5-glibc-2.23/ca1d1c0
|
||||||
|
SNAPPY_BASE=/mnt/gvfs/third-party2/snappy/6427ce8c7496e4ab06c2da81543b94c0de8be3d0/1.1.3/gcc-5-glibc-2.23/9bc6787
|
||||||
|
ZLIB_BASE=/mnt/gvfs/third-party2/zlib/8f1e8b867d26efef93eac2fabbdb2e1d512665d7/1.2.8/gcc-5-glibc-2.23/9bc6787
|
||||||
|
BZIP2_BASE=/mnt/gvfs/third-party2/bzip2/70471c0571559fe0af7db6d7e8860b93a7eadfe1/1.0.6/gcc-5-glibc-2.23/9bc6787
|
||||||
|
LZ4_BASE=/mnt/gvfs/third-party2/lz4/453c89d6f0e68cdf1c151c769197fabedad9cac8/r131/gcc-5-glibc-2.23/9bc6787
|
||||||
|
ZSTD_BASE=/mnt/gvfs/third-party2/zstd/00a40fa5f8bd2cd0622f2e868552793aef37ccf4/1.3.0/gcc-5-glibc-2.23/03859b5
|
||||||
|
GFLAGS_BASE=/mnt/gvfs/third-party2/gflags/47eef08f9acb77de982fbda6047c26d330739538/2.2.0/gcc-5-glibc-2.23/9bc6787
|
||||||
|
JEMALLOC_BASE=/mnt/gvfs/third-party2/jemalloc/4414ddc78df8008b35cc4adac23590ad29148584/master/gcc-5-glibc-2.23/d506c82
|
||||||
|
NUMA_BASE=/mnt/gvfs/third-party2/numa/9d7ae2693d05d62f9a579cb21e6b717cf257a75d/2.0.11/gcc-5-glibc-2.23/9bc6787
|
||||||
|
LIBUNWIND_BASE=/mnt/gvfs/third-party2/libunwind/2b2dd58e3a52ccf2c1d827def59e5f740de0ad15/1.2/gcc-5-glibc-2.23/b443de1
|
||||||
|
TBB_BASE=/mnt/gvfs/third-party2/tbb/379addf7ab2468a2b4293b47456cfcd1c9cb318d/4.3/gcc-5-glibc-2.23/9bc6787
|
||||||
|
KERNEL_HEADERS_BASE=/mnt/gvfs/third-party2/kernel-headers/3f68f5fe65a85b7c2d3e66852268fbd1efdb3151/4.0.9-36_fbk5_2933_gd092e3f/gcc-5-glibc-2.23/da39a3e
|
||||||
|
BINUTILS_BASE=/mnt/gvfs/third-party2/binutils/b9fab0aec99d9c36408e810b2677e91c12807afd/2.28/centos6-native/da39a3e
|
||||||
|
VALGRIND_BASE=/mnt/gvfs/third-party2/valgrind/423431d61786b20bcc3bde8972901130cb29e6b3/3.11.0/gcc-5-glibc-2.23/9bc6787
|
||||||
|
LUA_BASE=/mnt/gvfs/third-party2/lua/3b0bb3bd9a0f690a069c479fcc0f7424fc7456d2/5.2.3/gcc-5-glibc-2.23/65372bd
|
||||||
|
|
||||||
|
|
||||||
|
# location of libgcc
|
||||||
|
LIBGCC_INCLUDE=" -I $LIBGCC_BASE/include"
|
||||||
|
LIBGCC_LIBS=" -L $LIBGCC_BASE/lib"
|
||||||
|
|
||||||
|
# location of glibc
|
||||||
|
GLIBC_INCLUDE=" -I $GLIBC_BASE/include"
|
||||||
|
GLIBC_LIBS=" -L $GLIBC_BASE/lib"
|
||||||
|
|
||||||
|
# location of snappy headers and libraries
|
||||||
|
SNAPPY_INCLUDE=" -I $SNAPPY_BASE/include/"
|
||||||
|
SNAPPY_LIBS=" $SNAPPY_BASE/lib/libsnappy.a"
|
||||||
|
|
||||||
|
# location of zlib headers and libraries
|
||||||
|
ZLIB_INCLUDE=" -I $ZLIB_BASE/include/"
|
||||||
|
ZLIB_LIBS=" $ZLIB_BASE/lib/libz.a"
|
||||||
|
|
||||||
|
LZ4_INCLUDE=" -I $LZ4_BASE/include/"
|
||||||
|
LZ4_LIBS=" $LZ4_BASE/lib/liblz4.a"
|
||||||
|
|
||||||
|
# location of gflags headers and libraries
|
||||||
|
GFLAGS_INCLUDE=" -I $GFLAGS_BASE/include/"
|
||||||
|
GFLAGS_LIBS=" $GFLAGS_BASE/lib/libgflags.a"
|
||||||
|
|
||||||
|
# location of jemalloc
|
||||||
|
JEMALLOC_INCLUDE=" -I $JEMALLOC_BASE/include/"
|
||||||
|
JEMALLOC_LIB=" -Wl,--whole-archive $JEMALLOC_BASE/lib/libjemalloc.a"
|
||||||
|
|
||||||
|
# use Intel SSE support for checksum calculations
|
||||||
|
export USE_SSE=" -msse -msse4.2 "
|
||||||
|
|
||||||
|
CC="$GCC_BASE/bin/gcc"
|
||||||
|
CXX="$GCC_BASE/bin/g++ $JINCLUDE $SNAPPY_INCLUDE $ZLIB_INCLUDE $BZIP_INCLUDE $LZ4_INCLUDE $GFLAGS_INCLUDE"
|
||||||
|
AR="$BINUTILS_BASE/bin/ar"
|
||||||
|
RANLIB="$BINUTILS_BASE/bin/ranlib"
|
||||||
|
|
||||||
|
CFLAGS="-B$BINUTILS/bin/gold -m64 -mtune=generic"
|
||||||
|
CFLAGS+=" $LIBGCC_INCLUDE $GLIBC_INCLUDE"
|
||||||
|
CFLAGS+=" -DROCKSDB_PLATFORM_POSIX -DROCKSDB_ATOMIC_PRESENT -DROCKSDB_FALLOCATE_PRESENT"
|
||||||
|
CFLAGS+=" -DSNAPPY -DZLIB -DLZ4"
|
||||||
|
|
||||||
|
EXEC_LDFLAGS+=" -B$BINUTILS_BASE/bin/gold"
|
||||||
|
EXEC_LDFLAGS+=" -Wl,--dynamic-linker,/usr/local/fbcode/gcc-5-glibc-2.23/lib/ld.so"
|
||||||
|
EXEC_LDFLAGS+=" $LIBUNWIND"
|
||||||
|
EXEC_LDFLAGS+=" -Wl,-rpath=/usr/local/fbcode/gcc-5-glibc-2.23/lib"
|
||||||
|
|
||||||
|
PLATFORM_LDFLAGS="$LIBGCC_LIBS $GLIBC_LIBS "
|
||||||
|
|
||||||
|
EXEC_LDFLAGS_SHARED="$SNAPPY_LIBS $ZLIB_LIBS $LZ4_LIBS $GFLAGS_LIBS"
|
||||||
|
|
||||||
|
VALGRIND_VER="$VALGRIND_BASE/bin/"
|
||||||
|
|
||||||
|
export CC CXX AR RANLIB CFLAGS EXEC_LDFLAGS EXEC_LDFLAGS_SHARED VALGRIND_VER JEMALLOC_LIB JEMALLOC_INCLUDE
|
118
build_tools/fbcode_config.sh
Normal file
118
build_tools/fbcode_config.sh
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Set environment variables so that we can compile rocksdb using
|
||||||
|
# fbcode settings. It uses the latest g++ and clang compilers and also
|
||||||
|
# uses jemalloc
|
||||||
|
# Environment variables that change the behavior of this script:
|
||||||
|
# PIC_BUILD -- if true, it will only take pic versions of libraries from fbcode. libraries that don't have pic variant will not be included
|
||||||
|
|
||||||
|
|
||||||
|
BASEDIR=`dirname $BASH_SOURCE`
|
||||||
|
source "$BASEDIR/dependencies.sh"
|
||||||
|
|
||||||
|
CFLAGS=""
|
||||||
|
|
||||||
|
# libgcc
|
||||||
|
LIBGCC_INCLUDE="$LIBGCC_BASE/include/c++/7.3.0"
|
||||||
|
LIBGCC_LIBS=" -L $LIBGCC_BASE/lib"
|
||||||
|
|
||||||
|
# glibc
|
||||||
|
GLIBC_INCLUDE="$GLIBC_BASE/include"
|
||||||
|
GLIBC_LIBS=" -L $GLIBC_BASE/lib"
|
||||||
|
|
||||||
|
# snappy
|
||||||
|
SNAPPY_INCLUDE=" -I $SNAPPY_BASE/include/"
|
||||||
|
if test -z $PIC_BUILD; then
|
||||||
|
SNAPPY_LIBS=" $SNAPPY_BASE/lib/libsnappy.a"
|
||||||
|
else
|
||||||
|
SNAPPY_LIBS=" $SNAPPY_BASE/lib/libsnappy_pic.a"
|
||||||
|
fi
|
||||||
|
CFLAGS+=" -DSNAPPY"
|
||||||
|
|
||||||
|
if test -z $PIC_BUILD; then
|
||||||
|
# location of zlib headers and libraries
|
||||||
|
ZLIB_INCLUDE=" -I $ZLIB_BASE/include/"
|
||||||
|
ZLIB_LIBS=" $ZLIB_BASE/lib/libz.a"
|
||||||
|
CFLAGS+=" -DZLIB"
|
||||||
|
|
||||||
|
LZ4_INCLUDE=" -I $LZ4_BASE/include/"
|
||||||
|
LZ4_LIBS=" $LZ4_BASE/lib/liblz4.a"
|
||||||
|
CFLAGS+=" -DLZ4"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# location of gflags headers and libraries
|
||||||
|
GFLAGS_INCLUDE=" -I $GFLAGS_BASE/include/"
|
||||||
|
if test -z $PIC_BUILD; then
|
||||||
|
GFLAGS_LIBS=" $GFLAGS_BASE/lib/libgflags.a"
|
||||||
|
else
|
||||||
|
GFLAGS_LIBS=" $GFLAGS_BASE/lib/libgflags_pic.a"
|
||||||
|
fi
|
||||||
|
CFLAGS+=" -DGFLAGS=gflags"
|
||||||
|
|
||||||
|
# location of jemalloc
|
||||||
|
JEMALLOC_INCLUDE=" -I $JEMALLOC_BASE/include/"
|
||||||
|
JEMALLOC_LIB=" $JEMALLOC_BASE/lib/libjemalloc.a"
|
||||||
|
|
||||||
|
if test -z $PIC_BUILD; then
|
||||||
|
# location of numa
|
||||||
|
NUMA_INCLUDE=" -I $NUMA_BASE/include/"
|
||||||
|
NUMA_LIB=" $NUMA_BASE/lib/libnuma.a"
|
||||||
|
CFLAGS+=" -DNUMA"
|
||||||
|
|
||||||
|
# location of libunwind
|
||||||
|
LIBUNWIND="$LIBUNWIND_BASE/lib/libunwind.a"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# location of TBB
|
||||||
|
TBB_INCLUDE=" -isystem $TBB_BASE/include/"
|
||||||
|
if test -z $PIC_BUILD; then
|
||||||
|
TBB_LIBS="$TBB_BASE/lib/libtbb.a"
|
||||||
|
else
|
||||||
|
TBB_LIBS="$TBB_BASE/lib/libtbb_pic.a"
|
||||||
|
fi
|
||||||
|
CFLAGS+=" -DTBB"
|
||||||
|
|
||||||
|
# use Intel SSE support for checksum calculations
|
||||||
|
export USE_SSE=" -msse -msse4.2 "
|
||||||
|
|
||||||
|
BINUTILS="$BINUTILS_BASE/bin"
|
||||||
|
AR="$BINUTILS/ar"
|
||||||
|
|
||||||
|
DEPS_INCLUDE="$SNAPPY_INCLUDE $ZLIB_INCLUDE $LZ4_INCLUDE $GFLAGS_INCLUDE"
|
||||||
|
|
||||||
|
STDLIBS="-L $GCC_BASE/lib64"
|
||||||
|
|
||||||
|
CLANG_BIN="$CLANG_BASE/bin"
|
||||||
|
CLANG_LIB="$CLANG_BASE/lib"
|
||||||
|
CLANG_SRC="$CLANG_BASE/../../src"
|
||||||
|
|
||||||
|
CLANG_ANALYZER="$CLANG_BIN/clang++"
|
||||||
|
CLANG_SCAN_BUILD="$CLANG_SRC/llvm/tools/clang/tools/scan-build/bin/scan-build"
|
||||||
|
|
||||||
|
CC="$GCC_BASE/bin/gcc"
|
||||||
|
CXX="$GCC_BASE/bin/g++"
|
||||||
|
|
||||||
|
CFLAGS+=" -B$BINUTILS/gold"
|
||||||
|
CFLAGS+=" -isystem $LIBGCC_INCLUDE"
|
||||||
|
CFLAGS+=" -isystem $GLIBC_INCLUDE"
|
||||||
|
JEMALLOC=1
|
||||||
|
|
||||||
|
CFLAGS+=" $DEPS_INCLUDE"
|
||||||
|
CFLAGS+=" -DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX -DROCKSDB_FALLOCATE_PRESENT -DROCKSDB_MALLOC_USABLE_SIZE -DROCKSDB_RANGESYNC_PRESENT -DROCKSDB_SCHED_GETCPU_PRESENT -DROCKSDB_SUPPORT_THREAD_LOCAL -DHAVE_SSE42"
|
||||||
|
CXXFLAGS+=" $CFLAGS"
|
||||||
|
|
||||||
|
EXEC_LDFLAGS=" $SNAPPY_LIBS $ZLIB_LIBS $LZ4_LIBS $ZSTD_LIBS $GFLAGS_LIBS $NUMA_LIB $TBB_LIBS"
|
||||||
|
EXEC_LDFLAGS+=" -B$BINUTILS/gold"
|
||||||
|
EXEC_LDFLAGS+=" -Wl,--dynamic-linker,/usr/local/fbcode/platform007/lib/ld.so"
|
||||||
|
EXEC_LDFLAGS+=" $LIBUNWIND"
|
||||||
|
EXEC_LDFLAGS+=" -Wl,-rpath=/usr/local/fbcode/platform007/lib"
|
||||||
|
# required by libtbb
|
||||||
|
EXEC_LDFLAGS+=" -ldl"
|
||||||
|
|
||||||
|
PLATFORM_LDFLAGS="$LIBGCC_LIBS $GLIBC_LIBS $STDLIBS -lgcc -lstdc++"
|
||||||
|
|
||||||
|
EXEC_LDFLAGS_SHARED="$SNAPPY_LIBS $ZLIB_LIBS $LZ4_LIBS $ZSTD_LIBS $GFLAGS_LIBS $TBB_LIBS"
|
||||||
|
|
||||||
|
VALGRIND_VER="$VALGRIND_BASE/bin/"
|
||||||
|
|
||||||
|
export CC CXX AR CFLAGS CXXFLAGS EXEC_LDFLAGS EXEC_LDFLAGS_SHARED VALGRIND_VER JEMALLOC_LIB JEMALLOC_INCLUDE CLANG_ANALYZER CLANG_SCAN_BUILD
|
@ -144,7 +144,7 @@ static bool ValidateKeySize(const char* flagname, int32_t value) {
|
|||||||
}
|
}
|
||||||
DEFINE_int32(key_size, 16, "size of each key");
|
DEFINE_int32(key_size, 16, "size of each key");
|
||||||
static const bool FLAGS_key_size_dummy =
|
static const bool FLAGS_key_size_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_key_size, &ValidateKeySize);
|
GFLAGS::RegisterFlagValidator(&FLAGS_key_size, &ValidateKeySize);
|
||||||
|
|
||||||
DEFINE_double(compression_ratio, 0.5, "Arrange to generate values that shrink"
|
DEFINE_double(compression_ratio, 0.5, "Arrange to generate values that shrink"
|
||||||
" to this fraction of their original size after compression");
|
" to this fraction of their original size after compression");
|
||||||
@ -226,7 +226,7 @@ DEFINE_int32(cache_numshardbits, -1, "Number of shards for the block cache"
|
|||||||
" is 2 ** cache_numshardbits. Negative means use default settings."
|
" is 2 ** cache_numshardbits. Negative means use default settings."
|
||||||
" This is applied only if FLAGS_cache_size is non-negative.");
|
" This is applied only if FLAGS_cache_size is non-negative.");
|
||||||
static const bool FLAGS_cache_numshardbits_dummy =
|
static const bool FLAGS_cache_numshardbits_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_cache_numshardbits,
|
GFLAGS::RegisterFlagValidator(&FLAGS_cache_numshardbits,
|
||||||
&ValidateCacheNumshardbits);
|
&ValidateCacheNumshardbits);
|
||||||
|
|
||||||
DEFINE_int32(cache_remove_scan_count_limit, 32, "");
|
DEFINE_int32(cache_remove_scan_count_limit, 32, "");
|
||||||
@ -296,7 +296,7 @@ DEFINE_int32(readwritepercent, 90, "Ratio of reads to reads/writes (expressed"
|
|||||||
"default value 90 means 90% operations out of all reads and writes"
|
"default value 90 means 90% operations out of all reads and writes"
|
||||||
" operations are reads. In other words, 9 gets for every 1 put.");
|
" operations are reads. In other words, 9 gets for every 1 put.");
|
||||||
static const bool FLAGS_readwritepercent_dummy =
|
static const bool FLAGS_readwritepercent_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_readwritepercent, &ValidateInt32Percent);
|
GFLAGS::RegisterFlagValidator(&FLAGS_readwritepercent, &ValidateInt32Percent);
|
||||||
|
|
||||||
DEFINE_int32(deletepercent, 2, "Percentage of deletes out of reads/writes/"
|
DEFINE_int32(deletepercent, 2, "Percentage of deletes out of reads/writes/"
|
||||||
"deletes (used in RandomWithVerify only). RandomWithVerify "
|
"deletes (used in RandomWithVerify only). RandomWithVerify "
|
||||||
@ -304,7 +304,7 @@ DEFINE_int32(deletepercent, 2, "Percentage of deletes out of reads/writes/"
|
|||||||
"deletepercent), so deletepercent must be smaller than (100 - "
|
"deletepercent), so deletepercent must be smaller than (100 - "
|
||||||
"FLAGS_readwritepercent)");
|
"FLAGS_readwritepercent)");
|
||||||
static const bool FLAGS_deletepercent_dummy =
|
static const bool FLAGS_deletepercent_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_deletepercent, &ValidateInt32Percent);
|
GFLAGS::RegisterFlagValidator(&FLAGS_deletepercent, &ValidateInt32Percent);
|
||||||
|
|
||||||
DEFINE_int32(disable_seek_compaction, false, "Option to disable compaction"
|
DEFINE_int32(disable_seek_compaction, false, "Option to disable compaction"
|
||||||
" triggered by read.");
|
" triggered by read.");
|
||||||
@ -349,7 +349,7 @@ static bool ValidateTableCacheNumshardbits(const char* flagname,
|
|||||||
}
|
}
|
||||||
DEFINE_int32(table_cache_numshardbits, 4, "");
|
DEFINE_int32(table_cache_numshardbits, 4, "");
|
||||||
static const bool FLAGS_table_cache_numshardbits_dummy =
|
static const bool FLAGS_table_cache_numshardbits_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_table_cache_numshardbits,
|
GFLAGS::RegisterFlagValidator(&FLAGS_table_cache_numshardbits,
|
||||||
&ValidateTableCacheNumshardbits);
|
&ValidateTableCacheNumshardbits);
|
||||||
|
|
||||||
DEFINE_string(hdfs, "", "Name of hdfs environment");
|
DEFINE_string(hdfs, "", "Name of hdfs environment");
|
||||||
@ -373,13 +373,13 @@ static bool ValidateRateLimit(const char* flagname, double value) {
|
|||||||
}
|
}
|
||||||
DEFINE_double(soft_rate_limit, 0.0, "");
|
DEFINE_double(soft_rate_limit, 0.0, "");
|
||||||
static const bool FLAGS_soft_rate_limit_dummy =
|
static const bool FLAGS_soft_rate_limit_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_soft_rate_limit, &ValidateRateLimit);
|
GFLAGS::RegisterFlagValidator(&FLAGS_soft_rate_limit, &ValidateRateLimit);
|
||||||
|
|
||||||
DEFINE_double(hard_rate_limit, 0.0, "When not equal to 0 this make threads "
|
DEFINE_double(hard_rate_limit, 0.0, "When not equal to 0 this make threads "
|
||||||
"sleep at each stats reporting interval until the compaction"
|
"sleep at each stats reporting interval until the compaction"
|
||||||
" score for all levels is less than or equal to this value.");
|
" score for all levels is less than or equal to this value.");
|
||||||
static const bool FLAGS_hard_rate_limit_dummy =
|
static const bool FLAGS_hard_rate_limit_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_hard_rate_limit, &ValidateRateLimit);
|
GFLAGS::RegisterFlagValidator(&FLAGS_hard_rate_limit, &ValidateRateLimit);
|
||||||
|
|
||||||
DEFINE_int32(rate_limit_delay_max_milliseconds, 1000,
|
DEFINE_int32(rate_limit_delay_max_milliseconds, 1000,
|
||||||
"When hard_rate_limit is set then this is the max time a put will"
|
"When hard_rate_limit is set then this is the max time a put will"
|
||||||
@ -449,7 +449,7 @@ static bool ValidatePrefixSize(const char* flagname, int32_t value) {
|
|||||||
}
|
}
|
||||||
DEFINE_int32(prefix_size, 0, "Control the prefix size for PrefixHashRep");
|
DEFINE_int32(prefix_size, 0, "Control the prefix size for PrefixHashRep");
|
||||||
static const bool FLAGS_prefix_size_dummy =
|
static const bool FLAGS_prefix_size_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_prefix_size, &ValidatePrefixSize);
|
GFLAGS::RegisterFlagValidator(&FLAGS_prefix_size, &ValidatePrefixSize);
|
||||||
|
|
||||||
enum RepFactory {
|
enum RepFactory {
|
||||||
kSkipList,
|
kSkipList,
|
||||||
@ -2412,9 +2412,9 @@ class Benchmark {
|
|||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
rocksdb::InstallStackTraceHandler();
|
rocksdb::InstallStackTraceHandler();
|
||||||
google::SetUsageMessage(std::string("\nUSAGE:\n") + std::string(argv[0]) +
|
GFLAGS::SetUsageMessage(std::string("\nUSAGE:\n") + std::string(argv[0]) +
|
||||||
" [OPTIONS]...");
|
" [OPTIONS]...");
|
||||||
google::ParseCommandLineFlags(&argc, &argv, true);
|
GFLAGS::ParseCommandLineFlags(&argc, &argv, true);
|
||||||
|
|
||||||
FLAGS_compaction_style_e = (rocksdb::CompactionStyle) FLAGS_compaction_style;
|
FLAGS_compaction_style_e = (rocksdb::CompactionStyle) FLAGS_compaction_style;
|
||||||
if (FLAGS_statistics) {
|
if (FLAGS_statistics) {
|
||||||
|
@ -85,10 +85,10 @@ DEFINE_uint64(wal_size_limit_MB, 10, "the wal size limit for the run"
|
|||||||
"(in MB)");
|
"(in MB)");
|
||||||
|
|
||||||
int main(int argc, const char** argv) {
|
int main(int argc, const char** argv) {
|
||||||
google::SetUsageMessage(std::string("\nUSAGE:\n") + std::string(argv[0]) +
|
GFLAGS::SetUsageMessage(std::string("\nUSAGE:\n") + std::string(argv[0]) +
|
||||||
" --num_inserts=<num_inserts> --wal_ttl_seconds=<WAL_ttl_seconds>" +
|
" --num_inserts=<num_inserts> --wal_ttl_seconds=<WAL_ttl_seconds>" +
|
||||||
" --wal_size_limit_MB=<WAL_size_limit_MB>");
|
" --wal_size_limit_MB=<WAL_size_limit_MB>");
|
||||||
google::ParseCommandLineFlags(&argc, const_cast<char***>(&argv), true);
|
GFLAGS::ParseCommandLineFlags(&argc, const_cast<char***>(&argv), true);
|
||||||
|
|
||||||
Env* env = Env::Default();
|
Env* env = Env::Default();
|
||||||
std::string default_db_path;
|
std::string default_db_path;
|
||||||
|
@ -56,7 +56,7 @@ static bool ValidateUint32Range(const char* flagname, uint64_t value) {
|
|||||||
}
|
}
|
||||||
DEFINE_uint64(seed, 2341234, "Seed for PRNG");
|
DEFINE_uint64(seed, 2341234, "Seed for PRNG");
|
||||||
static const bool FLAGS_seed_dummy =
|
static const bool FLAGS_seed_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_seed, &ValidateUint32Range);
|
GFLAGS::RegisterFlagValidator(&FLAGS_seed, &ValidateUint32Range);
|
||||||
|
|
||||||
DEFINE_int64(max_key, 1 * KB * KB * KB,
|
DEFINE_int64(max_key, 1 * KB * KB * KB,
|
||||||
"Max number of key/values to place in database");
|
"Max number of key/values to place in database");
|
||||||
@ -166,7 +166,7 @@ static bool ValidateInt32Positive(const char* flagname, int32_t value) {
|
|||||||
}
|
}
|
||||||
DEFINE_int32(reopen, 10, "Number of times database reopens");
|
DEFINE_int32(reopen, 10, "Number of times database reopens");
|
||||||
static const bool FLAGS_reopen_dummy =
|
static const bool FLAGS_reopen_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_reopen, &ValidateInt32Positive);
|
GFLAGS::RegisterFlagValidator(&FLAGS_reopen, &ValidateInt32Positive);
|
||||||
|
|
||||||
DEFINE_int32(bloom_bits, 10, "Bloom filter bits per key. "
|
DEFINE_int32(bloom_bits, 10, "Bloom filter bits per key. "
|
||||||
"Negative means use default settings.");
|
"Negative means use default settings.");
|
||||||
@ -194,7 +194,7 @@ DEFINE_int32(kill_random_test, 0,
|
|||||||
"If non-zero, kill at various points in source code with "
|
"If non-zero, kill at various points in source code with "
|
||||||
"probability 1/this");
|
"probability 1/this");
|
||||||
static const bool FLAGS_kill_random_test_dummy =
|
static const bool FLAGS_kill_random_test_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_kill_random_test,
|
GFLAGS::RegisterFlagValidator(&FLAGS_kill_random_test,
|
||||||
&ValidateInt32Positive);
|
&ValidateInt32Positive);
|
||||||
extern int rocksdb_kill_odds;
|
extern int rocksdb_kill_odds;
|
||||||
|
|
||||||
@ -222,32 +222,32 @@ static bool ValidateInt32Percent(const char* flagname, int32_t value) {
|
|||||||
DEFINE_int32(readpercent, 10,
|
DEFINE_int32(readpercent, 10,
|
||||||
"Ratio of reads to total workload (expressed as a percentage)");
|
"Ratio of reads to total workload (expressed as a percentage)");
|
||||||
static const bool FLAGS_readpercent_dummy =
|
static const bool FLAGS_readpercent_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_readpercent, &ValidateInt32Percent);
|
GFLAGS::RegisterFlagValidator(&FLAGS_readpercent, &ValidateInt32Percent);
|
||||||
|
|
||||||
DEFINE_int32(prefixpercent, 20,
|
DEFINE_int32(prefixpercent, 20,
|
||||||
"Ratio of prefix iterators to total workload (expressed as a"
|
"Ratio of prefix iterators to total workload (expressed as a"
|
||||||
" percentage)");
|
" percentage)");
|
||||||
static const bool FLAGS_prefixpercent_dummy =
|
static const bool FLAGS_prefixpercent_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_prefixpercent, &ValidateInt32Percent);
|
GFLAGS::RegisterFlagValidator(&FLAGS_prefixpercent, &ValidateInt32Percent);
|
||||||
|
|
||||||
DEFINE_int32(writepercent, 45,
|
DEFINE_int32(writepercent, 45,
|
||||||
" Ratio of deletes to total workload (expressed as a percentage)");
|
" Ratio of deletes to total workload (expressed as a percentage)");
|
||||||
static const bool FLAGS_writepercent_dummy =
|
static const bool FLAGS_writepercent_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_writepercent, &ValidateInt32Percent);
|
GFLAGS::RegisterFlagValidator(&FLAGS_writepercent, &ValidateInt32Percent);
|
||||||
|
|
||||||
DEFINE_int32(delpercent, 15,
|
DEFINE_int32(delpercent, 15,
|
||||||
"Ratio of deletes to total workload (expressed as a percentage)");
|
"Ratio of deletes to total workload (expressed as a percentage)");
|
||||||
static const bool FLAGS_delpercent_dummy =
|
static const bool FLAGS_delpercent_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_delpercent, &ValidateInt32Percent);
|
GFLAGS::RegisterFlagValidator(&FLAGS_delpercent, &ValidateInt32Percent);
|
||||||
|
|
||||||
DEFINE_int32(iterpercent, 10, "Ratio of iterations to total workload"
|
DEFINE_int32(iterpercent, 10, "Ratio of iterations to total workload"
|
||||||
" (expressed as a percentage)");
|
" (expressed as a percentage)");
|
||||||
static const bool FLAGS_iterpercent_dummy =
|
static const bool FLAGS_iterpercent_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_iterpercent, &ValidateInt32Percent);
|
GFLAGS::RegisterFlagValidator(&FLAGS_iterpercent, &ValidateInt32Percent);
|
||||||
|
|
||||||
DEFINE_uint64(num_iterations, 10, "Number of iterations per MultiIterate run");
|
DEFINE_uint64(num_iterations, 10, "Number of iterations per MultiIterate run");
|
||||||
static const bool FLAGS_num_iterations_dummy =
|
static const bool FLAGS_num_iterations_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_num_iterations, &ValidateUint32Range);
|
GFLAGS::RegisterFlagValidator(&FLAGS_num_iterations, &ValidateUint32Range);
|
||||||
|
|
||||||
DEFINE_bool(disable_seek_compaction, false,
|
DEFINE_bool(disable_seek_compaction, false,
|
||||||
"Option to disable compation triggered by read.");
|
"Option to disable compation triggered by read.");
|
||||||
@ -283,18 +283,18 @@ static rocksdb::Env* FLAGS_env = rocksdb::Env::Default();
|
|||||||
|
|
||||||
DEFINE_uint64(ops_per_thread, 600000, "Number of operations per thread.");
|
DEFINE_uint64(ops_per_thread, 600000, "Number of operations per thread.");
|
||||||
static const bool FLAGS_ops_per_thread_dummy =
|
static const bool FLAGS_ops_per_thread_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_ops_per_thread, &ValidateUint32Range);
|
GFLAGS::RegisterFlagValidator(&FLAGS_ops_per_thread, &ValidateUint32Range);
|
||||||
|
|
||||||
DEFINE_uint64(log2_keys_per_lock, 2, "Log2 of number of keys per lock");
|
DEFINE_uint64(log2_keys_per_lock, 2, "Log2 of number of keys per lock");
|
||||||
static const bool FLAGS_log2_keys_per_lock_dummy =
|
static const bool FLAGS_log2_keys_per_lock_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_log2_keys_per_lock,
|
GFLAGS::RegisterFlagValidator(&FLAGS_log2_keys_per_lock,
|
||||||
&ValidateUint32Range);
|
&ValidateUint32Range);
|
||||||
|
|
||||||
DEFINE_int32(purge_redundant_percent, 50,
|
DEFINE_int32(purge_redundant_percent, 50,
|
||||||
"Percentage of times we want to purge redundant keys in memory "
|
"Percentage of times we want to purge redundant keys in memory "
|
||||||
"before flushing");
|
"before flushing");
|
||||||
static const bool FLAGS_purge_redundant_percent_dummy =
|
static const bool FLAGS_purge_redundant_percent_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_purge_redundant_percent,
|
GFLAGS::RegisterFlagValidator(&FLAGS_purge_redundant_percent,
|
||||||
&ValidateInt32Percent);
|
&ValidateInt32Percent);
|
||||||
|
|
||||||
DEFINE_bool(filter_deletes, false, "On true, deletes use KeyMayExist to drop"
|
DEFINE_bool(filter_deletes, false, "On true, deletes use KeyMayExist to drop"
|
||||||
@ -334,7 +334,7 @@ static bool ValidatePrefixSize(const char* flagname, int32_t value) {
|
|||||||
}
|
}
|
||||||
DEFINE_int32(prefix_size, 0, "Control the prefix size for PrefixHashRep");
|
DEFINE_int32(prefix_size, 0, "Control the prefix size for PrefixHashRep");
|
||||||
static const bool FLAGS_prefix_size_dummy =
|
static const bool FLAGS_prefix_size_dummy =
|
||||||
google::RegisterFlagValidator(&FLAGS_prefix_size, &ValidatePrefixSize);
|
GFLAGS::RegisterFlagValidator(&FLAGS_prefix_size, &ValidatePrefixSize);
|
||||||
|
|
||||||
DEFINE_bool(use_merge, false, "On true, replaces all writes with a Merge "
|
DEFINE_bool(use_merge, false, "On true, replaces all writes with a Merge "
|
||||||
"that behaves like a Put");
|
"that behaves like a Put");
|
||||||
@ -1490,9 +1490,9 @@ class StressTest {
|
|||||||
|
|
||||||
|
|
||||||
int main(int argc, char** argv) {
|
int main(int argc, char** argv) {
|
||||||
google::SetUsageMessage(std::string("\nUSAGE:\n") + std::string(argv[0]) +
|
GFLAGS::SetUsageMessage(std::string("\nUSAGE:\n") + std::string(argv[0]) +
|
||||||
" [OPTIONS]...");
|
" [OPTIONS]...");
|
||||||
google::ParseCommandLineFlags(&argc, &argv, true);
|
GFLAGS::ParseCommandLineFlags(&argc, &argv, true);
|
||||||
|
|
||||||
if (FLAGS_statistics) {
|
if (FLAGS_statistics) {
|
||||||
dbstats = rocksdb::CreateDBStatistics();
|
dbstats = rocksdb::CreateDBStatistics();
|
||||||
|
@ -389,7 +389,6 @@ class PosixMmapFile : public WritableFile {
|
|||||||
file_offset_(0),
|
file_offset_(0),
|
||||||
pending_sync_(false) {
|
pending_sync_(false) {
|
||||||
assert((page_size & (page_size - 1)) == 0);
|
assert((page_size & (page_size - 1)) == 0);
|
||||||
assert(options.use_mmap_writes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -567,7 +566,6 @@ class PosixWritableFile : public WritableFile {
|
|||||||
pending_fsync_(false),
|
pending_fsync_(false),
|
||||||
last_sync_size_(0),
|
last_sync_size_(0),
|
||||||
bytes_per_sync_(options.bytes_per_sync) {
|
bytes_per_sync_(options.bytes_per_sync) {
|
||||||
assert(!options.use_mmap_writes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
~PosixWritableFile() {
|
~PosixWritableFile() {
|
||||||
|
Loading…
Reference in New Issue
Block a user