There is a risk here of two threads calling this method concurrently with the same ``k`` and overwriting the source file instance persisted in the ``sourceFiles`` map. At the moment, because of the implementation of ``BatchSourceFile``, this doesn't seem to lead to any issue. However, if we don't ensure atomicity here, changes in ``BatchSourceFile`` may lead to incorrectness (and since we don't own that code, maybe we should consider locking just to avoid any potential issue.)

Also, the safe alternative would be to use ``sourceFiles.putIfAbsent``. Though, it comes with a performance price, which is why I'm not of the idea we should use it here.