diff options
author | Greg Soltis <gsoltis@google.com> | 2018-03-30 10:18:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-30 10:18:25 -0700 |
commit | 3f36f5467de4c191fa2903743e5a210420e9d49a (patch) | |
tree | e73fa2cd4fa299d6220e4ab04daab515ceeca89a /Firestore/Source/Local/FSTLevelDB.mm | |
parent | ea490a2c6492e41e892397e044477f778ce358b8 (diff) |
Drop FSTWriteGroup (#986)
* Drop write group from remote document change buffer
* Unwind some group dependendencies in local store
* Write group dropped from local store
* Drop write group from mutation queue tests
* Drop write group usage from query cache tests
* Drop write groups from remote document cache tests
* Drop write groups from remote document change buffer tests
* Drop write groups and the write group tracker
* Style
* Put the action in transaction
* Merge master, fix test
* Fix some compiler warnings but mostly trigger travis
* Responses to feedback
Diffstat (limited to 'Firestore/Source/Local/FSTLevelDB.mm')
-rw-r--r-- | Firestore/Source/Local/FSTLevelDB.mm | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/Firestore/Source/Local/FSTLevelDB.mm b/Firestore/Source/Local/FSTLevelDB.mm index 922c5b4..4812228 100644 --- a/Firestore/Source/Local/FSTLevelDB.mm +++ b/Firestore/Source/Local/FSTLevelDB.mm @@ -23,8 +23,6 @@ #import "Firestore/Source/Local/FSTLevelDBMutationQueue.h" #import "Firestore/Source/Local/FSTLevelDBQueryCache.h" #import "Firestore/Source/Local/FSTLevelDBRemoteDocumentCache.h" -#import "Firestore/Source/Local/FSTWriteGroup.h" -#import "Firestore/Source/Local/FSTWriteGroupTracker.h" #import "Firestore/Source/Remote/FSTSerializerBeta.h" #import "Firestore/Source/Util/FSTAssert.h" #import "Firestore/Source/Util/FSTLogger.h" @@ -55,7 +53,6 @@ using leveldb::WriteOptions; @interface FSTLevelDB () @property(nonatomic, copy) NSString *directory; -@property(nonatomic, strong) FSTWriteGroupTracker *writeGroupTracker; @property(nonatomic, assign, getter=isStarted) BOOL started; @property(nonatomic, strong, readonly) FSTLocalSerializer *serializer; @@ -79,7 +76,6 @@ using leveldb::WriteOptions; serializer:(FSTLocalSerializer *)serializer { if (self = [super init]) { _directory = [directory copy]; - _writeGroupTracker = [FSTWriteGroupTracker tracker]; _serializer = serializer; _transactionRunner.SetBackingPersistence(self); } @@ -148,7 +144,7 @@ using leveldb::WriteOptions; return NO; } _ptr.reset(database); - LevelDbTransaction transaction(_ptr.get()); + LevelDbTransaction transaction(_ptr.get(), "Start LevelDB"); [FSTLevelDBMigrations runMigrationsWithTransaction:&transaction]; transaction.Commit(); return YES; @@ -229,9 +225,9 @@ using leveldb::WriteOptions; return [[FSTLevelDBRemoteDocumentCache alloc] initWithDB:self serializer:self.serializer]; } -- (void)startTransaction { +- (void)startTransaction:(absl::string_view)label { FSTAssert(_transaction == nullptr, @"Starting a transaction while one is already outstanding"); - _transaction = absl::make_unique<LevelDbTransaction>(_ptr.get()); + _transaction = absl::make_unique<LevelDbTransaction>(_ptr.get(), label); } - (void)commitTransaction { @@ -240,19 +236,6 @@ using leveldb::WriteOptions; _transaction.reset(); } -- (FSTWriteGroup *)startGroupWithAction:(NSString *)action { - FSTAssert(_transaction == nullptr, @"Starting a transaction while one is already outstanding"); - _transaction = absl::make_unique<LevelDbTransaction>(_ptr.get()); - return [self.writeGroupTracker startGroupWithAction:action transaction:_transaction.get()]; -} - -- (void)commitGroup:(FSTWriteGroup *)group { - FSTAssert(_transaction != nullptr, @"Committing a transaction before one is started"); - [self.writeGroupTracker endGroup:group]; - _transaction->Commit(); - _transaction.reset(); -} - - (void)shutdown { FSTAssert(self.isStarted, @"FSTLevelDB shutdown without start!"); self.started = NO; |