class ContentStreamPruner implements ContentRepositoryServiceInterface (View source)

For implementation details of the content stream states and removed state, see {ContentStreamForPruning}.

Methods

__construct(EventStoreInterface $eventStore, EventNormalizer $eventNormalizer, SubscriptionEngine $subscriptionEngine)

No description

bool
outputStatus(Closure $outputFn)

Detects if dangling content streams exists and which content streams could be pruned from the event stream

void
removeDanglingContentStreams(Closure $outputFn, DateTimeImmutable $removeTemporaryBefore)

Removes all nodes, hierarchy relations and content stream entries which are not needed anymore from the projections.

void
pruneRemovedFromEventStream(Closure $outputFn)

Prune removed content streams that are unused from the event stream; effectively REMOVING information completely.

Details

__construct(EventStoreInterface $eventStore, EventNormalizer $eventNormalizer, SubscriptionEngine $subscriptionEngine)

No description

Parameters

EventStoreInterface $eventStore
EventNormalizer $eventNormalizer
SubscriptionEngine $subscriptionEngine

bool outputStatus(Closure $outputFn)

Detects if dangling content streams exists and which content streams could be pruned from the event stream

Dangling content streams

Content streams that are not removed via the event ContentStreamWasRemoved and are not in use by a workspace (not a current's workspace content stream).

Previously before Neos 9 beta 15 (#5301), dangling content streams were not removed during publishing, discard or rebase.

{\Neos\ContentRepository\Core\Service\removeDanglingContentStreams}

Pruneable content streams

Content streams that were removed ContentStreamWasRemoved e.g. after publishing, and are not required for a full replay to reconstruct the current projections state. The ability to reconstitute a previous state will be lost.

{\Neos\ContentRepository\Core\Service\pruneRemovedFromEventStream}

Parameters

Closure $outputFn

Return Value

bool

false if dangling content streams exist because they should not

void removeDanglingContentStreams(Closure $outputFn, DateTimeImmutable $removeTemporaryBefore)

Removes all nodes, hierarchy relations and content stream entries which are not needed anymore from the projections.

NOTE: This still keeps the event stream as is; so it would be possible to re-construct the content stream at a later point in time.

To prune the removed content streams from the event stream, call {\Neos\ContentRepository\Core\Service\ContentStreamPruner::pruneRemovedFromEventStream()} afterwards.

Parameters

Closure $outputFn
DateTimeImmutable $removeTemporaryBefore

includes all temporary content streams like FORKED or CREATED older than that in the removal

Return Value

void

void pruneRemovedFromEventStream(Closure $outputFn)

Prune removed content streams that are unused from the event stream; effectively REMOVING information completely.

Note that replaying to only a previous point in time would not be possible anymore as workspace would reference non-existing content streams.

Parameters

Closure $outputFn

Return Value

void

See also

findRemovedContentStreamsThatAreUnused for implementation