MCPcopy Create free account
hub / github.com/deepseek-ai/3FS / scanTree

Function scanTree

src/client/cli/admin/ScanTree.cc:157–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155};
156
157CoTryTask<Dispatcher::OutputTable> scanTree(IEnv &ienv,
158 const argparse::ArgumentParser &parser,
159 const Dispatcher::Args &args) {
160 auto &env = dynamic_cast<AdminEnv &>(ienv);
161 ENSURE_USAGE(args.empty());
162 Dispatcher::OutputTable table;
163
164 auto path = parser.present<std::string>("--path");
165 auto inodeId = parser.present<uint64_t>("--inode");
166 auto output = parser.present<std::string>("--output");
167
168 ENSURE_USAGE(inodeId.has_value() || path.has_value(), "set inodeId or path");
169
170 ScanTree scan(env.userInfo,
171 *env.metaClientGetter(),
172 meta::PathAt{meta::InodeId(inodeId.value_or(env.currentDirId.u64())), path});
173 auto result = co_await scan.run(8, 128);
174 CO_RETURN_AND_LOG_ON_ERROR(result);
175
176 table.push_back({"Path", "Status"});
177 for (const auto &path : *result) {
178 table.push_back({path.path.native(), path.error.describe()});
179 }
180
181 co_return table;
182}
183
184CoTryTask<void> registerScanTree(Dispatcher &dispatcher) {
185 co_return co_await dispatcher.registerHandler(getParser, scanTree);

Callers

nothing calls this directly

Calls 8

InodeIdClass · 0.85
value_orMethod · 0.80
push_backMethod · 0.80
emptyMethod · 0.45
has_valueMethod · 0.45
u64Method · 0.45
runMethod · 0.45
describeMethod · 0.45

Tested by

no test coverage detected