Repository navigation
Release v1.0.12
Release 1.0.12: chunked processing, transaction per chunk, supportsBatch/anonymizeBatch
Changelog
Added
- Chunked processing and bounded memory:
AnonymizeService::anonymizeEntity()now loads records in chunks ofbatch_size(LIMIT/OFFSET with ORDER BY primary key) instead of loading all rows at once. Memory usage is bounded by the configured batch size. A singleCOUNT(*)query is run once for progress reporting. - Transaction per chunk: All updates for a chunk are committed in one transaction (one commit per chunk instead of per row), improving throughput when using a custom anonymizer or property-based anonymization.
- EntityAnonymizerServiceInterface: Two new methods for custom anonymizer services:
supportsBatch(): bool— Returntrueto have the bundle callanonymizeBatch()once per chunk;falseto callanonymize()for each record.anonymizeBatch(EntityManagerInterface $em, ClassMetadata $metadata, array $records, bool $dryRun): array— Receives the full chunk of records and returns a maprecord index => (column => new value). Only called whensupportsBatch()returnstrue.
Changed
- EntityAnonymizerServiceInterface (breaking): The interface now requires three methods:
supportsBatch(),anonymize(), andanonymizeBatch(). Existing implementations must addsupportsBatch()andanonymizeBatch(). For record-by-record behavior, returnfalsefromsupportsBatch()and implementanonymizeBatch()e.g. by delegating toanonymize()per record (see demos and USAGE.md).
Fixed
(none)
Documentation
- CONFIGURATION.md:
batch_sizedescription updated to state that it limits rows loaded per query (memory) and that one transaction is committed per chunk (performance). - USAGE.md: Section "Anonymizing via a custom service" updated with the three interface methods and the record-by-record vs batch behaviour.
Commits
- Release 1.0.12 - Chunked processing, EntityAnonymizerServiceInterface batch support (d858b0b)