Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Expose READ_ONLY_MODE_KEY property for DatabaseFileSource #16183

Merged
merged 4 commits into from
Feb 7, 2020

Conversation

pozdnyakov
Copy link
Contributor

@pozdnyakov pozdnyakov commented Feb 6, 2020

This PR exposes DatabaseFileSource property, which allows to re-open the offline database in read-only mode and thus improves the performance for the set ups that do not require the offline database modifications. Example of usage:

auto fileSource = mbgl::FileSourceManager::get()->getFileSource(
    mbgl::FileSourceType::Database, resourceOptions);
fileSource->setProperty(READ_ONLY_MODE_KEY, true);

Tag https://github.com/mapbox/mapbox-gl-native-team/issues/169

@pozdnyakov pozdnyakov self-assigned this Feb 6, 2020
@pozdnyakov pozdnyakov force-pushed the mikhail_readonly_database_api branch from f505271 to d978098 Compare February 6, 2020 22:06
@pozdnyakov pozdnyakov marked this pull request as ready for review February 7, 2020 11:02
Copy link
Contributor

@alexshalamov alexshalamov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, would be nice to create issue for setProperty that would have optional callback to indicate that setter has failed.

@pozdnyakov pozdnyakov added Core The cross-platform C++ core, aka mbgl offline labels Feb 7, 2020
@pozdnyakov pozdnyakov force-pushed the mikhail_readonly_database_api branch from 4fa109c to 6017b6a Compare February 7, 2020 11:32
@pozdnyakov pozdnyakov merged commit 489adb8 into master Feb 7, 2020
@pozdnyakov pozdnyakov deleted the mikhail_readonly_database_api branch February 7, 2020 12:39
@pozdnyakov pozdnyakov added the performance Speed, stability, CPU usage, memory usage, or power usage label Feb 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl offline performance Speed, stability, CPU usage, memory usage, or power usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants