in azure/datalake/store/multithread.py [0:0]
def run(self, nthreads=None, monitor=True):
""" Populate transfer queue and execute downloads
Parameters
----------
nthreads: int [None]
Override default nthreads, if given
monitor: bool [True]
To watch and wait (block) until completion.
"""
def touch(self, src, dst):
root = os.path.dirname(dst)
if not os.path.exists(root) and root:
# don't attempt to create current directory
logger.debug('Creating directory %s', root)
try:
os.makedirs(root)
except OSError as e:
if e.errno != errno.EEXIST:
raise
logger.debug('Creating empty file %s', dst)
with open(dst, 'wb'):
pass
for empty_directory in self.client._adlfs._empty_dirs_to_add():
local_rel_rpath = str(AzureDLPath(self.rpath).trim().globless_prefix)
path = os.path.join(self.lpath, os.path.relpath(empty_directory['name'], local_rel_rpath))
try:
os.makedirs(path)
except OSError as e:
if e.errno != errno.EEXIST:
raise
self.client.run(nthreads, monitor, before_start=touch)