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

Method clearPermanently

src/traffic_cache_tool/CacheTool.cc:882–910  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

880}
881
882void
883Span::clearPermanently()
884{
885 if (OPEN_RW_FLAG) {
886 alignas(512) static char zero[CacheStoreBlocks::SCALE]; // should be all zero, it's static.
887 std::cout << "Clearing " << _path.string() << " permanently on disk ";
888 ssize_t n = pwrite(_fd, zero, sizeof(zero), ts::CacheSpan::OFFSET);
889 if (n == sizeof(zero)) {
890 std::cout << "done";
891 } else {
892 const char *text = strerror(errno);
893 std::cout << "failed";
894 if (n >= 0) {
895 std::cout << " - " << n << " of " << sizeof(zero) << " bytes written";
896 }
897 std::cout << " - " << text;
898 }
899
900 std::cout << std::endl;
901 // clear the stripes as well
902 for (auto *strp : _stripes) {
903 strp->loadMeta();
904 std::cout << "Clearing stripe @" << strp->_start << " of length: " << strp->_len << std::endl;
905 strp->clear();
906 }
907 } else {
908 std::cout << "Clearing " << _path.string() << " not performed, write not enabled" << std::endl;
909 }
910}
911
912// explicit pair for random table in build_vol_hash_table
913struct rtable_pair {

Callers 2

Clear_SpansFunction · 0.80
Clear_SpanFunction · 0.80

Calls 3

loadMetaMethod · 0.80
stringMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected