1. 27 2月, 2014 1 次提交
    • I
      [CF] Handle failure in WriteBatch::Handler · 8b7ab995
      Igor Canadi 提交于
      Summary:
      * Add ColumnFamilyHandle::GetID() function. Client needs to know column family's ID to be able to construct WriteBatch
      * Handle WriteBatch::Handler failure gracefully. Since WriteBatch is not a very smart function (it takes raw CF id), client can add data to WriteBatch for column family that doesn't exist. In that case, we need to gracefully return failure status from DB::Write(). To do that, I added a return Status to WriteBatch functions PutCF, DeleteCF and MergeCF.
      
      Test Plan: Added test to column_family_test
      
      Reviewers: dhruba, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16323
      8b7ab995
  2. 13 2月, 2014 1 次提交
    • I
      [CF] Rethinking ColumnFamilyHandle and fix to dropping column families · b06840aa
      Igor Canadi 提交于
      Summary:
      The change to the public behavior:
      * When opening a DB or creating new column family client gets a ColumnFamilyHandle.
      * As long as column family handle is alive, client can do whatever he wants with it, even drop it
      * Dropped column family can still be read from (using the column family handle)
      * Added a new call CloseColumnFamily(). Client has to close all column families that he has opened before deleting the DB
      * As soon as column family is closed, any calls to DB using that column family handle will fail (also any outstanding calls)
      
      Internally:
      * Ref-counting ColumnFamilyData
      * New thread-safety for ColumnFamilySet
      * Dropped column families are now completely dropped and their memory cleaned-up
      
      Test Plan: added some tests to column_family_test
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D16101
      b06840aa
  3. 08 2月, 2014 1 次提交
  4. 07 2月, 2014 2 次提交
  5. 06 2月, 2014 3 次提交
    • I
      [CF] Options -> DBOptions · f276e0e5
      Igor Canadi 提交于
      Summary: Replaced most of occurrences of Options with more specific DBOptions. This brings us very close to supporting different configuration options for each column family.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15933
      f276e0e5
    • I
      [CF] Add full_options_ to ColumnFamilyData · 6e56ab57
      Igor Canadi 提交于
      Summary:
      Lots of code expects Options on construction/function call. My original idea was to split Options argument into ColumnFamilyOptions and DBOptions (the latter only if needed). However, this will require huge code changes very deep in the stack.
      
      The better idea is to have ColumnFamilyData hold both ColumnFamilyOptions and Options. ColumnFamilyData::Options would be constructed from DBOptions (same for each column family) and ColumnFamilyOptions (different for each column family)
      
      Now when we construct a class or call any method that requires Options, we can just push him ColumnFamilyData::Options and be sure that it's using column-family-specific settings.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15927
      6e56ab57
    • I
      [CF] Rethink table cache · c24d8c4e
      Igor Canadi 提交于
      Summary:
      Adapting table cache to column families is interesting. We want table cache to be global LRU, so if some column families are use not as often as others, we want them to be evicted from cache. However, current TableCache object also constructs tables on its own. If table is not found in the cache, TableCache automatically creates new table. We want each column family to be able to specify different table factory.
      
      To solve the problem, we still have a single LRU, but we provide the LRUCache object to TableCache on construction. We have one TableCache per column family, but the underyling cache is shared by all TableCache objects.
      
      This allows us to have a global LRU, but still be able to support different table factories for different column families. Also, in the future it will also be able to support different directories for different column families.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15915
      c24d8c4e
  6. 05 2月, 2014 2 次提交
    • I
      [CF] Move InternalStats to ColumnFamilyData · 7b9f1349
      Igor Canadi 提交于
      Summary: InternalStats is a messy thing, keeping both DB data and column family data. However, it's better off living in ColumnFamilyData than in DBImpl. For now, at least.
      
      Test Plan: make check
      
      Reviewers: dhruba, kailiu, haobo, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15879
      7b9f1349
    • I
      [CF] Split SanitizeOptions into two · 73f62255
      Igor Canadi 提交于
      Summary:
      There are three SanitizeOption-s now : one for DBOptions, one for ColumnFamilyOptions and one for Options (which just calls the other two)
      
      I have also reshuffled some options -- table_cache options and info_log should live in DBOptions, for example.
      
      Test Plan: make check doesn't complain
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15873
      73f62255
  7. 04 2月, 2014 2 次提交
  8. 01 2月, 2014 1 次提交
  9. 31 1月, 2014 2 次提交
    • I
      Enable iterating column families with a concurrent writer · 9ca638a8
      Igor Canadi 提交于
      Summary:
      Sometimes we iterate through column families, and unlock the mutex in the body of the iteration. While mutex is unlocked, some column family might be created or dropped. We need to be able to continue iterating through column families even though our current column family got dropped.
      
      This diff implements circular linked lists that connect all column families. It then uses the link list to enable iterating through linked lists. Even if the column family is dropped, its next_ pointer still can be used to advance to another alive column family.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15603
      9ca638a8
    • I
      MakeRoomForWrite() support for column families · 6973bb17
      Igor Canadi 提交于
      Summary: Making room for write will be the hardest part of the column family implementation. For now, I just iterate through all column families and run MakeRoomForWrite() for every one.
      
      Test Plan: make check does not complain
      
      Reviewers: dhruba, haobo
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15597
      6973bb17
  10. 30 1月, 2014 2 次提交
    • I
      Change ColumnFamilyData from struct to class · fa99d53e
      Igor Canadi 提交于
      Summary: ColumnFamilyData grew a lot, there's much more data that it holds now. It makes more sense to encapsulate it better by making it a class.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15579
      fa99d53e
    • I
      Read from and write to different column families · f24a3ee5
      Igor Canadi 提交于
      Summary: This one is big. It adds ability to write to and read from different column families (see the unit test). It also supports recovery of different column families from log, which was the hardest part to reason about. We need to make sure to never delete the log file which has unflushed data from any column family. To support that, I added another concept, which is versions_->MinLogNumber()
      
      Test Plan: Added a unit test in column_family_test
      
      Reviewers: dhruba, haobo, sdong, kailiu
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15537
      f24a3ee5
  11. 28 1月, 2014 1 次提交
  12. 24 1月, 2014 1 次提交
    • I
      ColumnFamilySet · 7c5e583a
      Igor Canadi 提交于
      Summary:
      I created a separate class ColumnFamilySet to keep track of column families. Before we did this in VersionSet and I believe this approach is cleaner.
      
      Let me know if you have any comments. I will commit tomorrow.
      
      Test Plan: make check
      
      Reviewers: dhruba, haobo, kailiu, sdong
      
      CC: leveldb
      
      Differential Revision: https://reviews.facebook.net/D15357
      7c5e583a