Repository navigation
Add clean-up support for archives and resources - #268
Merged
Merged
Conversation
epavese
reviewed
Nov 11, 2026
epavese
reviewed
Nov 11, 2026
epavese
reviewed
Nov 11, 2026
epavese
reviewed
Nov 11, 2026
epavese
reviewed
Nov 11, 2026
epavese
reviewed
Nov 11, 2026
epavese
reviewed
Nov 11, 2026
VeaaC
reviewed
Nov 11, 2026
VeaaC
reviewed
Nov 11, 2026
VeaaC
reviewed
Nov 11, 2026
VeaaC
reviewed
Nov 11, 2026
Collaborator
|
You need to sign off the commits (see failed DCO checks) |
ChaoJia
force-pushed
the
cleanup_support
branch
from
November 11, 2026 13:57
08785e5 to
74d4d13
Compare
VeaaC
approved these changes
Nov 17, 2026
Signed-off-by: Chao Jia <chao.jia@here.com>
Signed-off-by: Chao Jia <chao.jia@here.com>
Signed-off-by: Chao Jia <chao.jia@here.com>
Signed-off-by: Chao Jia <chao.jia@here.com>
Signed-off-by: Chao Jia <chao.jia@here.com>
Co-authored-by: epavese <epavese@gmail.com> Signed-off-by: Chao Jia <chao.jia@here.com>
Signed-off-by: Chao Jia <chao.jia@here.com>
Signed-off-by: Chao Jia <chao.jia@here.com>
ChaoJia
force-pushed
the
cleanup_support
branch
from
November 25, 2026 09:02
6c66284 to
f70431d
Compare
…dition Signed-off-by: Chao Jia <chao.jia@here.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the ability to remove an archive's resources and their
.schemacompanions from aMemoryResourceStorageorFileResourceStorage(TarArchiveResourceStoragenot supported), and to overwrite an existing archive on request. Implemented for flatdata-cpp and flatdata-rs. This allows us to reliably clean up the data written by an archive builder before rebuilding the archive.Each individual resource can be removed by its dedicated cleanup function. An archive builder's cleanup function removes all the resources written by it and all of its sub-archives (essentially recursive call).
Cleanup can fail if only schema file or the data file exists, or the schema file doesn't match the expected schema, or filesystem calls for file removal fails. On cleanup failure, the cpp implementation returns
false, and rust returnsstd::io::Error.cpp:
static bool clean_up_<name>(ResourceStorage&), and each archive builder getsbool clean_up(ResourceStorage&).clean_upfor an archive builder also removes all the sub-archives.open(storage, force_overwrite = false),set_*andstart_*takeforce_overwrite. When it is set, existing data is cleaned up first by calling theclean_upfunctions.rust:
pub fn clean_up_<name>(&self)and a static versionpub fn clean_up_<name>(storage: flatdata::StorageHandle). The static version is mainly used by the archive builder'spub fn clean_up(storage: flatdata::StorageHandle).