I am not sure, what you are asking is possible. But you can control the size of the same using below properties.
We could set below parameters to restrict the size of local directories under NM and trigger DeletionService when the limit is reached.
Details under: https://blog.cloudera.com/resource-localization-in-yarn-deep-dive/
The yarn.nodemanager.localizer.cache.target-size-mb property defines decides the maximum disk space to be used for localizing resources. Once the total disk size of the cache exceeds the value defined in this property the deletion service will try to remove files which are not used by any running containers.
The yarn.nodemanager.localizer.cache.cleanup.interval-ms: defines this interval for the delete the unused resources if total cache size exceeds the configured max-size. Unused resources are those resources which are not referenced by any running container.