summaryrefslogtreecommitdiff
path: root/test/storage/offline_database.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [tidy] Check llvm-namespace-commentBruno de Oliveira Abinader2016-06-131-1/+1
| | | | Ref: http://clang.llvm.org/extra/clang-tidy/checks/llvm-namespace-comment.html
* [core] fix pedantic warning messagesKonstantin Käfer2016-06-131-30/+30
|
* [core] Refactor getRegionCompletedStatus; add completedTileCount; add testsJohn Firebaugh2016-04-271-0/+34
|
* [tests] Rationalize test fixtures (#4834)John Firebaugh2016-04-251-166/+20
| | | Place them in a directory corresponding to the test .cpp file name.
* [core] Demote "Unable to make space for entry" message from Warning to Debug ↵John Firebaugh2016-04-141-6/+2
| | | | (#4708)
* Merge branch 'release-ios-3.2.0-android-4.0.0'John Firebaugh2016-03-301-0/+36
|\
| * [core] Set schema version to 3 after upgradingJohn Firebaugh2016-03-281-0/+8
| | | | | | | | | | | | The migration was upgrading the schema, but not the schema version. As a result, the (expensive) migration was running every time an OfflineDatabase was constructed with a v2 database. Fixes #4501
| * [core] Implement a vacuum strategy for the offline databaseJohn Firebaugh2016-03-171-0/+28
| | | | | | | | Enable `PRAGMA auto_vacuum = INCREMENTAL`, and perform a `PRAGMA incremental_vacuum` when deleting an offline region.
* | [tests] Tweak offline tests to work on iOSJohn Firebaugh2016-03-221-17/+8
| |
* | [ios] make unit tests work on iOS and iOS SimulatorKonstantin Käfer2016-03-221-6/+8
| |
* | [test] rearrange test files so they're not in the fixtures folderKonstantin Käfer2016-03-221-1/+2
|/
* [core] explicitly initialize a few fields to nullKonstantin Käfer2016-03-041-2/+2
|
* [core] Limit total number of offline Mapbox tilesJohn Firebaugh2016-02-241-0/+57
|
* [core] Enforce foreign key constraints in the offline databaseJohn Firebaugh2016-02-241-1/+9
|
* [core] Fix subtle bug in OfflineDatabase with updated resourcesJohn Firebaugh2016-02-241-13/+37
| | | | | | SQLite REPLACE is *not* UPSERT. If a conflict occurs, it first deletes the existing row, then inserts a new row. This means that AUTOINCREMENT primary keys change. This will break foreign keys to that value, which we use. Instead we must try an UPDATE, and fall back to an INSERT if the UPDATE changes zero rows.
* [core] Optimize offline database schemaJohn Firebaugh2016-02-101-5/+6
| | | | | * Under the hood, SQLite creates surrogate keys (ROWID) anyway. We may as well take advantage of this and use the surrogates for foreign keys as well, since they are simpler and more efficient than compound foreign keys. * Create indexes for efficient eviction queries
* [core] Eliminate maximumCacheEntrySizeJohn Firebaugh2016-02-101-26/+44
| | | | Instead, the eviction policy accounts for the actual size needed for an incoming put.
* [core] Implement an eviction policy for OfflineDatabaseJohn Firebaugh2016-02-101-0/+72
| | | | | | | | | | | | | When inserting an cached resource, or removing a region, remove least-recently used resources and tiles, not used by offline regions, until the used database size, as calculated by multiplying the number of in-use pages by the page size, is less than the maximum cache size minus 5 times the page size. In addition, OfflineDatabase may be configured to ignore cache puts of individual resources larger than a certain size. This policy is similar but not identical to the former SQLiteCache policy: * It accounts for offline, by exempting resources required by offline regions from eviction. * It must delete from two tables (resources and tiles), rather than one. Currently the strategy is naive: evict 50 rows at a time from each table. * It makes maximumCacheSize and maximumCacheEntrySize completely independent. The SQLiteCache implementation evicted when `usedSize > maximumCacheSize - 2 * maximumCacheEntrySize`. This evicts when `usedSize > maximumCacheSize - 5 * pageSize`. * It uses a non-unlimited default value for maximumCacheSize: 50 MB. We should have always had a limit in place; "a cache without an eviction policy is a resource leak".
* [core] Reset SQLite statements after use in order to release locksJohn Firebaugh2016-02-101-0/+32
|
* [core] Interface and implementation for offlineJohn Firebaugh2016-02-101-0/+76
|
* [all] Don't interpret 404s on non-tile resources as "no content"John Firebaugh2016-02-101-7/+7
|
* [core] Reimplement existing caching within an offline-capable database schemaJohn Firebaugh2016-02-101-0/+374