Skip to content

Commit

Permalink
Implement RowLocks for assoc schema
Browse files Browse the repository at this point in the history
Summary:
Each assoc is identified by (id1, assocType). This is the rowkey.
Each row has a read/write rowlock. There is statically allocated array
of 2000 read/write locks. A rowkey is murmur-hashed to one of the
read/write locks.

assocPut and assocDelete acquires the rowlock in Write mode.
The key-updates are done within the rowlock with a atomic nosync
batch write to leveldb. Then the rowlock is released and
a write-with-sync is done to sync leveldb transaction log.

Test Plan: added unit test

Reviewers: heyongqiang

Reviewed By: heyongqiang

Differential Revision: https://reviews.facebook.net/D5859
  • Loading branch information
dhruba committed Oct 4, 2012
1 parent c1006d4 commit f7975ac
Show file tree
Hide file tree
Showing 4 changed files with 470 additions and 193 deletions.
Loading

0 comments on commit f7975ac

Please sign in to comment.