(table_data_generator, row_count)
| 90 | |
| 91 | |
| 92 | def estimate_bytes_per_row(table_data_generator, row_count): |
| 93 | original_row_count = table_data_generator.row_count |
| 94 | original_output_file = table_data_generator.output_file |
| 95 | table_data_generator.row_count = row_count |
| 96 | table_data_generator.output_file = BytesIO() |
| 97 | table_data_generator.populate_output_file() |
| 98 | table_data_generator.output_file.flush() |
| 99 | bytes_per_row = len(table_data_generator.output_file.getvalue()) / float(row_count) |
| 100 | table_data_generator.output_file.close() |
| 101 | table_data_generator.output_file = original_output_file |
| 102 | table_data_generator.row_count = original_row_count |
| 103 | return max(int(bytes_per_row), 1) |
| 104 | |
| 105 | |
| 106 | def estimate_rows_per_reducer(table_data_generator, mb_per_reducer): |
no test coverage detected