class Prune

Prune orphaned fields and registry entries from any-mode tag hashes.

Lazy flush can leave hash fields behind when cache values are deleted directly instead of through the tagged cache.

Constants

private DEFAULT_SCAN_COUNT

Default number of hash fields to process per HSCAN iteration.

Methods

__construct(StoreContext $context, RemoveEmptyTags $removeEmptyTags)

Create a new prune operation instance.

array
execute(int $scanCount = self::DEFAULT_SCAN_COUNT)

Execute the prune operation.

string
removeOrphanedFieldsScript()

Remove fields only while their corresponding cache keys are absent.

Details

at line 26
__construct(StoreContext $context, RemoveEmptyTags $removeEmptyTags)

Create a new prune operation instance.

Parameters

StoreContext $context
RemoveEmptyTags $removeEmptyTags

at line 41
array execute(int $scanCount = self::DEFAULT_SCAN_COUNT)

Execute the prune operation.

The empty_hashes_deleted statistic includes hashes found already empty or absent. Redis deletes a hash automatically when its final field is removed.

Parameters

int $scanCount

Number of fields per HSCAN iteration

Return Value

array

at line 296
protected string removeOrphanedFieldsScript()

Remove fields only while their corresponding cache keys are absent.

Return Value

string