172 from .AthenaMPFlags
import jobproperties
as jp
173 from PyUtils.MetaReaderPeeker
import metadata
175 if (jp.AthenaMPFlags.ChunkSize() > 0):
176 chunk_size = jp.AthenaMPFlags.ChunkSize()
177 msg.info(
'Chunk size set to %i', chunk_size)
178 elif metadata[
'file_size']
is not None:
180 if (jp.AthenaMPFlags.UseSharedReader()):
181 msg.info(
'Shared Reader in use, chunk_size set to default (%i)', chunk_size)
183 elif (jp.AthenaMPFlags.ChunkSize() == -1):
184 if (metadata[
'file_comp_alg'] == 2):
185 chunk_size = metadata[
'auto_flush']
186 msg.info(
'Chunk size set to auto flush (%i)', chunk_size)
188 msg.info(
'LZMA algorithm not in use, chunk_size set to default (%i)', chunk_size)
190 elif (jp.AthenaMPFlags.ChunkSize() == -2):
191 if (metadata[
'file_comp_alg'] == 1
or metadata[
'file_comp_alg'] == 2):
192 chunk_size = metadata[
'auto_flush']
193 msg.info(
'Chunk size set to auto flush (%i)', chunk_size)
195 msg.info(
'LZMA nor ZLIB in use, chunk_size set to default (%i)', chunk_size)
197 elif (jp.AthenaMPFlags.ChunkSize() == -3):
198 if (metadata[
'file_comp_alg'] == 1
or metadata[
'file_comp_alg'] == 2
or metadata[
'file_comp_alg'] == 4):
199 chunk_size = metadata[
'auto_flush']
200 msg.info(
'Chunk size set to auto flush (%i)', chunk_size)
202 msg.info(
'LZMA, ZLIB nor LZ4 in use, chunk_size set to (%i)', chunk_size)
204 elif (jp.AthenaMPFlags.ChunkSize() <= -4):
205 chunk_size = metadata[
'auto_flush']
206 msg.info(
'Chunk size set to auto flush (%i)', chunk_size)
208 msg.warning(
'Invalid ChunkSize, Chunk Size set to default (%i)', chunk_size)