Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch md access in the rechunker #711

Merged
merged 1 commit into from
Feb 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions strax/storage/file_rechunker.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def rechunker(source_directory: str,
dest_directory, _temp_dir = _get_dest_and_tempdir(dest_directory, replace, backend_key)

backend = strax.FileSytemBackend(set_target_chunk_mb=target_size_mb)
meta_data = _get_meta_data(backend, source_directory, compressor, target_size_mb)
source_compressor = meta_data['compressor']
meta_data, source_compressor = _get_meta_data_and_compressor(
backend, source_directory, compressor, target_size_mb)
executor = _get_executor(parallel, max_workers)

data_loader = backend.loader(source_directory, executor=executor)
Expand Down Expand Up @@ -172,13 +172,14 @@ def _exhaust_generator(executor, saver, load_wrapper, data_loader, rechunk, _tim
executor.shutdown(wait=True)


def _get_meta_data(backend, source_directory, compressor, target_size_mb):
def _get_meta_data_and_compressor(backend, source_directory, compressor, target_size_mb):
meta_data = backend.get_metadata(source_directory)
old_compressor = meta_data['compressor']
if compressor is not None:
meta_data['compressor'] = compressor
if target_size_mb is not None:
meta_data['chunk_target_size_mb'] = target_size_mb
return meta_data
return meta_data, old_compressor


def _get_executor(parallel, max_workers):
Expand Down