module ara::per — Persistency
ModulegidsAI-GEGENEREERD
Beveiligt gestructureerde sleutel-waardeparen en bestanden persistent, transactieveilig en hardware-geabstraheerd.
Beveiligt gestructureerde sleutel-waardeparen en bestanden persistent, transactieveilig en hardware-geabstraheerd.
De Adaptive-module Persistency (ara::per) biedt een hardware-onafhankelijke abstractielaag voor niet-vluchtige gegevensopslag, die zowel gestructureerde sleutel-waarde-opslag (KeyValueStorage) als bestandsgebaseerde toegang (FileStorage) omvat (EXP_SWArchitecture p. 43). Modificaties van sleutel-waardeparen zijn onderhevig aan in-memory buffering en vereisen een expliciete synchronisatie-aanroep (SyncToStorage) om permanent te worden opgeslagen ([SWS_PER_00049]). Naast gegevensintegriteits- en herstelmechanismen regelt de module ook update- en migratieprocessen bij software-actualisaties ([SWS_PER_00357]).
Het functionele cluster Persistency (ara::per) biedt voor het AUTOSAR Adaptive Platform een gestandaardiseerde abstractielaag voor niet-vluchtige gegevensopslag (EXP_SWArchitecture p. 43). Het biedt twee fundamentele toegangsmodellen: de sleutelgebaseerde opslag KeyValueStorage voor gestructureerde parameters en de bestandsgebaseerde opslag FileStorage voor ongestructureerde payloadstromen (SWS_Persistency p. 219). Zowel Adaptive Applications als centrale platformdaemons zoals State Management, Diagnostic Management of Update and Configuration Management gebruiken deze interfaces om hun toestanden onafhankelijk van fysieke bestandssysteem- of flashdrivers persistent op te slaan (EXP_SWArchitecture p. 93).
Contextdiagram: inbedding van het cluster Persistency in het Adaptive Platform met applicatie- en platformconsumenten en het onderliggende besturingssysteem. Bronnen: EXP_SWArchitecture p. 93, EXP_SWArchitecture p. 43.
Schrijfbewerkingen in KeyValueStorage volgen een strikte in-memory transactiesemantiek ([SWS_PER_00046]). Modificaties van sleutel-waardeparen blijven eerst vluchtig gebufferd en worden pas via de synchrone aanroep SyncToStorage permanent naar het opslagmedium geschreven ([SWS_PER_00049]), terwijl DiscardPendingChanges niet-opgeslagen toestanden verwerpt ([SWS_PER_00365]). In FileStorage vindt de toegang plaats via gespecialiseerde, getypeerde accessors (ReadAccessor, WriteAccessor, ReadWriteAccessor), die exclusief via UniqueHandle worden beheerd ([SWS_PER_00113], [SWS_PER_00114], [SWS_PER_00115]).
Sequentiediagram: schrijf- en synchronisatieverloop van een sleutel-waarde-opslag met in-memory buffering en fysieke flush. Bronnen: [SWS_PER_00046], [SWS_PER_00049], [SWS_PER_00365], EXP_SWArchitecture p. 230.
Daarnaast integreert de module omvangrijke mechanismen voor levenscyclus en fouttolerantie: configuratiewisselingen tijdens runtime worden via CheckForManifestUpdate en ReloadPersistencyManifest verwerkt ([SWS_PER_00576], [SWS_PER_00577]), terwijl applicatiespecifieke gegevensmigraties via update-callbacks plaatsvinden ([SWS_PER_00356], [SWS_PER_00357]). Wanneer manifestgebaseerde redundantie- of integriteitscontroles mislukken, informeren callbacks over de corruptiestatus ([SWS_PER_00433]), waarna beschadigde gegevens met RecoverKeyValueStorage, RecoverFile of door resetbewerkingen kunnen worden gerepareerd ([SWS_PER_00333], [SWS_PER_00337], [SWS_PER_00334]).
Systeemgrenzen en architectuurintegratie van ara::per
Het functionele cluster Persistency (ara::per) biedt gestandaardiseerde abstractiemechanismen voor de niet-vluchtige gegevensopslag op het AUTOSAR Adaptive Platform (EXP_SWArchitecture p. 43). Het ontkoppelt zowel door de gebruiker gedefinieerde applicaties als functionele platformdiensten van besturingssysteemspecifieke bestandssystemen, partitiestructuren en flash- of NVRAM-drivers (EXP_SWArchitecture p. 93). De beschikbaarstelling omvat twee gescheiden primaire opslagparadigma’s: de sleutelgebaseerde gegevenstoegang via KeyValueStorage en de hiërarchische bestandsopslag via FileStorage (SWS_Persistency p. 219). Platformdiensten zoals Diagnostic Management (EXP_SWArchitecture p. 176), State Management (EXP_SWArchitecture p. 55), Update and Configuration Management (SWS_UpdateAndConfigurationManagement p. 18) en Remote Persistency (SWS_RemotePersistency p. 9) gebruiken deze interfaces als gestandaardiseerde port-interfaces ([SWS_PER_00052], [SWS_PER_00116]).
Naast het bieden van lokale opslagabstracties integreert ara::per cryptografische primitieven en redundantiecontroles direct op de interface naar het hostbesturingssysteem (EXP_SWArchitecture p. 230). De functionele configuratie van een persistentieopslag wordt declaratief gemodelleerd in het AUTOSAR-manifest en bindt quota-specificaties, integriteitshashes, CRC-methoden en cryptografische versleutelingspaden aan concrete instanties (SWS_Persistency p. 104). Bibliotheekdelen van andere functionele clusters binden persistentie direct in via eigen target-configuraties, terwijl daemonprocessen net als reguliere applicaties via instance-specifiers toegang hebben tot opslageenheden (SWS_Persistency p. 35).
Contextdiagram: inbedding van het cluster Persistency in het Adaptive Platform met applicatie- en platformconsumenten en het onderliggende besturingssysteem. Bronnen: EXP_SWArchitecture p. 93, EXP_SWArchitecture p. 43.
Sleutel-waarde-opslag: instantiëring, transactiesemantiek en flush-mechanismen
De toegang tot gestructureerde parameters vindt plaats via de klasse ara::per::KeyValueStorage, die via de aanroep ara::per::OpenKeyValueStorage onder opgave van een ara::core::InstanceSpecifier wordt geopend ([SWS_PER_00052]). Het geretourneerde SharedHandle<KeyValueStorage> kapselt het opslagbereik typeveilig in en voorkomt door verwijderde move- en copy-constructors van de basiscontainers een ongecontroleerde duplicatie ([SWS_PER_00322], [SWS_PER_00324], [SWS_PER_00367]). Via SetValue ([SWS_PER_00046]) en GetValue ([SWS_PER_00044], [SWS_PER_00332]) worden sleutel-waardeparen gewijzigd of opgevraagd; daarbij biedt KeyExists ([SWS_PER_00043]) de existentiecontrole en GetAllKeys ([SWS_PER_00042]) de volledige opsomming van alle actieve sleutels.
Schrijf- en wisbewerkingen zijn onderhevig aan een strikte in-memory transactiesemantiek: wijzigingen door SetValue, RemoveKey ([SWS_PER_00047]) of RemoveAllKeys ([SWS_PER_00048]) blijven eerst in de vluchtige buffer van het proces (EXP_SWArchitecture p. 230). Pas de expliciete aanroep van SyncToStorage slaat alle openstaande modificaties atomair en permanent op het fysieke opslagmedium op ([SWS_PER_00049]). Indien nog ongeschreven transactiestappen moeten worden verworpen, zet DiscardPendingChanges de toestand terug naar de status van de laatste SyncToStorage of van het openen ([SWS_PER_00365]). Opslagbehoeften kunnen via GetCurrentValueSize ([SWS_PER_00554]) voor afzonderlijke waarden en geaggregeerd inclusief redundantie- en metadata via GetCurrentKeyValueStorageSize ([SWS_PER_00405]) worden bewaakt (EXP_SWArchitecture p. 231).
Sequentiediagram: schrijf- en synchronisatieverloop van een sleutel-waarde-opslag met in-memory buffering en fysieke flush. Bronnen: [SWS_PER_00046], [SWS_PER_00049], [SWS_PER_00365], EXP_SWArchitecture p. 230.
Bestandsgebaseerde opslagtoegang en getypeerde accessor-hiërarchieën
Voor ongestructureerde gegevensstromen, binaire blokken of logbestanden dient de klasse ara::per::FileStorage, die via ara::per::OpenFileStorage wordt geïnitialiseerd ([SWS_PER_00116]). Binnen een FileStorage-container kunnen aanwezige bestanden via GetAllFileNames worden opgesomd ([SWS_PER_00110]), kan de aanwezigheid ervan via FileExists worden gecontroleerd ([SWS_PER_00112]) of kunnen bestanden via DeleteFile worden verwijderd ([SWS_PER_00111]). De groottequota worden via GetCurrentFileSize ([SWS_PER_00407]) en GetCurrentFileStorageSize ([SWS_PER_00406]) bepaald (EXP_SWArchitecture p. 231).
De bestandstoegang zelf volgt het principe van interfacescheiding via gespecialiseerde accessor-klassen (EXP_SWArchitecture p. 88). Afhankelijk van de vereiste modus (OpenMode, [SWS_PER_00147], combineerbaar via bitsgewijze operatoren [SWS_PER_00144], [SWS_PER_00434]) genereren de factory-methoden exclusieve UniqueHandle-instanties ([SWS_PER_00371], [SWS_PER_00569]):
OpenFileReadOnly([SWS_PER_00114], [SWS_PER_00376], [SWS_PER_00430]): levert eenUniqueHandle<ReadAccessor>voor leesbewerkingen zoalsReadText([SWS_PER_00165], [SWS_PER_00420]),ReadLine([SWS_PER_00119]),GetChar([SWS_PER_00168]),PeekChar([SWS_PER_00167]),ReadBinary([SWS_PER_00421], [SWS_PER_00422]),GetByte([SWS_PER_00419]) enPeekByte([SWS_PER_00418]).OpenFileWriteOnly([SWS_PER_00115], [SWS_PER_00377], [SWS_PER_00431]): levert eenUniqueHandle<WriteAccessor>voor schrijfbewerkingen viaWriteText([SWS_PER_00166]),WriteBinary([SWS_PER_00423]), comfort-streamoperatoren ([SWS_PER_00125]), bestandstruncatie viaSetFileSize([SWS_PER_00428]) evenals het fysieke leegmaken viaSyncToFile([SWS_PER_00122]).OpenFileReadWrite([SWS_PER_00113], [SWS_PER_00375], [SWS_PER_00429]): combineert lees- en schrijfmogelijkheden in éénUniqueHandle<ReadWriteAccessor>.
Gemeenschappelijke positie- en groottebewerkingen zoals GetPosition ([SWS_PER_00162]), SetPosition ([SWS_PER_00163]), relatief navigeren met behulp van MovePosition en enumeratie Origin ([SWS_PER_00146], [SWS_PER_00164]), GetSize ([SWS_PER_00424]) en de bestandseindecontrole IsEof ([SWS_PER_00107]) zijn verankerd in de gemeenschappelijke basisklasse FileAccessor. Uitgebreide bestandsmetadata zoals tijdstempels en aanmaakoorzaken worden via GetFileInfo en de structuur FileInfo uitgelezen ([SWS_PER_00435], [SWS_PER_00436], [SWS_PER_00438], [SWS_PER_00441], [SWS_PER_00442], [SWS_PER_00443], [SWS_PER_00444], [SWS_PER_00445]). Interpretatie: de strikte scheiding in niet-kopieerbare accessor-instanties dient vermoedelijk naast de typeveiligheid primair om concurrerende schrijfconflicten op besturingssysteemniveau deterministisch te voorkomen. Vraag Q-a990a7aa44326447 (open)
Structuurdiagram: interface- en klassehiërarchie van de bestandstoegangsklassen en accessor-handles. Bronnen: [SWS_PER_00113], [SWS_PER_00114], [SWS_PER_00115], EXP_SWArchitecture p. 88.
Levenscyclusbeheer, update-processen en manifestsynchronisatie
Voor software-actualisaties en nieuwe installaties door Update and Configuration Management (UCM) biedt Persistency speciale levenscyclusbewerkingen (EXP_SWArchitecture p. 92). Wordt tijdens de runtime van een applicatie een geactualiseerde doelconfiguratie ingeladen, dan kan de applicatie met behulp van CheckForManifestUpdate vaststellen of er configuratiewijzigingen zijn ([SWS_PER_00576]). Met ReloadPersistencyManifest leest ara::per de geactualiseerde configuratie opnieuw in, waarna gewijzigde opslagdefinities na het volgende sluiten en opnieuw openen actief worden ([SWS_PER_00577]).
Voor de migratie van bestaande applicatiegegevens wordt via RegisterApplicationDataUpdateCallback een callbackfunctie geregistreerd, die door ara::per wordt getriggerd wanneer op basis van afwijkende contractversiestanden een gegevensmigratie vereist is ([SWS_PER_00356]). Puntsgewijze wijzigingen van afzonderlijke elementen kunnen via RegisterDataUpdateIndication worden bewaakt ([SWS_PER_00578]). Het totale proces van persistentie-actualisatie wordt tijdens de verificatiefase door UpdatePersistency in gang gezet ([SWS_PER_00357]). Na een succesvolle actualisatie verwijdert CleanUpPersistency verouderde back-up- en migratiegegevens ([SWS_PER_00567]), terwijl ResetPersistency de opslagbereiken volledig leegmaakt, zodat ze bij het volgende openen initieel opnieuw vanuit het manifest worden aangemaakt ([SWS_PER_00358]).
Sequentiediagram: verloop van een persistentie-actualisatie met configuratiecontrole, callback-migratie en opschoning. Bronnen: [SWS_PER_00356], [SWS_PER_00357], [SWS_PER_00567], [SWS_PER_00576], [SWS_PER_00577], EXP_SWArchitecture p. 92.
Integriteitsbewaking, redundantieafhandeling en herstel
Om gecorrumpeerde gegevensrecords op te vangen, ondersteunen sleutel-waarde- en bestandsopslag configureerbare redundantiekopieën en integriteitsmechanismen (CRC, hash, MAC-authenticatie en versleuteling) (SWS_Persistency p. 104, EXP_SWArchitecture p. 230). Mislukken interne redundantiecontroles, dan kunnen veiligheidsrelevante applicaties via RegisterRecoveryReportCallback worden geïnformeerd ([SWS_PER_00433]). De callback verzendt de RecoveryReportKind (bijv. kKeyValueStorageRecoveryFailed) en de getroffen instanties en sleutels/bestandsnamen ([SWS_PER_00432], EXP_SWArchitecture p. 91).
Voor het doelgericht herstellen van beschadigde gegevens zijn granulaire reparatie- en resetmethoden beschikbaar:
- Herstel: op opslagniveau maken
RecoverKeyValueStorage([SWS_PER_00333]) enRecoverAllFiles([SWS_PER_00335]) de reparatie van gesloten containers mogelijk; op elementniveau herstellenRecoverKey([SWS_PER_00427]) enRecoverFile([SWS_PER_00337]) afzonderlijke beschadigde items volgens een best-effort-principe. - Terugzetten naar fabriekswaarden: via
ResetKeyValueStorage([SWS_PER_00334]) enResetAllFiles([SWS_PER_00336]) kunnen containers worden teruggezet naar de toestand bij eerste levering; analoog zettenResetKey([SWS_PER_00426]) ofResetFile([SWS_PER_00338]) afzonderlijke elementen terug naar hun geconfigureerde begintoestand.
Activiteitendiagram: beslissingspad bij gegevenscorruptie van de redundantiecontrole via callbacks tot het herstel of de reset. Bronnen: [SWS_PER_00333], [SWS_PER_00334], [SWS_PER_00432], [SWS_PER_00433].
Gedrag in het foutgeval
Fouttoestanden worden in ara::per niet via ongecontroleerde C++-exceptions gepropageerd, maar deterministisch weergegeven via het retourtype ara::core::Result ([SWS_PER_00044], [SWS_PER_00113]). De module definieert een eigen foutdomein via GetPerDomain ([SWS_PER_00352]), geïmplementeerd door PerErrorDomain met gestandaardiseerde foutresolutie via Name ([SWS_PER_00314]) en Message ([SWS_PER_00315]) en de enumeratie PerErrc resp. de type-alias Errc ([SWS_PER_00311], [SWS_PER_00411]). Voor omgevingen met geactiveerde exceptions zijn PerException ([SWS_PER_00355], [SWS_PER_00412]) en ThrowAsException ([SWS_PER_00350]) beschikbaar, terwijl MakeErrorCode het aanmaken van platformconforme foutcodes inkapselt ([SWS_PER_00351]).
Typische foutcodes dekken bron- en concurrency-gerelateerde conflicten af: bewerkingen zoals OpenKeyValueStorage ([SWS_PER_00052]), OpenFileStorage ([SWS_PER_00116]), DeleteFile ([SWS_PER_00111]) of RecoverKeyValueStorage ([SWS_PER_00333]) mislukken met kResourceBusy indien het desbetreffende opslagelement al geopend is of parallel door onderhoudsbewerkingen zoals UpdatePersistency wordt gewijzigd. Bij het toewijzen van incompatibele typen meldt SetValue de fout kDataTypeMismatch ([SWS_PER_00046]). Bij fysieke hardwarefouten (PerErrc::kPhysical) wordt gedifferentieerd of er sprake is van een rollback-semantiek (bijv. bij lees- en positiebewerkingen zoals [SWS_PER_00167], [SWS_PER_00168], waarbij de pointers ongewijzigd blijven) of dat gegevenscorruptie zonder rollback-garantie kan optreden (bijv. bij [SWS_PER_00122], [SWS_PER_00166], [SWS_PER_00423]).
Voor de diagnose van synchronisatie- en toegangsfouten genereert de module gestandaardiseerde DLT-logberichten (SWS_Persistency p. 110). Hierbij loggen berichten zoals SyncToStorage (Message-ID 0x80008037), SyncToFile (0x80008036) en DiscardPendingChanges (0x80008038) gedetailleerd de getroffen sleutelverzamelingen en opslagbezettingen, waardoor ook bij onvolledig afsluiten (bijv. via ara::core::Deinitialize) de toestand reconstrueerbaar blijft (SWS_Persistency p. 110).
Verdere gedetailleerde bewijzen
De architectuur en interactie van het persistentiecluster steunen op de volgende normatieve voorschriften en documentlocaties:
- Architecturale interfaces en clusterkoppeling: de beschikbaarstelling van
KeyValueStorageenFileStorageaan bovenliggende platformdaemons is verankerd in EXP_SWArchitecture p. 90, EXP_SWArchitecture p. 87, EXP_SWArchitecture p. 55 (State Management), EXP_SWArchitecture p. 145 (VUCM), EXP_SWArchitecture p. 176 (DM) en SWS_RemotePersistency p. 9. - Opslagberekening en quotacontrole: het bepalen van de gealloceerde groottes op container- en bestandsniveau steunt op [SWS_PER_00405], [SWS_PER_00406], [SWS_PER_00407] en de bijbehorende interactiescenario’s in EXP_SWArchitecture p. 231 en EXP_SWArchitecture p. 231.
- Transactie-integriteit en crypto-koppeling: het tweetraps commit-verloop via in-memory beheer en de beveiliging met behulp van de Cryptography Stack zijn gebaseerd op [SWS_PER_00049], [SWS_PER_00365] en EXP_SWArchitecture p. 230.
- Actualisatie- en migratieframework: de coördinatie van software-updates en manifest-reloads wordt gespecificeerd via [SWS_PER_00356], [SWS_PER_00357], [SWS_PER_00567], [SWS_PER_00576], [SWS_PER_00577] en EXP_SWArchitecture p. 92.
Deze modulehandleiding is gebaseerd op de specificaties van de AUTOSAR Adaptive-release R25-11. De uitspraken steunen uitsluitend op de bindende SWS-eisen en de bijbehorende architectuurdocumenten.
function: 116 class: 10 enumeration: 6 variable: 5 type alias: 2 struct: 1
Klassen
FileAccessorFileInfoFileStorageKeyValueStoragePerErrorDomainPerExceptionReadAccessorReadWriteAccessorSharedHandleUniqueHandleWriteAccessorFuncties
CheckForManifestUpdateCleanUpPersistencyGetCurrentFileStorageSizeGetCurrentKeyValueStorageSizeGetPerDomainMakeErrorCodeOpenFileStorageOpenKeyValueStorageoperator|operator|=RecoverAllFilesRecoverKeyValueStorageRegisterApplicationDataUpdateCallbackRegisterDataUpdateIndicationRegisterRecoveryReportCallbackReloadPersistencyManifestResetAllFilesResetKeyValueStorageResetPersistencyUpdatePersistencyEnumeraties
FileCreationStateFileModificationStateOpenModeOriginPerErrcRecoveryReportKindThemakaart
ara::per
37Geen elementgegevens voor deze release
ara::per
FileAccessor contains a common basis for ReadAccessor and WriteAccessor
basis voor ReadAccessor, WriteAccessor
This structure contains additional information on a file returned by GetFileInfo.
The File Storage contains a set of files identified by their file names.
The Key-Value Storage contains a set of keys with associated values.
Defines the error domain for Persistency.
erft van ara::core::ErrorDomain
Exception type thrown by Persistency.
erft van ara::core::Exception
ReadWriteAccessor is used to read and write file data
erft van ReadAccessor, WriteAccessor
Handle to a ReadAccessor or ReadWriteAccessor
Checks for updates of the Persistency Target Configuration. This method can be used to detect configuration updates that are installed by UCM while the Adaptive Application that uses Persistency is running. To re-read the updated Target Configuration, the Adaptive Application needs to call ara::per:: ReloadPersistencyManifest.
ara::core::Result< bool > CheckForManifestUpdate () noexcept;Removes backup data and other unused data of all Persistency Key-Value Storages and File Storages.
ara::core::Result< void > CleanUpPersistency () noexcept;Returns the space in bytes currently occupied by a File Storage. The returned size includes all metadata and the space used for redundancy and backups. The returned size is only guaranteed to be accurate if the File Storage is not opened and no other operation on the File Storage takes place at the same time.
ara::core::Result< std::uint64_t > GetCurrentFileStorageSize (const ara::core::InstanceSpecifier &fs) noexcept;Returns the space in bytes currently occupied by a Key-Value Storage. The returned size includes all metadata and the space used for redundancy and backups. The returned size is only guaranteed to be accurate if the Key-Value Storage is not opened and no other operation on the Key-Value Storage takes place at the same time.
ara::core::Result< std::uint64_t > GetCurrentKeyValueStorageSize (const ara::core::InstanceSpecifier &kvs) noexcept;Returns the global PerErrorDomain object.
constexpr const ara::core::ErrorDomain & GetPerDomain () noexcept;Creates an error code.
constexpr ara::core::ErrorCode MakeErrorCode (PerErrc code, ara::core::ErrorDomain::SupportDataType data) noexcept;Opens a File Storage. OpenFileStorage will fail with kResourceBusy when the File Storage is currently being modified by a call from another thread to UpdatePersistency, CleanUpPersistency, ResetPersistency, RecoverAllFiles, or ResetAllFiles. Because multiple threads can access the same File Storage concurrently, the File Storage might not be closed when the SharedHandle returned by this function goes out of scope. It will only be closed when all SharedHandles that refer to the same File Storage went out of scope.
ara::core::Result< SharedHandle< FileStorage > > OpenFileStorage (const ara::core::InstanceSpecifier &fs) noexcept;Opens a Key-Value Storage. OpenKeyValueStorage will fail with kResourceBusy when the Key-Value Storage is currently being modified by a call from another thread to UpdatePersistency, CleanUpPersistency, Reset Persistency, RecoverKeyValueStorage, or ResetKeyValueStorage. Because multiple threads can access the same Key-Value Storage concurrently, the Key-Value Storage might not be closed when the SharedHandle returned by this function goes out of scope. It will only be closed when all SharedHandles that refer to the same Key-Value Storage went out of scope.
ara::core::Result< SharedHandle< KeyValueStorage > > OpenKeyValue Storage (const ara::core::InstanceSpecifier &kvs) noexcept;Recovers a File Storage, including all files. RecoverAllFiles recovers a File Storage when the redundancy checks fail. It will fail with kResourceBusy when the File Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, ResetPersistency, RecoverAllFiles, or ResetAllFiles. This method does a best-effort recovery of all files. After recovery, files might show outdated or initial content, or might be lost.
ara::core::Result< void > RecoverAllFiles (const ara::core::Instance Specifier &fs) noexcept;Recovers a Key-ValueStorage. RecoverKeyValueStorage allows to recover a Key-Value Storage when the redundancy checks fail. It will fail with kResourceBusy when the Key-Value Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, Reset Persistency, RecoverKeyValueStorage, or ResetKeyValueStorage. This method does a best-effort recovery of all key-value pairs. After recovery, keys might show outdated or initial value, or might be lost.
ara::core::Result< void > RecoverKeyValueStorage (const ara::core::InstanceSpecifier &kvs) noexcept;Registers an application data update callback with Persistency. The provided callback function will be called by Persistency if an update of stored application data might be necessary. This decision is based on the contract versions. The contract version that last accessed Persistency is provided as an argument to the callback, as well as the ara::core::InstanceSpecifier referring to the updated Key- Value Storage or File Storage. Based on this information, the Adaptive Application can decide which updates are actually necessary, e.g. a migration from any older contract version could be supported, with different steps required for each of these. The provided function will be called from the context of ara::per::UpdatePersistency, ara::per::OpenKeyValueStorage, or ara::per::OpenFileStorage.
void RegisterApplicationDataUpdateCallback (std::function< void(const ara::core::InstanceSpecifier &storage, ara::core::String contract Version)> appDataUpdateCallback) noexcept;Registers a data update indication callback with Persistency. The provided callback function will be called by Persistency when an update of stored data happened. It will be called from the context of ara::per::UpdatePersistency, ara:: per::OpenKeyValueStorage, or ara::per::OpenFileStorage.
void RegisterDataUpdateIndication (std::function< void(const ara::core::InstanceSpecifier &updatedStorage, ara::core::StringView updatedElement)> dataUpdateIndication, ara::core::InstanceSpecifier monitoredStorage, ara::core::Vector< ara::core::String > monitored Elements) noexcept;Register a recovery reporting callback with Persistency. This callback can be used in safety-aware Adaptive Applications to detect actions of the Persistency that are related to the correctness of the persisted data and the reliability of the storage.
void RegisterRecoveryReportCallback (std::function< void(const ara::core::InstanceSpecifier &storage, ara::per::RecoveryReportKind recoveryReportKind, ara::core::Vector< ara::core::String > reported Elements, ara::core::Vector< std::uint8_t > reportedInstances)> recoveryReportCallback) noexcept;Re-reads the Target Configuration. This method can be used to prepare for updates of the Key-Value Storages and File Storages of Persistency after a new Target Configuration was installed by UCM while the Adaptive Application that uses Persistency is running. Storages are only updated after closing them, either when they are opened again or by an explicit call to ara:: per::UpdatePersistency.
ara::core::Result< void > ReloadPersistencyManifest () noexcept;Resets a File Storage, including all files. ResetAllFiles resets a File Storage to the initial state, containing only the files which were deployed from the Target Configuration, with their initial content. Afterwards, the File Storage will appear as if it was newly installed from the current Target Configuration. It will fail with kResourceBusy when the File Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, ResetPersistency, RecoverAllFiles, or ResetAllFiles.
ara::core::Result< void > ResetAllFiles (const ara::core::Instance Specifier &fs) noexcept;Resets a Key-Value Storage to the initial state. ResetKeyValueStorage allows to reset a Key-Value Storage to the initial state, containing only key-value pairs which were deployed from the Target Configuration, with their initial values. Afterwards, the Key-Value Storage will appear as if it was newly installed from the current Target Configuration. It will fail with kResourceBusy when the Key-Value Storage is currently open, or when it is modified by a call from another thread to UpdatePersistency, CleanUpPersistency, Reset Persistency, RecoverKeyValueStorage, or ResetKeyValueStorage.
ara::core::Result< void > ResetKeyValueStorage (const ara::core::InstanceSpecifier &kvs) noexcept;Resets all Key-Value Storages and File Storages by entirely removing their content. The Key-Value Storages and File Storages will be re-created when ara::per:: OpenFileStorage or ara::per::OpenKeyValueStorage is called next time.
ara::core::Result< void > ResetPersistency () noexcept;Updates all Persistency Key-Value Storages and File Storages after a new Target Configuration was installed. This method can be used to update the persistent data of the Adaptive Application during verification phase.
ara::core::Result< void > UpdatePersistency () noexcept;This enumeration describes how and when a file was created.
enum class FileCreationState : std::uint32_t {...};This enumeration describes how and when a file was last modified.
enum class FileModificationState : std::uint32_t {...};This enumeration defines how a file shall be opened. The values can be combined (using | and |=) as long as they do not contradict each other.
enum class OpenMode : std::uint32_t {...};Specification of origin used in MovePosition.
enum class Origin : std::uint32_t {...};Defines the errors for Persistency. The enumeration values 0 - 255 are reserved for AUTOSAR assigned errors, the stack provider is free to define additional errors starting from 256.
enum class PerErrc : ara::core::ErrorDomain::CodeType {...};Defines the reported recovery actions.
enum class RecoveryReportKind : std::uint32_t {...};Namespaces
- ara::per 11 Klassen, 20 freie Funktionen
UML-klassendiagram van de module
Abgerundete Rahmen = Namespaces; hohle Dreieckspfeile = Vererbung (zeigt zur Basisklasse); graue Boxen = modulfremde bzw. externe Basisklassen. Klicken öffnet die Klassenseite.
gemini-3.8-flash-low· 2026-10-13 · Duits origineel