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

Function SlowFileSystemFactory

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

Source from the content-addressed store, hash-verified

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

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