MCPcopy Create free account
hub / github.com/apache/arrow / SlowFileSystemFactory

Function SlowFileSystemFactory

cpp/src/arrow/filesystem/localfs_test.cc:97–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95};
96
97Result<std::shared_ptr<FileSystem>> SlowFileSystemFactory(const Uri& uri,
98 const io::IOContext& io_context,
99 std::string* out_path) {
100 auto local_uri = "file" + uri.ToString().substr(uri.scheme().size());
101 ARROW_ASSIGN_OR_RAISE(auto base_fs, FileSystemFromUri(local_uri, io_context, out_path));
102 double average_latency = 1;
103 int32_t seed = 0xDEADBEEF;
104 ARROW_ASSIGN_OR_RAISE(auto params, uri.query_items());
105 for (const auto& [key, value] : params) {
106 if (key == "average_latency") {
107 average_latency = std::stod(value);
108 }
109 if (key == "seed") {
110 seed = std::stoi(value, nullptr, /*base=*/16);
111 }
112 }
113 return std::make_shared<SlowFileSystemPublicProps>(base_fs, average_latency, seed);
114}
115auto kSlowFileSystemModule =
116 ARROW_REGISTER_FILESYSTEM("slowfile", SlowFileSystemFactory, {});
117

Callers

nothing calls this directly

Calls 4

substrMethod · 0.80
ToStringMethod · 0.45
sizeMethod · 0.45
schemeMethod · 0.45

Tested by

no test coverage detected