MCPcopy Create free account
hub / github.com/apache/trafficserver / Find_Stripe

Function Find_Stripe

src/traffic_cache_tool/CacheTool.cc:1175–1210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1173}
1174
1175void
1176Find_Stripe(swoc::file::path const &input_file_path)
1177{
1178 // scheme=http user=u password=p host=172.28.56.109 path=somepath query=somequery port=1234
1179 // input file format: scheme://hostname:port/somepath;params?somequery user=USER password=PASS
1180 // user, password, are optional; scheme and host are required
1181
1182 // char* h= http://user:pass@IPADDRESS/path_to_file;?port <== this is the format we need
1183 // url_matcher matcher;
1184 // if (matcher.match(h))
1185 // std::cout << h << " : is valid" << std::endl;
1186 // else
1187 // std::cout << h << " : is NOT valid" << std::endl;
1188
1189 Cache cache;
1190 if (!input_file_path.empty()) {
1191 printf("passed argv %s\n", input_file_path.c_str());
1192 }
1193 cache.loadURLs(input_file_path);
1194 if ((err = cache.loadSpan(SpanFile))) {
1195 cache.dumpSpans(Cache::SpanDumpDepth::SPAN);
1196 cache.build_stripe_hash_table();
1197 for (auto host : cache.URLset) {
1198 CryptoContext ctx;
1199 CryptoHash hashT;
1200 swoc::LocalBufferWriter<33> w;
1201 ctx.update(host->url.data(), host->url.size());
1202 ctx.update(&host->port, sizeof(host->port));
1203 ctx.finalize(hashT);
1204 StripeSM *stripe_ = cache.key_to_stripe(&hashT, host->url.data(), host->url.size());
1205 w.print("{}", hashT);
1206 printf("hash of %.*s is %.*s: Stripe %s \n", static_cast<int>(host->url.size()), host->url.data(),
1207 static_cast<int>(w.size()), w.data(), stripe_->hashText.data());
1208 }
1209 }
1210}
1211
1212void
1213dir_check()

Callers 1

mainFunction · 0.85

Calls 12

loadURLsMethod · 0.80
loadSpanMethod · 0.80
dumpSpansMethod · 0.80
emptyMethod · 0.45
c_strMethod · 0.45
updateMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
finalizeMethod · 0.45
key_to_stripeMethod · 0.45
printMethod · 0.45

Tested by

no test coverage detected