presto-raptor-legacy/src/main/java/io/prestosql/plugin/raptor/legacy/metadata/ShardCleaner.java/ShardCleaner/cleanLocalShardsImmediately
class ShardCleaner:    @VisibleForTesting
    synchronized void cleanLocalShardsImmediately(Set<UUID> local)
    {
        // get shards assigned to the local node
        Set<UUID> assigned = dao.getNodeShards(currentNode, null).stream()
                .map(ShardMetadata::getShardUuid)
                .collect(toSet());

        // only delete local files that are not assigned
        Set<UUID> deletions = Sets.difference(local, assigned);

        for (UUID uuid : deletions) {
            deleteFile(storageService.getStorageFile(uuid));
        }

        localShardsCleaned.update(deletions.size());
        log.info("Cleaned %s local shards immediately", deletions.size());
    }