1. 14 5月, 2014 1 次提交
    • I
      TablePropertiesCollectorFactory · 26f5dd9a
      Igor Canadi 提交于
      Summary:
      This diff addresses task #4296714 and rethinks how users provide us with TablePropertiesCollectors as part of Options.
      
      Here's description of task #4296714:
             I'm debugging #4295529 and noticed that our count of user properties kDeletedKeys is wrong. We're sharing one single InternalKeyPropertiesCollector with all Table Builders. In LOG Files, we're outputting number of kDeletedKeys as connected with a single table, while it's actually the total count of deleted keys since creation of the DB.
      
             For example, this table has 3155 entries and 1391828 deleted keys.
      
      The problem with current approach that we call methods on a single TablePropertiesCollector for all the tables we create. Even worse, we could do it from multiple threads at the same time and TablePropertiesCollector has no way of knowing which table we're calling it for.
      
      Good part: Looks like nobody inside Facebook is using Options::table_properties_collectors. This means we should be able to painfully change the API.
      
      In this change, I introduce TablePropertiesCollectorFactory. For every table we create, we call `CreateTablePropertiesCollector`, which creates a TablePropertiesCollector for a single table. We then use it sequentially from a single thread, which means it doesn't have to be thread-safe.
      
      Test Plan:
      Added a test in table_properties_collector_test that fails on master (build two tables, assert that kDeletedKeys count is correct for the second one).
      Also, all other tests
      
      Reviewers: sdong, dhruba, haobo, kailiu
      
      Reviewed By: kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D18579
      26f5dd9a
  2. 02 5月, 2014 1 次提交
  3. 22 4月, 2014 1 次提交
  4. 18 4月, 2014 1 次提交
    • S
      RocksDB 2.8 to be able to read files generated by 2.6 · 5cef458a
      sdong 提交于
      Summary:
      From 2.6 to 2.7, property block name is renamed from rocksdb.stats to rocksdb.properties. Older properties were not able to be loaded. In 2.8, we seem to have added some logic that uses property block without checking null pointers, which create segment faults.
      
      In this patch, we fix it by:
      (1) try rocksdb.stats if rocksdb.properties is not found
      (2) add some null checking before consuming rep->table_properties
      
      Test Plan: make sure a file generated in 2.7 couldn't be opened now can be opened.
      
      Reviewers: haobo, igor, yhchiang
      
      Reviewed By: igor
      
      CC: ljin, xjin, dhruba, kailiu, leveldb
      
      Differential Revision: https://reviews.facebook.net/D17961
      5cef458a
  5. 14 2月, 2014 1 次提交
  6. 08 2月, 2014 2 次提交
    • K
      Make table properties shareable · 161ab42a
      kailiu 提交于
      Summary:
      We are going to expose properties of all tables to end users through "some" db interface.
      However, current design doesn't naturally fit for this need, which is because:
      
      1. If a table presents in table cache, we cannot simply return the reference to its table properties, because the table may be destroy after compaction (and we don't want to hold the ref of the version).
      2. Copy table properties is OK, but it's slow.
      
      Thus in this diff, I change the table reader's interface to return a shared pointer (for const table properties), instead a const refernce.
      
      Test Plan: `make check` passed
      
      Reviewers: haobo, sdong, dhruba
      
      Reviewed By: haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15999
      161ab42a
    • Y
      Add support for plain table format to sst_dump. · 3ce8d9a9
      Yueh-Hsuan Chiang 提交于
      Summary:
      This diff enables the command line tool `sst_dump` to work for sst files
      under plain table format.  Changes include:
        * In tools/sst_dump.cc:
          - add support for plain table format
          - display prefix_extractor information when --show_properties is on
        * In table/format.cc
          - Now the table magic number of a Footer can be later initialized
            via ReadFooterFromFile().
        * In table/meta_bocks:
          - add function ReadTableMagicNumber() that reads the magic number of
            the specified file.
      
      Minor fixes:
       - remove a duplicate #include in table/table_test.cc
       - fix a commentary typo in include/rocksdb/memtablerep.h
       - fix lint errors.
      
      Test Plan:
      Runs sst_dump with both block-based and plain-table format files with
      different arguments, specifically those with --show-properties and --from.
      
      * sample output:
        https://reviews.facebook.net/P261
      
      Reviewers: kailiu, sdong, xjin
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15903
      3ce8d9a9
  7. 03 2月, 2014 1 次提交
  8. 21 12月, 2013 1 次提交
  9. 14 12月, 2013 1 次提交
    • K
      Add the property block for the plain table · 2e9efcd6
      Kai Liu 提交于
      Summary:
      This is the last diff that adds the property block to plain table.
      The format resembles that of the block-based table: https://github.com/facebook/rocksdb/wiki/Rocksdb-table-format
      
        [data block]
        [meta block 1: stats block]
        [meta block 2: future extended block]
        ...
        [meta block K: future extended block]  (we may add more meta blocks in the future)
        [metaindex block]
        [index block: we only have the placeholder here, we can add persistent index block in the future]
        [Footer: contains magic number, handle to metaindex block and index block]
        <end_of_file>
      
      Test Plan: extended existing property block test.
      
      Reviewers: haobo, sdong, dhruba
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D14523
      2e9efcd6
  10. 06 12月, 2013 1 次提交