Table of Contents

Class StoredContentMove

Namespace
MailFathom.Application.EmailContent.Move
Assembly
MailFathom.Application.dll

Carries the payloads a deployment stored in its database into the bucket, one bounded pass at a time.

public sealed class StoredContentMove
Inheritance
StoredContentMove
Inherited Members

Remarks

Selecting the object backend answers where the next payload goes. This answers what becomes of everything stored before that, which is the whole of a mailbox for a deployment that has been synchronizing one for a year: the database keeps the size that motivated the move, and every backup keeps carrying it, until something copies the payloads out.

One payload is copied at a time and nothing is held across the steps. The bytes are read, checked against what the row records, put under a key of their own, read back and checked again, and only then does the row point at the object — which copies rather than moves: the payload the database was holding stays where it is as a retained duplicate, and freeing it is an operator's separate act. So no database transaction is ever open across a call to the endpoint, which is what ADR 0001 requires and what makes the copy safe to run against a live deployment.

A payload that cannot be verified stays exactly where it is. It is counted, its reason is published, and the walk carries on: repointing a row at an object nobody vouched for would turn a storage change into mail that cannot be read, and the worst outcome of a move must be that it did not finish.

Every carried payload is held within RawMimeMemoryBudget, the same process-wide budget synchronization holds messages within. That is what makes the move yield rather than compete: a deployment busy fetching mail leaves the move waiting for room, instead of the two together holding twice the memory either was bounded to.

Constructors

StoredContentMove(IStoredContentMoveRunStore, IStoredContentMoveStore, IEmailContentObjectBackend, RawMimeMemoryBudget, OptimisticConcurrencyRetryPolicy, IStoredContentMoveTelemetry, StoredContentMoveOptions, TimeProvider, AccessAuthorization)

Initializes the move.

Methods

HasMoveToCarryAsync(CancellationToken)

Reports whether the deployment has a move for a pass to carry.

RunAsync(CancellationToken)

Runs one bounded pass of the move, if the deployment has one to carry.