diff options
author | Magnus Ahltorp <map@kth.se> | 2015-02-07 00:21:34 +0100 |
---|---|---|
committer | Magnus Ahltorp <map@kth.se> | 2015-02-07 00:21:34 +0100 |
commit | 80c67e6b663a42a2fea866cd677d7088a25adfd3 (patch) | |
tree | 88d4c04fbfb522a4980f3d6ed8404738d4dd77bd /tools/merge.py | |
parent | 1911dfcf194f858a5e9eec4f735f651e685df7c0 (diff) |
New entries per node should be a set. Chunk sendlog.
Diffstat (limited to 'tools/merge.py')
-rwxr-xr-x | tools/merge.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/merge.py b/tools/merge.py index 974bab0..f4a007d 100755 --- a/tools/merge.py +++ b/tools/merge.py @@ -169,8 +169,8 @@ entries_to_fetch = {} for storagenode in storagenodes: print "getting new entries from", storagenode - new_entries_per_node[storagenode] = get_new_entries(storagenode) - new_entries.update(set(new_entries_per_node[storagenode])) + new_entries_per_node[storagenode] = set(get_new_entries(storagenode)) + new_entries.update(new_entries_per_node[storagenode]) entries_to_fetch[storagenode] = [] timing_point(timing, "get new entries") @@ -191,7 +191,8 @@ for hash in new_entries: added_entries = 0 for storagenode in storagenodes: - for chunk in chunks(entries_to_fetch[storagenode], 10): + print "getting", len(entries_to_fetch[storagenode]), "entries from", storagenode + for chunk in chunks(entries_to_fetch[storagenode], 100): entries = get_entries(storagenode, chunk) for hash in chunk: entry = entries[hash] @@ -231,7 +232,11 @@ for frontendnode in frontendnodes: timing_point(timing, "get curpos") print "current position", curpos entries = [base64.b64encode(entry) for entry in logorder[curpos:]] - sendlog(frontendnode, {"start": curpos, "hashes": entries}) + for chunk in chunks(entries, 1000): + sendlog(frontendnode, {"start": curpos, "hashes": chunk}) + curpos += len(chunk) + print curpos, + sys.stdout.flush() timing_point(timing, "sendlog") print "log sent" missingentries = get_missingentries(frontendnode) |