1. 19 2月, 2013 2 次提交
    • K
      Fix the "IO error" in auto_roll_logger_test · 45f00304
      Kai Liu 提交于
      Summary:
      
      I missed InitTestDb() in one of my tess. InitTestDb() initializes the test directory, without which the test will throw IO error.
      
      This problem didn't occur before because I've already run the tests before so the test directory is already there.
      
      Test Plan:
      
      Reviewers: dhruba
      
      CC:
      
      Task ID: #
      
      Blame Rev:
      45f00304
    • K
      Temporary remove the auto_roll_logger_test. · ae09544c
      Kai Liu 提交于
      Summary:
      
      auto_roll_logger_test is failing because it cannot create the test dir, leading to IO error: /tmp/leveldbtest-6108/db_log_test/LOG: No such file or directory.
      I'll temporary remove the unit test and will revert the test this problem is solved.
      
      Test Plan:
      
      make all check
      
      Reviewers: dhruba
      
      CC: leveldb
      
      Task ID: #
      
      Blame Rev:
      ae09544c
  2. 05 2月, 2013 1 次提交
    • K
      Allow the logs to be purged by TTL. · b63aafce
      Kai Liu 提交于
      Summary:
      * Add a SplitByTTLLogger to enable this feature. In this diff I implemented generalized AutoSplitLoggerBase class to simplify the
      development of such classes.
      * Refactor the existing AutoSplitLogger and fix several bugs.
      
      Test Plan:
      * Added a unit tests for different types of "auto splitable" loggers individually.
      * Tested the composited logger which allows the log files to be splitted by both TTL and log size.
      
      Reviewers: heyongqiang, dhruba
      
      Reviewed By: heyongqiang
      
      CC: zshao, leveldb
      
      Differential Revision: https://reviews.facebook.net/D8037
      b63aafce
  3. 01 2月, 2013 1 次提交
    • A
      Performant util/histogram. · 009034cf
      Abhishek Kona 提交于
      Summary:
      Earlier way to record in histogram=>
      Linear search BucketLimit array to find the bucket and increment the
      counter
      Current way to record in histogram=>
      Store a HistMap statically which points the buckets of each value in the
      range [kFirstValue, kLastValue);
      
      In the proccess use vectors instead of array's and refactor some code to
      HistogramHelper class.
      
      Test Plan:
      run db_bench with histogram=1 and see a histogram being
      printed.
      
      Reviewers: dhruba, chip, heyongqiang
      
      Reviewed By: chip
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D8265
      009034cf
  4. 29 1月, 2013 1 次提交
  5. 25 1月, 2013 1 次提交
    • C
      Stop continually re-creating build_version.c · 772f75b3
      Chip Turner 提交于
      Summary:
      We continually rebuilt build_version.c because we put the
      current date into it, but that's what __DATE__ already is.  This makes
      builds faster.
      
      This also fixes an issue with 'make clean FOO' not working properly.
      
      Also tweak the build rules to be more consistent, always have warnings,
      and add a 'make release' rule to handle flags for release builds.
      
      Test Plan: make, make clean
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      Differential Revision: https://reviews.facebook.net/D8139
      772f75b3
  6. 15 1月, 2013 1 次提交
    • C
      Various build cleanups/improvements · c0cb289d
      Chip Turner 提交于
      Summary:
      Specific changes:
      
      1) Turn on -Werror so all warnings are errors
      2) Fix some warnings the above now complains about
      3) Add proper dependency support so changing a .h file forces a .c file
      to rebuild
      4) Automatically use fbcode gcc on any internal machine rather than
      whatever system compiler is laying around
      5) Fix jemalloc to once again be used in the builds (seemed like it
      wasn't being?)
      6) Fix issue where 'git' would fail in build_detect_version because of
      LD_LIBRARY_PATH being set in the third-party build system
      
      Test Plan:
      make, make check, make clean, touch a header file, make sure
      rebuild is expected
      
      Reviewers: dhruba
      
      Reviewed By: dhruba
      
      Differential Revision: https://reviews.facebook.net/D7887
      c0cb289d
  7. 22 12月, 2012 2 次提交
  8. 21 12月, 2012 1 次提交
  9. 07 11月, 2012 1 次提交
  10. 06 11月, 2012 1 次提交
  11. 11 10月, 2012 1 次提交
    • A
      [tools] Add a tool to stress test concurrent writing to levelDB · 24f7983b
      Asad K Awan 提交于
      Summary:
      Created a tool that runs multiple threads that concurrently read and write to levelDB.
      All writes to the DB are stored in an in-memory hashtable and verified at the end of the
      test. All writes for a given key are serialzied.
      
      Test Plan:
       - Verified by writing only a few keys and logging all writes and verifying that values read and written are correct.
       - Verified correctness of value generator.
       - Ran with various parameters of number of keys, locks, and threads.
      
      Reviewers: dhruba, MarkCallaghan, heyongqiang
      
      Reviewed By: dhruba
      
      Differential Revision: https://reviews.facebook.net/D5829
      24f7983b
  12. 28 9月, 2012 1 次提交
    • G
      Add db_dump tool to dump DB keys · 92368ab8
      gjain 提交于
      Summary:
      Create a tool to iterate through keys and dump values. Current options
      as follows:
      
      db_dump --start=[START_KEY] --end=[END_KEY] --max_keys=[NUM] --stats
      [PATH]
      
      START_KEY: First key to start at
      END_KEY: Key to end at (not inclusive)
      NUM: Maximum number of keys to dump
      PATH: Path to leveldb DB
      
      The --stats command line argument prints out the DB stats before dumping
      the keys.
      
      Test Plan:
      - Tested with invalid args
      - Tested with invalid path
      - Used empty DB
      - Used filled DB
      - Tried various permutations of command line options
      
      Reviewers: dhruba, heyongqiang
      
      Reviewed By: dhruba
      
      Differential Revision: https://reviews.facebook.net/D5643
      92368ab8
  13. 26 9月, 2012 1 次提交
  14. 22 9月, 2012 1 次提交
  15. 29 8月, 2012 1 次提交
    • H
      merge 1.5 · a4f9b8b4
      heyongqiang 提交于
      Summary:
      
      as subject
      
      Test Plan:
      
      db_test table_test
      
      Reviewers: dhruba
      a4f9b8b4
  16. 28 8月, 2012 1 次提交
    • D
      Introduce a new method Env->Fsync() that issues fsync (instead of fdatasync). · fc20273e
      Dhruba Borthakur 提交于
      Summary:
      Introduce a new method Env->Fsync() that issues fsync (instead of fdatasync).
      This is needed for data durability when running on ext3 filesystems.
      Added options to the benchmark db_bench to generate performance numbers
      with either fsync or fdatasync enabled.
      
      Cleaned up Makefile to build leveldb_shell only when building the thrift
      leveldb server.
      
      Test Plan: build and run benchmark
      
      Reviewers: heyongqiang
      
      Reviewed By: heyongqiang
      
      Differential Revision: https://reviews.facebook.net/D4911
      fc20273e
  17. 25 8月, 2012 3 次提交
    • D
      Record the version of the source repository that was used to build the leveldb library. · 5d96f290
      Dhruba Borthakur 提交于
      Summary: Record the version of the source that we are compiling. We keep a record of the git revision in util/version.cc. This source file is then built as a regular source file as part of the compilation process. One can run "strings executable_filename | grep _build_" to find the version of the source that we used to build the executable file.
      
      Test Plan: none
      
      Differential Revision: https://reviews.facebook.net/D4785
      5d96f290
    • D
      Prevent concurrent multiple opens of leveldb database. · d41316bc
      Dhruba Borthakur 提交于
      Summary:
      The fcntl call cannot detect lock conflicts when invoked multiple times
      from the same thread.
      Use a static lockedFile Set to record the paths that are locked.
      A lockfile request checks to see if htis filename already exists in
      lockedFiles, if so, then it triggers an error. Otherwise, it inserts
      the filename in the lockedFiles Set.
      A unlock file request verifies that the filename is in the lockedFiles
      set and removes it from lockedFiles set.
      
      Test Plan: unit test attached
      
      Reviewers: heyongqiang
      
      Reviewed By: heyongqiang
      
      Differential Revision: https://reviews.facebook.net/D4755
      d41316bc
    • D
      Utility to dump manifest contents. · f3ee5452
      Dhruba Borthakur 提交于
      Summary:
      ./manifest_dump --file=/tmp/dbbench/MANIFEST-000002
      
      Output looks like
      
      manifest_file_number 30 next_file_number 31 last_sequence 388082 log_number 28  prev_log_number 0
      --- level 0 ---
      --- level 1 ---
      --- level 2 ---
       5:3244155['0000000000000000' @ 1 : 1 .. '0000000000028220' @ 28221 : 1]
       7:3244177['0000000000028221' @ 28222 : 1 .. '0000000000056441' @ 56442 : 1]
       9:3244156['0000000000056442' @ 56443 : 1 .. '0000000000084662' @ 84663 : 1]
       11:3244178['0000000000084663' @ 84664 : 1 .. '0000000000112883' @ 112884 : 1]
       13:3244158['0000000000112884' @ 112885 : 1 .. '0000000000141104' @ 141105 : 1]
       15:3244176['0000000000141105' @ 141106 : 1 .. '0000000000169325' @ 169326 : 1]
       17:3244156['0000000000169326' @ 169327 : 1 .. '0000000000197546' @ 197547 : 1]
       19:3244178['0000000000197547' @ 197548 : 1 .. '0000000000225767' @ 225768 : 1]
       21:3244155['0000000000225768' @ 225769 : 1 .. '0000000000253988' @ 253989 : 1]
       23:3244179['0000000000253989' @ 253990 : 1 .. '0000000000282209' @ 282210 : 1]
       25:3244157['0000000000282210' @ 282211 : 1 .. '0000000000310430' @ 310431 : 1]
       27:3244176['0000000000310431' @ 310432 : 1 .. '0000000000338651' @ 338652 : 1]
       29:3244156['0000000000338652' @ 338653 : 1 .. '0000000000366872' @ 366873 : 1]
      --- level 3 ---
      --- level 4 ---
      --- level 5 ---
      --- level 6 ---
      
      Test Plan: run on test directory created by dbbench
      
      Reviewers: heyongqiang
      
      Reviewed By: heyongqiang
      
      CC: hustliubo
      
      Differential Revision: https://reviews.facebook.net/D4743
      f3ee5452
  18. 24 8月, 2012 1 次提交
  19. 22 8月, 2012 1 次提交
  20. 21 8月, 2012 1 次提交
    • D
      Prevent concurrent multiple opens of leveldb database. · e56b2c5a
      Dhruba Borthakur 提交于
      Summary:
      The fcntl call cannot detect lock conflicts when invoked multiple times
      from the same thread.
      Use a static lockedFile Set to record the paths that are locked.
      A lockfile request checks to see if htis filename already exists in
      lockedFiles, if so, then it triggers an error. Otherwise, it inserts
      the filename in the lockedFiles Set.
      A unlock file request verifies that the filename is in the lockedFiles
      set and removes it from lockedFiles set.
      
      Test Plan: unit test attached
      
      Reviewers: heyongqiang
      
      Reviewed By: heyongqiang
      
      Differential Revision: https://reviews.facebook.net/D4755
      e56b2c5a
  21. 18 8月, 2012 1 次提交
    • D
      Utility to dump manifest contents. · 2aa514ec
      Dhruba Borthakur 提交于
      Summary:
      ./manifest_dump --file=/tmp/dbbench/MANIFEST-000002
      
      Output looks like
      
      manifest_file_number 30 next_file_number 31 last_sequence 388082 log_number 28  prev_log_number 0
      --- level 0 ---
      --- level 1 ---
      --- level 2 ---
       5:3244155['0000000000000000' @ 1 : 1 .. '0000000000028220' @ 28221 : 1]
       7:3244177['0000000000028221' @ 28222 : 1 .. '0000000000056441' @ 56442 : 1]
       9:3244156['0000000000056442' @ 56443 : 1 .. '0000000000084662' @ 84663 : 1]
       11:3244178['0000000000084663' @ 84664 : 1 .. '0000000000112883' @ 112884 : 1]
       13:3244158['0000000000112884' @ 112885 : 1 .. '0000000000141104' @ 141105 : 1]
       15:3244176['0000000000141105' @ 141106 : 1 .. '0000000000169325' @ 169326 : 1]
       17:3244156['0000000000169326' @ 169327 : 1 .. '0000000000197546' @ 197547 : 1]
       19:3244178['0000000000197547' @ 197548 : 1 .. '0000000000225767' @ 225768 : 1]
       21:3244155['0000000000225768' @ 225769 : 1 .. '0000000000253988' @ 253989 : 1]
       23:3244179['0000000000253989' @ 253990 : 1 .. '0000000000282209' @ 282210 : 1]
       25:3244157['0000000000282210' @ 282211 : 1 .. '0000000000310430' @ 310431 : 1]
       27:3244176['0000000000310431' @ 310432 : 1 .. '0000000000338651' @ 338652 : 1]
       29:3244156['0000000000338652' @ 338653 : 1 .. '0000000000366872' @ 366873 : 1]
      --- level 3 ---
      --- level 4 ---
      --- level 5 ---
      --- level 6 ---
      
      Test Plan: run on test directory created by dbbench
      
      Reviewers: heyongqiang
      
      Reviewed By: heyongqiang
      
      CC: hustliubo
      
      Differential Revision: https://reviews.facebook.net/D4743
      2aa514ec
  22. 15 8月, 2012 1 次提交
    • D
      "make all check" fails · fe6119bd
      Dhruba Borthakur 提交于
      Summary:
      If I run "make all check" it fails to build the leveldb-thrift-server tests. This is because the vanilla build is not supposed to build thrift and/or hdfs extensions. Remove the server test from auto-running.
      
      The thrift/hdfs build instructions are more elaborate and I would like to avoid it for embedded database builds.
      
      Test Plan: build and run
      
      Reviewers: heyongqiang
      
      Reviewed By: heyongqiang
      
      Differential Revision: https://reviews.facebook.net/D4641
      fe6119bd
  23. 08 7月, 2012 1 次提交
  24. 19 6月, 2012 1 次提交
  25. 15 5月, 2012 1 次提交
  26. 17 4月, 2012 1 次提交
    • S
      Added bloom filter support. · 85584d49
      Sanjay Ghemawat 提交于
      In particular, we add a new FilterPolicy class.  An instance
      of this class can be supplied in Options when opening a
      database.  If supplied, the instance is used to generate
      summaries of keys (e.g., a bloom filter) which are placed in
      sstables.  These summaries are consulted by DB::Get() so we
      can avoid reading sstable blocks that are guaranteed to not
      contain the key we are looking for.
      
      This change provides one implementation of FilterPolicy
      based on bloom filters.
      
      Other changes:
      - Updated version number to 1.4.
      - Some build tweaks.
      - C binding for CompactRange.
      - A few more benchmarks: deleteseq, deleterandom, readmissing, seekrandom.
      - Minor .gitignore update.
      85584d49
  27. 31 3月, 2012 1 次提交
  28. 22 3月, 2012 1 次提交
    • S
      Build fixes and cleanups: · a1ad4d19
      Sanjay Ghemawat 提交于
      (1) Separate out C++ and CC flags (fixes c_test compilation)
      (2) Move snappy/perftools detection to script
      (3) Fix db_bench_sqlite3 and db_bench_tree_db build rules
      a1ad4d19
  29. 16 3月, 2012 1 次提交
  30. 30 11月, 2011 1 次提交
  31. 15 11月, 2011 1 次提交
  32. 12 9月, 2011 1 次提交
    • H
      Sync with upstream @23860137. · 213a68eb
      Hans Wennborg 提交于
      Fix GCC -Wshadow warnings in LevelDB's public header files,
      reported by Dustin.
      
      Add in-memory Env implementation (helpers/memenv/*).
      This enables users to create LevelDB databases in-memory.
      
      Initialize ShardedLRUCache::last_id_ to zero.
      This fixes a Valgrind warning.
      
      (Also delete port/sha1_* which were removed upstream some time ago.)
      213a68eb
  33. 06 8月, 2011 1 次提交
  34. 27 7月, 2011 1 次提交
    • G
      Adding FreeBSD support, removing Chromium files, adding benchmark. · f122c6df
      gabor@google.com 提交于
      - LevelDB patch for FreeBSD. This resolves Issue 22.
        Contributed by dforsythe (thanks!).
      
      - Removing Chromium-specific files.
        They are now going to live in the Chromium repository.
      
      - Adding a benchmark page comparing LevelDB performance
        to SQLite and Kyoto Cabinet's TreeDB, along with
        code to generate the benchmarks.
        Thanks to Kevin Tseng for compiling the benchmarks,
        and Scott Hess and Mikio Hirabayashi for their
        help and advice.
      
      
      
      git-svn-id: https://leveldb.googlecode.com/svn/trunk@40 62dab493-f737-651d-591e-8d6aee1b9529
      f122c6df
  35. 30 6月, 2011 1 次提交
  36. 29 6月, 2011 1 次提交
    • G
      Platform detection during build, plus compatibility patches for machines without <cstdatomic>. · f57e2335
      gabor@google.com 提交于
      This revision adds two major changes:
      1. build_detect_platform which generates build_config.mk
         with platform-dependent flags for the build process
      2. /port/atomic_pointer.h with anAtomicPointerimplementation
         for platforms without <cstdatomic>
      
      Some of this code is loosely based on patches submitted to the 
      LevelDB mailing list at https://groups.google.com/forum/#!forum/leveldb
      Tip of the hat to Dave Smith and Edouard A, who both sent patches.
      
      The presence of Snappy (http://code.google.com/p/snappy/) and
      cstdatomic are now both detected in the build_detect_platform
      script (1.) which gets executing during make.
      
      For (2.), instead of broadly importing atomicops_* from Chromium or
      the Google performance tools, we chose to just implement AtomicPointer 
      and the limited atomic load and store operations it needs. 
      This resulted in much less code and fewer files - everything is 
      contained in atomic_pointer.h.
      
      
      
      git-svn-id: https://leveldb.googlecode.com/svn/trunk@34 62dab493-f737-651d-591e-8d6aee1b9529
      f57e2335