Commit Graph
26 Commits
Author SHA1 Message Date
Gil 2e5e8b5676 Migrate FSTQueryData to C++ QueryData (#3595)
* Migrate FSTQueryData to C++ QueryData

* Remove FSTQueryData
2019-08-20 14:56:32 -07:00
Gil 6b36c0671a Migrate from NSData to nanopb::ByteString for resume tokens (#3592) 2019-08-19 12:22:56 -07:00
Gil aefd4323a2 Remove Objective-C immutable sets and maps (#3590)
* Remove Firestore/third_party/Immutable

* Update podspec and sync_project

* Project updates
2019-08-19 09:09:20 -07:00
Gil 13a1b33913 Migrate from FSTQuery to C++ Query (#3484) 2019-08-02 11:35:33 -07:00
Gil 1e45a36b62 Migrate canonical ID and Document comparators to C++ (#3479)
* Migrate FSTQuery canonicalID to C++ Query

* Migrate query's DocumentComparator to C++ Query

* Expose DocumentSet::comparator
2019-08-01 15:00:50 -07:00
Gil cf682c69cc Complete migration to C++ Filters in FSTQuery (#3349)
* Use C++ Filters in FSTQuery without changing interface

* Remove FSTQuery initWithPath

* sync_project.rb generated changes

* Implement Filter equality

* Consistently use testutil:: helpers unqualified

* Use C++ Filters in FSTQuery
2019-07-15 12:47:38 -07:00
Paul Beusterien 7c53489e03 Travis to Xcode 10.1 and clang-format to 8.0.0 (tags/google/stable/2018-08-24) (#2222)
* Travis to Xcode 10.1
* Update to clang-format 8
* Update clang-format homebrew link
* Work around space in filename style.sh issue
2019-01-02 09:27:31 -08:00
Greg Soltis 900ca3b83d Implement QueryCache interface and port QueryCache tests (#2209)
* Implement QueryCache interface and port tests

* Port production usages of QueryCache (#2211)

* Remove FSTQueryCache and implementations

* Switch size() to size_t
2018-12-21 22:08:34 -08:00
Greg Soltis 466880b094 Continue work on ReferenceSet (#2213)
* Migrate FSTDocumentReference to C++

* Change SortedSet template parameter ordering

Makes it easier to specify a comparator without specifying what the
empty member of the underlying map is.

* Migrate MemoryMutationQueue to C++ references by key

* migrate.py

* CMake

* Finish porting ReferenceSet

* Swap reference set implementation

* Port MemoryQueryCache to use ported ReferenceSet

* Port FSTReferenceSetTest

* Port usage for limbo document refs

* Port LRU and LocalStore usages

* Remove FSTReferenceSet and FSTDocumentReference

* Style

* Add newline
2018-12-21 21:03:13 -08:00
Gil 10cc4f2190 Migrate FSTListenSequenceNumber to C++ ListenSequenceNumber (#1703) 2018-08-16 14:02:03 -07:00
Gil 0725a5d4bb Migrate FSTTargetID to C++ TargetId (#1697) 2018-08-15 15:56:45 -07:00
Greg Soltis c0fcc092f4 Fix some comments (#1606)
* Fix a comment

* Remove another comment
2018-07-31 08:44:39 -07:00
Greg Soltis 16a5210b3c Merging the LRU branch (#1600)
* Switch to reference delegates for garbage collection (#1410)

* Bump sequence number on resume token refresh

* Style

* Fix comment formatting

* Add FSTReferenceDelegate definition and documentation

* Add methods to return nil for delegates, wire up inMemoryPins

* Add hook for removing a reference

* Start work on reference delegates

* Fix up tests to support adding documents at a sequence number

* Implement removing references

* Remove from target when dropped from local view

* Fix warning

* Add hooks for removal from mutation queue

* Add hooks for limbo document updates

* Style

* Drop commented-out code

* Fixup after merging master

* Start importing delegate implementations

* Memory LRU tests pass

* Make memory lru work, start fixing up lru tests. All with hidden sequence numbers

* Most LRU tests passing w/ memory

* Big LRU test passes w/ memory

* Leveldb LRU tests pass

* All passing except local store tests

* All tests pass

* Fix localstore tests

* Revert removeQueryData change

* Remove collectGarbage calls

* Remove NoOp GC

* More cleanup

* Refactor FSTHelpers

* Cleanup and commenting

* Comments and cleanup

* Comments

* Drop nullable for reference delegates, and old persistence method on spec tests

* Fix missing sequence bump, remove unneeded targetID

* Style

* Drop commented-out code

* Satisfy the linters and copyrighters, etc.

* Drop more commented-out code

* Fix import -> include, NSUInteger -> int

* Start work on test comments

* FSTDocumentKey -> DocumentKey

* Sample of LRU test refactor (#1424)

* Sample of test refactor

* Drop errant 'struct' keyword

* More test refactoring

* Make gc a member variable too

* Tests refactored to use member variables

* Assign delegates procedurally, rather than passing in a block

* Fix up FSTLevelDB a little

* listens -> listenTargets

* Rename GCEnabled

* remove isSentinel

* reword comment

* Add case for non-eager GC to test

* Style

* Cleaning the lint trap

* Clean up LRU tests (#1433)

* Add copious helpers and some docs to lru tests

* Style

* Method name refactor, add comment

* Drop FSTGarbageCollector and FSTEagerGarbageCollector (#1440)

* Drop FSTGarbageCollector and FSTEagerGarbageCollector

* Drop unused containsKey from FSTLevelDBMutationQueue

* Style

* Include sequence number in FSTQueryData hash and isEqual (#1568)

* Include sequence number in FSTQueryData hash and isEqual methods

* Style

* Switch to util::Hash

* Fix preserving query cache metadata (#1569)

* Add failing test

* Move the restart tests to the leveldb test suite

* Style

* Add new persistence test helper

* Fix test failure

* Review feedback

* Style
2018-07-27 13:58:11 -07:00
Gil a080e481b5 Port FSTDocumentKeySet to C++ DocumentKeySet (#1229)
* Define a Comparator for DocumentKey

* Automated migration from FSTDocumentKeySet to DocumentKeySet

* Manual fixups for DocumentKeySet

* Delete FSTDocumentKeySet
2018-05-05 08:10:51 -07:00
zxu 4e1ffe4649 Port SnapshotVersion for the rest Firestore modulo (#1185)
* remove conversions in `Local` and `Remote`

* replace `FSTSnapshotVersion` in `Model`

* replace `FSTSnapshotVersion` in the rest

* let test check equal with C++ equal

* fix newly added code

* address changes
2018-05-01 13:37:53 -04:00
Gil 0a66187053 Add lint checking for Objective-C++ sources (#1048)
* lint.sh now lints Objective-C++ too

* cpplint checks system-style includes that should be user-style

This prevents it from recognizing project sources as if they were C
system headers and then complaining that they're in the wrong place.

* cpplint checks #imports and #includes

* cpplint checks that C++ system headers aren't #imported

* cpplint checks for C system headers that could be C++ system headers

* cpplint checks that Objective-C sources include their headers
2018-04-09 11:54:39 -07:00
Greg Soltis 3f36f5467d 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
2018-03-30 10:18:25 -07:00
Greg Soltis 861ad89de9 Remove unused shutdown methods (#993)
* Drop mutation queue shutdown

* Drop query cache shutdown

* Drop remote document cache shutdown

* Drop local store shutdown

* drop newline
2018-03-29 10:00:01 -07:00
Greg Soltis d9b2d312d9 Remove some usages of FSTWriteGroup (#983)
* FSTMutationQueue no longer needs groups

* Remove write group from mutation queue entirely

* Remove write group from query cache

* Mark groups unused in remote document cache

* Drop write group entirely from remote document cache

* style

* Drop commented-out code

* Drop commented-out code
2018-03-29 08:55:10 -07:00
zxu 38170347b9 fix a typo (#970)
fix a typo caused in the merge a2a109b (https://github.com/firebase/firebase-ios-sdk/commit/0ccfd6a3dc77fb733626bc8911b5925ad9475c2e)
2018-03-23 20:54:16 -04:00
zxu 0ccfd6a3dc port C++ DocumentKey to Local/* (#963)
* port C++ DocumentKey to Local's

* address changes
2018-03-23 17:52:01 -04:00
Greg Soltis 352b790b6e Switch FSTLevelDBQueryCache to use transactions (#942)
* Start work on leveldb transactions

* Style

* Working API. Not plumbed in yet

* Move files into correct place

* Wrangling file locations and associations

* Tests pass

* Add some comments

* style

* Fix copyright

* Rewrite iterator internals to handle deletion-while-iterating. Also add tests for same

* Switch to strings instead of slices

* Style

* More style fixes

* Start switching writegroup over

* Swap out write group tracking for transaction usage

* Style

* Response to feedback before updating docs

* Style

* Add comment

* Initialize version_

* Satisfy the linter

* Start switching writegroup over

* Swap out write group tracking for transaction usage

* Style

* Checkpoint before implementing BatchDescription

* Style

* Initial plumbing for leveldb local parts

* Add model::BatchId

* Port leveldb_key.{h,cc}

* Add string StartsWith

* Add leveldb_key_test.cc to the project

* Revert back to using leveldb::Slice for read/describe

These operations universally operate on keys obtained from leveldb so
it's actually unhelpful to force all the callers to make
absl::string_views from them.

* Everything passing

* Drop unused function

* Style

* STart work on reads

* Swap reads in queryCache to use transactions

* Fix up tests of querycache

* Drop commented out code

* Cleanup

* Style

* Fix up for passing tests

* style

* Renaming

* Style

* Start work on ToString for transactions

* Add ToString() method to LevelDbTransaction

* Style

* lint

* Fix includes, drop runTransaction

* current_transaction -> currentTransaction

* LevelDbTransaction::NewIterator now returns a unique_ptr

* Style

* Revert addition of util::StartsWith

* Add log line

* Style

* Add log line

* Style

* Add debug log line for commits, drop unused BatchDescription

* Fix an include, but mostly try to trigger a travis build
2018-03-22 17:31:16 -07:00
zxu 9e815620e9 grand PR to port the remaining paths (FieldPath and ResourcePath). (#865)
* naively remove FSTPath import and source/test files.

* port FieldPath, part I

* port FieldPath, part II

* port ResourcePath, part I

* port ResourcePath, part II

* the grand commit to fix build errors

* use testutil:: helper instead of those from FSTHelpers

* fix test and lint

* use c_str in errmsg directly

* fix

* fix

* make code clean

* fix integration test I missed

* fix to avoid naming collision in preprocessor

* address changes

* address changes

* address changes

* fix: fieldMask are actually shared with different context.

* address changes

* address changes
2018-03-14 08:57:31 -04:00
Gil f7d9f29d53 Fix lint warnings (#840) 2018-02-22 10:48:06 -08:00
Greg Soltis 5f5f808258 Keep track of number of queries in the query cache (#776)
* Implement schema versions

* Style fixes

* newlines, copyrights, assumptions

* Fix nullability

* Raw ptr -> shared_ptr

* kVersionTableGlobal -> kVersionGlobalTable

* Drop utils, move into static methods

* Drop extra include

* Add a few more comments

* Move version constant into migrations file

* formatting?

* Fix comment

* Split add and update queryData

* Work on adding targetCount

* More work on count

* Using shared_ptr

* Implement count for query cache

* use quotes

* Add cast

* Styling

* Revert year bump in copyright

* Add adversarial key to migration test

* Add comment

* Fix style
2018-02-13 11:12:17 -08:00
Gil 729b8d176c Move all Firestore Objective-C to Objective-C++ (#734)
* Move all Firestore files to Objective-C++
* Update project file references
* Don't use module imports from Objective-C++
* Use extern "C" for C-accessible globals
* Work around more stringent type checking in Objective-C++
  * NSMutableDictionary ivars aren't implicitly casted to NSDictionary
  * FSTMaybeDocument callback can't be passed a function that accepts
    FSTDocument
  * NSComparisonResult can't be multiplied by -1 without casting
* Add a #include <inttypes.h> where needed
* Avoid using C++ keywords as variables
* Remove #if __cplusplus guards
2018-01-31 11:23:55 -08:00