Commit 662a3566 by serpucga

Refactoring and documenting

Names of variables enhanced for clarity, old and unused code removed, some changes in the logs and lots of new docstrings.
parent 34170f35
......@@ -17,8 +17,8 @@ parser.add_argument("-v", "--verbose", action="store_true")
parser.add_argument("database", type=str)
args = parser.parse_args()
# Activate logging
logformat = "[%(asctime)s]: %(message)s"
# Logging config
logformat = "[%(asctime)s] %(message)s"
dateformat = "%H:%M:%S"
if args.verbose:
logging.basicConfig(
......@@ -45,7 +45,7 @@ client.close()
# Build a picklable function that we can pass to map
def write_page(
def process_data_page(
page, host=args.host, port=args.port, database=args.database,
pagesize=args.pagesize, header=header, outputdir=output_dir,
queue=task_queue):
......@@ -54,14 +54,14 @@ def write_page(
host, port, database, header, output_dir, pagesize, page, queue)
# Single process to write to the filesystem
# Launch single process to write to the filesystem
writer_worker = mp.Process(
target=utils.filesystem_writer, args=(task_queue, header, ))
writer_worker.start()
# Make the computation
# Launch pool of workers to perform the format conversion
with mp.Pool() as pool:
pool.map(write_page, page_index)
pool.map(process_data_page, page_index)
task_queue.put("END")
utils.generate_metadata_file(output_dir)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment