| 51 | } // namespace |
| 52 | |
| 53 | void createTraceDirectory(const std::string& traceDir) { |
| 54 | try { |
| 55 | std::unordered_map<std::string, std::string> emptyConfigStrs; |
| 56 | auto emptyConfig = |
| 57 | std::make_shared<config::ConfigBase>(std::move(emptyConfigStrs)); |
| 58 | const auto fs = filesystems::getFileSystem(traceDir, emptyConfig); |
| 59 | if (fs->exists(traceDir)) { |
| 60 | fs->rmdir(traceDir); |
| 61 | } |
| 62 | fs->mkdir(traceDir); |
| 63 | } catch (const std::exception& e) { |
| 64 | BOLT_FAIL( |
| 65 | "Failed to create trace directory '{}' with error: {}", |
| 66 | traceDir, |
| 67 | e.what()); |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | std::string getQueryTraceDirectory( |
| 72 | const std::string& traceDir, |