FulcrumFS FulcrumFS
FulcrumFS FulcrumFS
DocFX + Singulink = ♥

Search Results for

    Method DeleteVariantsAsync

    DeleteVariantsAsync(FileId, params ReadOnlySpan<string>)

    Permanently retires the specified variants of a file, automatically preserving any dependent variants the caller did not list.

    Declaration
    public ValueTask<IReadOnlyList<string>> DeleteVariantsAsync(FileId fileId, params ReadOnlySpan<string> variantIds)
    Parameters
    Type Name Description
    FileId fileId

    The ID of the file whose variants should be retired.

    ReadOnlySpan<string> variantIds

    The full set of variant IDs the caller owns and wants retired. Duplicates are ignored and ordering is irrelevant.

    Returns
    Type Description
    ValueTask<IReadOnlyList<string>>

    The normalized IDs of the variants this call retired, in ordinal order, or an empty list if none needed retiring. Listed IDs that were already retired, have been cleaned up or never existed are not included, and neither are unlisted dependents that were promoted or re-pointed to preserve them.

    Implements
    IFileRepo.DeleteVariantsAsync(FileId, params ReadOnlySpan<string>)
    Remarks

    Pass every variant ID you want gone. Any variant that is not listed but depends (via an alias) on a listed variant is automatically preserved: the earliest-created surviving dependent is promoted to a standalone data file and the remaining survivors are re-pointed at it before the listed source is retired. To retire a variant together with its dependents, simply include those dependents in the list.

    This API is intended for permanent retirement of variant IDs. Downstream consumers, notably static file hosts serving repo files by URL, typically depend on stable variant identity, and the repository does not provide an atomic delete-then-add "replacement" story. The normal way to update a variant is to add a new variant under a new ID, transition consumers to the new ID, and then retire the old one.

    Retirement is not part of a repository transaction: it commits on its own as it runs, so it cannot be ordered with an application's database commit. An application that records variant IDs in its database must therefore tolerate a recorded variant being gone, for example by regenerating it on demand with GetOrAddVariantAsync(FileId, string, string?, IFileProcessingPipelineSelector, CancellationToken), rather than rely on the retirement and its database update committing together.

    Retirement is visible to fetches immediately: GetVariantAsync(FileId, string) throws RepoFileNotFoundException against a retired variant even while the underlying data file may still linger on disk in deferred-delete mode. Within a single call, every listed variant's retirement is committed (its in-group delete marker written) before any physical teardown begins, so a concurrent fetch never observes a partially-applied subset (modulo the brief window between individual delete marker writes).

    Whether physical removal of data files is immediate or deferred is governed by DeleteMode. The method is fully idempotent: an empty list, already-retired variants, fully cleaned-up variants, and never-existed variant IDs are all silently skipped and left out of the returned list.

    Exceptions
    Type Condition
    InvalidOperationException

    The repository was opened read-only.

    © Singulink. All rights reserved.