1. 31 7月, 2014 6 次提交
    • Y
      Fixed a typo in the comment for merge operator. · e9269e6e
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fixed a typo in the comment for merge operator.
      
      Test Plan:
      n/a
      e9269e6e
    • Y
      Fixed the crash when merge_operator is not properly set after reopen. · 49ee5a4a
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fixed the crash when merge_operator is not properly set after reopen
      and added two test cases for this.
      
      Test Plan:
      make merge_test
      ./merge_test
      
      Reviewers: igor, ljin, sdong
      
      Reviewed By: sdong
      
      Subscribers: benj, mvikjord, leveldb
      
      Differential Revision: https://reviews.facebook.net/D20793
      49ee5a4a
    • F
      remove malloc when create data and index iterator in Get · 8f09d53f
      Feng Zhu 提交于
      Summary:
        Define Block::Iter to be an independent class to be used by block_based_table_reader
        When creating data and index iterator, update an existing iterator rather than new one
        Thus malloc and free could be reduced
      
      Benchmark,
      Base:
      commit 76286ee6
      commands:
      --db=/dev/shm/rocksdb --num_levels=6 --key_size=20 --prefix_size=20 --keys_per_prefix=0 --value_size=100 --write_buffer_size=134217728 --max_write_buffer_number=2 --target_file_size_base=33554432 --max_bytes_for_level_base=1073741824 --verify_checksum=false --max_background_compactions=4 --use_plain_table=0 --memtablerep=prefix_hash --open_files=-1 --mmap_read=1 --mmap_write=0 --bloom_bits=10 --bloom_locality=1 --memtable_bloom_bits=500000 --compression_type=lz4 --num=2621440 --use_hash_search=1 --block_size=1024 --block_restart_interval=1 --use_existing_db=1 --threads=1 --benchmarks=readrandom —disable_auto_compactions=1
      
      malloc: 3.30% -> 1.42%
      free: 3.59%->1.61%
      
      Test Plan:
        make all check
        run db_stress
        valgrind ./db_test ./table_test
      
      Reviewers: ljin, yhchiang, dhruba, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20655
      8f09d53f
    • S
      Remove unnecessary constructor parameter from ColumnFamilyData · 76286ee6
      Stanislau Hlebik 提交于
      Summary: const string& dbname parameter is not used
      
      Test Plan: make all
      
      Reviewers: sdong, igor
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20703
      76286ee6
    • S
      Fix ldb dump_manifest · 473e8297
      sdong 提交于
      Summary:
      We now reads table properties in VersionSet::LogAndApply(), which requires options.db_paths to be set. But since ldb_cmd directly creates VersionSet without initialization db_paths, causing a seg fault. This patch fix it by initializing db_paths.
      
      log_and_apply_bench still shows segfault, because table cache is nullptr in VersionSet created.
      
      Test Plan: Run ldb dump_manifest which used to fail.
      
      Reviewers: yhchiang, ljin, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20751
      473e8297
    • I
      Better comment for inplace_update_support · 99e03bcb
      Igor Canadi 提交于
      Summary: See https://github.com/facebook/rocksdb/issues/215
      
      Test Plan: none
      
      Reviewers: dhruba, sdong, ljin, yhchiang, nkg-
      
      Reviewed By: nkg-
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20769
      99e03bcb
  2. 29 7月, 2014 7 次提交
    • R
      Minor changes to CuckooTableBuilder · 91c01485
      Radheshyam Balasundaram 提交于
      Summary:
      - Copy the key and value to in-memory hash table during Add operation. Also modified cuckoo_table_reader_test to use this.
      - Store only the user_key in in-memory hash table if it is last level file.
      - Handle Carryover while chosing unused key in Finish() method in case unused key was never found before Finish() call.
      
      Test Plan:
      cuckoo_table_reader_test --enable_perf
      cuckoo_table_builder_test
      valgrind_check
      asan_check
      
      Reviewers: sdong, yhchiang, igor, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20715
      91c01485
    • S
      Add DB::GetIntProperty() to return integer properties to be returned as integers · f04356e6
      sdong 提交于
      Summary: We have quite some properties that are integers and we are adding more. Add a function to directly return them as an integer, instead of a string
      
      Test Plan: Add several unit test checks
      
      Reviewers: yhchiang, igor, dhruba, haobo, ljin
      
      Reviewed By: ljin
      
      Subscribers: yoshinorim, leveldb
      
      Differential Revision: https://reviews.facebook.net/D20637
      f04356e6
    • S
      Add DB property estimated number of keys · f6784766
      sdong 提交于
      Summary: Add a DB property of estimated number of live keys, by adding number of entries of all mem tables and all files, subtracted by all deletions in all files.
      
      Test Plan: Add the case in unit tests
      
      Reviewers: hobbymanyp, ljin
      
      Reviewed By: ljin
      
      Subscribers: MarkCallaghan, yoshinorim, leveldb, igor, dhruba
      
      Differential Revision: https://reviews.facebook.net/D20631
      f6784766
    • L
      InternalStats to take cfd on constructor · 7e8bb71d
      Lei Jin 提交于
      Summary:
      It has one-to-one relationship with CFD. Take a pointer to CFD on
      constructor to avoid passing cfd through member functions.
      
      Test Plan: make
      
      Reviewers: sdong, yhchiang, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20565
      7e8bb71d
    • L
      Change StopWatch interface · 1bd3431f
      Lei Jin 提交于
      Summary: So that we can avoid calling NowSecs() in MakeRoomForWrite twice
      
      Test Plan: make all check
      
      Reviewers: yhchiang, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20529
      1bd3431f
    • L
      make statistics forward-able · f6ca226c
      Lei Jin 提交于
      Summary:
      Make StatisticsImpl being able to forward stats to provided statistics
      implementation. The main purpose is to allow us to collect internal
      stats in the future even when user supplies custom statistics
      implementation. It avoids intrumenting 2 sets of stats collection code.
      One immediate use case is tuning advisor, which needs to collect some
      internal stats, users may not be interested.
      
      Test Plan:
      ran db_bench and see stats show up at the end of run
      Will run make all check since some tests rely on statistics
      
      Reviewers: yhchiang, sdong, igor
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D20145
      f6ca226c
    • L
      make statistics forward-able · 40fa8a4c
      Lei Jin 提交于
      Summary:
      Make StatisticsImpl being able to forward stats to provided statistics
      implementation. The main purpose is to allow us to collect internal
      stats in the future even when user supplies custom statistics
      implementation. It avoids intrumenting 2 sets of stats collection code.
      One immediate use case is tuning advisor, which needs to collect some
      internal stats, users may not be interested.
      
      Test Plan:
      ran db_bench and see stats show up at the end of run
      Will run make all check since some tests rely on statistics
      
      Reviewers: yhchiang, sdong, igor
      
      Reviewed By: sdong
      
      Subscribers: dhruba, leveldb
      
      Differential Revision: https://reviews.facebook.net/D20145
      40fa8a4c
  3. 26 7月, 2014 4 次提交
    • S
      Block::Iter::PrefixSeek() to have an extra check to filter out some false matches · 4a8f0c95
      sdong 提交于
      Summary:
      In block based table's hash index checking, when looking for a key that doesn't exist, there is a high chance that a false block is returned because of hash bucket conflicts. In this revision, another check is done to filter out some of those cases: comparing previous key of the block boundary to see whether the target block is what we are looking for.
      
      In a favored test setting (bloom filter disabled, 8 L0 files), I saw about 80% improvements. In a non-favored test setting (bloom filter enabled, files are all in L1, files are all cached), I see the performance penalty is less than 3%.
      
      Test Plan: make all check
      
      Reviewers: haobo, ljin
      
      Reviewed By: ljin
      
      Subscribers: wuj, leveldb, zagfox, yhchiang
      
      Differential Revision: https://reviews.facebook.net/D20595
      4a8f0c95
    • R
      Implementation of CuckooTableReader · 62f9b071
      Radheshyam Balasundaram 提交于
      Summary:
      Contains:
      - Implementation of TableReader based on Cuckoo Hashing
      - Unittests for CuckooTableReader
      - Performance test for TableReader
      
      Test Plan:
      make cuckoo_table_reader_test
      ./cuckoo_table_reader_test
      make valgrind_check
      make asan_check
      
      Reviewers: yhchiang, sdong, igor, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20511
      62f9b071
    • L
      expose RateLimiter definition · d650612c
      Lei Jin 提交于
      Summary:
      User gets undefinied error since the definition is not exposed.
      Also re-enable the db test with only upper bound check
      
      Test Plan: db_test, rate_limit_test
      
      Reviewers: igor, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20403
      d650612c
    • I
      Initialize next_id · 28b367db
      Igor Canadi 提交于
      28b367db
  4. 25 7月, 2014 5 次提交
  5. 24 7月, 2014 10 次提交
    • Y
      Merge branch 'ankgup87-master' · 4b61a3d6
      Yueh-Hsuan Chiang 提交于
      4b61a3d6
    • Y
      [Java] Add compaction style to options · 10fc6c7d
      Yueh-Hsuan Chiang 提交于
      Summary:
      Add compression type to options
      
      make rocksdbjava
      make sample
      
      Reviewers: haobo, yhchiang, sdong, dhruba, rsumbaly, zzbennett, swapnilghike
      Reviewed By: yhchiang, sdong
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20463
      10fc6c7d
    • I
      NewIterators in read-only mode · 41a69725
      Igor Canadi 提交于
      Summary: As title.
      
      Test Plan: Added test to column_family_test
      
      Reviewers: ljin, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20523
      41a69725
    • I
      Fix release compile error · e5f6980d
      Igor Canadi 提交于
      e5f6980d
    • F
      Use IterKey instead of string in Block::Iter to reduce malloc · da927457
      Feng Zhu 提交于
      Summary:
        Modify a functioin TrimAppend in dbformat.h: IterKey. Write a test for it in dbformat_test
        Use IterKey in block::Iter to replace std::string to reduce malloc.
      
        Evaluate it using perf record.
        malloc: 4.26% -> 2.91%
        free: 3.61% -> 3.08%
      
      Test Plan:
        make all check
        ./valgrind db_test dbformat_test
      
      Reviewers: ljin, haobo, yhchiang, dhruba, igor, sdong
      
      Reviewed By: sdong
      
      Differential Revision: https://reviews.facebook.net/D20433
      da927457
    • I
      SpatialDB · 62963304
      Igor Canadi 提交于
      Summary:
      This diff is adding spatial index support to RocksDB.
      
      When creating the DB user specifies a list of spatial indexes. Spatial indexes can cover different areas and have different resolution (i.e. number of tiles). This is useful for supporting different zoom levels.
      
      Each element inserted into SpatialDB has:
      * a bounding box, which determines how will the element be indexed
      * string blob, which will usually be WKB representation of the polygon (http://en.wikipedia.org/wiki/Well-known_text)
      * feature set, which is a map of key-value pairs, where value can be int, double, bool, null or a string. FeatureSet will be a set of tags associated with geo elements (for example, 'road': 'highway' and similar)
      * a list of indexes to insert the element in. For example, small river element will be inserted in index for high zoom level, while country border will be inserted in all indexes (including the index for low zoom level).
      
      Each query is executed on single spatial index. Query guarantees that it will return all elements intersecting the specified bounding box, but it might also return some extra non-intersecting elements.
      
      Test Plan: Added bunch of unit tests in spatial_db_test
      
      Reviewers: dhruba, yinwang
      
      Reviewed By: yinwang
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20361
      62963304
    • Y
      [Java] Add the missing ROCKSDB_JAR variable in Makefile · b5c4c0b8
      Yueh-Hsuan Chiang 提交于
      Summary:
      Add the missing ROCKSDB_JAR variable in Makefile, which is mistakenly
      removed in https://reviews.facebook.net/D20289.
      
      Test Plan:
      export ROCKSDB_JAR=
      make rocksdbjava
      b5c4c0b8
    • Y
      [Java] Update header inclusion of utilities files · 6e7e3e45
      Yueh-Hsuan Chiang 提交于
      Summary:
      Update header inclusion as include/utilities/*.h has been moved to
      include/rocksdb/utilities/*.h
      
      Test Plan: make rocksdbjava
      
      Reviewers: ljin, sdong, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20517
      6e7e3e45
    • Y
      Fixed a compile error in util/options_builder.cc · 00f56dfa
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fixed the following compile error by replacing pow by shift, as it computes
      power of 2.
      
      util/options_builder.cc:133:14: error: no member named 'pow' in namespace 'std'
              std::pow(2, std::max(0, std::min(3, level0_stop_writes_trigger -
              ~~~~~^
      1 error generated.
      make: *** [util/options_builder.o] Error 1
      
      Test Plan: make success in mac and linux
      
      Reviewers: ljin, igor, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20475
      00f56dfa
    • Y
      Fixed a bug in Compaction.cc where input_levels_ was not properly resized. · 0e1b4787
      Yueh-Hsuan Chiang 提交于
      Summary:
      Fixed a bug in Compaction.cc where input_levels_ was not properly resized.
      Without this fix, there would be invalid access in input_levels_ when more
      than two levels are involved in one compaction run.
      
      This fix will go to master instead of compaction branch.
      
      Test Plan: tested in compaction branch.
      
      Reviewers: ljin, sdong, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20481
      0e1b4787
  6. 23 7月, 2014 8 次提交
    • I
      Also bump version in Makefile · f82d4a24
      Igor Canadi 提交于
      f82d4a24
    • I
      Bump the version · 1053358a
      Igor Canadi 提交于
      1053358a
    • I
      Move include/utilities/*.h to include/rocksdb/utilities/*.h · 0ff183a0
      Igor Canadi 提交于
      Summary:
      All public headers need to be under `include/rocksdb` directory. Otherwise, clients include our header files like this:
      
          #include <rocksdb/db.h>
          #include <utilities/backupable_db.h> // still our public header!
      
      Also, internally, we include:
      
          #include "utilities/backupable/backupable_db.h" // internal header
          #include "utilities/backupable_db.h" // public header
      
      which is confusing.
      
      This way, when we install rocksdb as a system library, we can just copy `include/rocksdb` directory to system's header files. We can't really copy `utilities` directory to system's header files.
      
      Test Plan: compiles
      
      Reviewers: dhruba, ljin, yhchiang, sdong
      
      Reviewed By: sdong
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20409
      0ff183a0
    • S
      Add a utility function to guess optimized options based on constraints · e6de0210
      sdong 提交于
      Summary:
      Add a function GetOptions(), where based on four parameters users give: read/write amplification threshold, memory budget for mem tables and target DB size, it picks up a compaction style and parameters for them. Background threads are not touched yet.
      
      One limit of this algorithm: since compression rate and key/value size are hard to predict, it's hard to predict level 0 file size from write buffer size. Simply make 1:1 ratio here.
      
      Sample results: https://reviews.facebook.net/P477
      
      Test Plan: Will add some a unit test where some sample scenarios are given and see they pick the results that make sense
      
      Reviewers: yhchiang, dhruba, haobo, igor, ljin
      
      Reviewed By: ljin
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18741
      e6de0210
    • Y
      [Java] Optimize statistics collector, improve object dependency in RocksObjects · 250f0357
      Yueh-Hsuan Chiang 提交于
      Summary:
      This diff merges pull request 208.  Contributor: ankgup87
      
      [Java] Optimize statistics collector
      * Optimize statistics collector by collecting statistics of multiple DBs in a single thread rather than starting up a new thread for each DB.
      * Also, fix packaging of jnilib file on OS_X platform.
      * Diff review: https://reviews.facebook.net/D20265
      
      [Java] Add documentation on interdependency of dispose call of RocksObjects
      * Remove transferCppRawPointersOwnershipFrom function.
        - This function was setting opt.filter_ and thus filter_ to be null. This way there is no
          one holding reference for filter object and can thus be GC'd which is not the intention.
          Replaced it with storeOptionsInstace which stores options instance. Options class
          internally holds Filter instance. Thus when Options is GC'd, filter reference
          will be GC'd automatically.
      * Added documentation explaining interdependency of Filter, Options and DB.
      * Diff review: https://reviews.facebook.net/D20379
      
      Test Plan:
      described in their diff reviews
      
      Reviewers:  haobo sdong swapnilghike zzbennett rsumbaly yhchiang
      
      Reviewed by: yhchiang
      250f0357
    • A
      [Java] Optimize statistics collector, improve object dependency in RocksObjects · 25682d15
      Ankit Gupta 提交于
      Summary:
      This diff merges pull request #208.  Contributor: ankgup87
      
      [Java] Optimize statistics collector
      * Optimize statistics collector by collecting statistics of multiple DBs in a single thread rather than starting up a new thread for each DB.
      * Also, fix packaging of jnilib file on OS_X platform.
      * Diff review: https://reviews.facebook.net/D20265
      
      [Java] Add documentation on interdependency of dispose call of RocksObjects
      * Remove transferCppRawPointersOwnershipFrom function.
        - This function was setting opt.filter_ and thus filter_ to be null. This way there is no
          one holding reference for filter object and can thus be GC'd which is not the intention.
          Replaced it with storeOptionsInstace which stores options instance. Options class
          internally holds Filter instance. Thus when Options is GC'd, filter reference
          will be GC'd automatically.
      * Added documentation explaining interdependency of Filter, Options and DB.
      * Diff review: https://reviews.facebook.net/D20379
      
      Test Plan:
      described in their diff reviews
      
      Reviewers:  haobo sdong swapnilghike zzbennett rsumbaly yhchiang
      
      Reviewed by: yhchiang
      25682d15
    • I
      Fix signed-unsigned compare error · 2d3d6359
      Igor Canadi 提交于
      2d3d6359
    • R
      Fixing memory leaks in cuckoo_table_builder_test · f6272e30
      Radheshyam Balasundaram 提交于
      Summary: Fixes some memory leaks in cuckoo_builder_test.cc. This also fixed broken valgrind_check tests
      
      Test Plan:
      make valgrind_check
      ./cuckoo_builder_test
      Currently running make check all. I shall update once it is done.
      
      Reviewers: ljin, sdong, yhchiang, igor
      
      Reviewed By: igor
      
      Subscribers: leveldb
      
      Differential Revision: https://reviews.facebook.net/D20385
      f6272e30