Loading README.md +1 −1 Original line number Diff line number Diff line Loading @@ -227,7 +227,7 @@ The following modules are available: module will only be available if the client library is built in `Debug` mode. - `all`: All previous options combined. - `traces_reads`: Generate log line with extra information in read operations for guided distributor - `trace_reads`: Generate log line with extra information in read operations for guided distributor - `help`: Print a help message and exit. When tracing sytem calls, specific syscalls can be removed from log messages by Loading examples/distributors/guided/generate.py +5 −5 Original line number Diff line number Diff line Loading @@ -10,14 +10,14 @@ # SPDX-License-Identifier: MIT ### #!/usr/bin/python3 import re import sys import collections file = sys.argv[1] pattern = re.compile(r".+(read )(.*)( host: )(\d+).+(path: )(.+),.+(chunk_start: )(\d+).+(chunk_end: )(\d+)") pattern = re.compile(r".+(read\ )(.*)( host: )(\d+).+(path: )(.+),.+(chunk_start: )(\d+).+(chunk_end: )(\d+)") d = collections.OrderedDict() Loading @@ -25,7 +25,7 @@ with open(file) as f: for line in f: result = pattern.match(line) if result: d[result[2]] = 1 d[result.group(2)] = 1 keys = sorted(d.keys()) i = 0 for key in keys: Loading @@ -36,5 +36,5 @@ with open(file) as f: for line in f: result = pattern.match(line) if result: for i in range(int(result[8]), int(result[10])+1): print (result[6], i, d[result[2]]) for i in range(int(result.group(8)), int(result.group(10))+1): print (result.group(6), i, d[result.group(2)]) src/global/rpc/distributor.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -122,7 +122,11 @@ GuidedDistributor::init_guided() { while (mapfile >> path >> chunk_id >> destination_host) { // We need destination+1, as 0 has an special meaning in the interval map. auto I = map_interval.find(path); if (I == map_interval.end()) map_interval[path] += make_pair( boost::icl::discrete_interval<chunkid_t>::right_open (chunk_id, chunk_id+1), destination_host+1); else if (I->second.find(chunk_id) == I->second.end()) I->second.insert( make_pair( boost::icl::discrete_interval<chunkid_t>::right_open (chunk_id, chunk_id+1), destination_host+1) ); } mapfile.close(); return true; Loading Loading
README.md +1 −1 Original line number Diff line number Diff line Loading @@ -227,7 +227,7 @@ The following modules are available: module will only be available if the client library is built in `Debug` mode. - `all`: All previous options combined. - `traces_reads`: Generate log line with extra information in read operations for guided distributor - `trace_reads`: Generate log line with extra information in read operations for guided distributor - `help`: Print a help message and exit. When tracing sytem calls, specific syscalls can be removed from log messages by Loading
examples/distributors/guided/generate.py +5 −5 Original line number Diff line number Diff line Loading @@ -10,14 +10,14 @@ # SPDX-License-Identifier: MIT ### #!/usr/bin/python3 import re import sys import collections file = sys.argv[1] pattern = re.compile(r".+(read )(.*)( host: )(\d+).+(path: )(.+),.+(chunk_start: )(\d+).+(chunk_end: )(\d+)") pattern = re.compile(r".+(read\ )(.*)( host: )(\d+).+(path: )(.+),.+(chunk_start: )(\d+).+(chunk_end: )(\d+)") d = collections.OrderedDict() Loading @@ -25,7 +25,7 @@ with open(file) as f: for line in f: result = pattern.match(line) if result: d[result[2]] = 1 d[result.group(2)] = 1 keys = sorted(d.keys()) i = 0 for key in keys: Loading @@ -36,5 +36,5 @@ with open(file) as f: for line in f: result = pattern.match(line) if result: for i in range(int(result[8]), int(result[10])+1): print (result[6], i, d[result[2]]) for i in range(int(result.group(8)), int(result.group(10))+1): print (result.group(6), i, d[result.group(2)])
src/global/rpc/distributor.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -122,7 +122,11 @@ GuidedDistributor::init_guided() { while (mapfile >> path >> chunk_id >> destination_host) { // We need destination+1, as 0 has an special meaning in the interval map. auto I = map_interval.find(path); if (I == map_interval.end()) map_interval[path] += make_pair( boost::icl::discrete_interval<chunkid_t>::right_open (chunk_id, chunk_id+1), destination_host+1); else if (I->second.find(chunk_id) == I->second.end()) I->second.insert( make_pair( boost::icl::discrete_interval<chunkid_t>::right_open (chunk_id, chunk_id+1), destination_host+1) ); } mapfile.close(); return true; Loading