RootRecovery class

Manages the download recovery of all sub-stores of this FMTCRoot


When a download is started, a recovery region is stored in a non-volatile database, and the download ID is stored in volatile memory.

If the download finishes normally, both entries are removed, otherwise, the memory is cleared when the app is closed, but the database record is not removed.

A failed download is one that was found in the recovery database, but not in the application memory. It can therefore be assumed that the download is also no longer in memory, and was therefore stopped unexpectedly, for example after a fatal crash.

The recovery system then allows the original BaseRegion and DownloadableRegion to be recovered (via RecoveredRegion) from the failed download, and the download can be restarted.

During a download, the database recovery entity is updated every tile (or every batch) with the number of completed tiles: this allows the DownloadableRegion.start to have it's value set to skip tiles that have been successfully downloaded. Therefore, no unnecessary tiles are downloaded again.

Note

Options set at download time, in StoreDownload.startForeground, are not included.

Available Extensions

Properties

hashCode int
The hash code for this object.
no setterinherited
recoverableRegions Future<Iterable<({bool isFailed, RecoveredRegion region})>>
List all recoverable regions, and whether each one has failed
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

cancel(int id) Future<void>
Safely cancel the specified recoverable region
getRecoverableRegion(int id) Future<({bool isFailed, RecoveredRegion region})?>
Get a specific region, even if it doesn't need recovering
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited