| 20 | } |
| 21 | |
| 22 | void TryDeleteCacheFile(const std::string& file) { |
| 23 | // Don't throw, this is called in a destructor. |
| 24 | auto exists = std::filesystem::exists(file); |
| 25 | if (!exists) { |
| 26 | LOG(WARNING) << "External memory cache file " << file << " is missing."; |
| 27 | } |
| 28 | if (std::remove(file.c_str()) != 0) { |
| 29 | LOG(WARNING) << "Couldn't remove external memory cache file " << file |
| 30 | << "; you may want to remove it manually"; |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | std::string MakeCachePrefix(std::string cache_prefix) { |
| 35 | std::string_view constexpr kDftname{"DMatrix"}; |
no test coverage detected