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

Method readFile

src/client/cli/admin/FileWrapper.cc:74–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72}
73
74CoTryTask<storage::ChecksumInfo> FileWrapper::readFile(std::ostream &out,
75 size_t length,
76 size_t offset,
77 bool checksum,
78 bool hex,
79 storage::client::TargetSelectionMode mode,
80 MD5_CTX *md5 /* = nullptr */,
81 bool fillZero /* = false */,
82 bool verbose /* = false */,
83 uint32_t targetIndex /* = 0 */) {
84 auto routingInfo = env_.mgmtdClientGetter()->getRoutingInfo()->raw();
85 if (routingInfo == nullptr) {
86 co_return makeError(StorageClientCode::kRoutingError, "routing info is null");
87 }
88 auto blocksResult = prepareBlocks(offset, offset + length, *routingInfo);
89 CO_RETURN_AND_LOG_ON_ERROR(blocksResult);
90 auto &blocks = *blocksResult;
91 co_return co_await readFile(env_, out, blocks, checksum, hex, mode, md5, fillZero, verbose, targetIndex);
92}
93
94CoTryTask<storage::ChecksumInfo> FileWrapper::readFile(AdminEnv &env,
95 std::ostream &out,

Callers 3

handleReadFileFunction · 0.80
checksumFileFunction · 0.80
writeFileAndCheckFunction · 0.80

Calls 15

makeErrorFunction · 0.85
createFunction · 0.85
joinFunction · 0.85
rawMethod · 0.80
createReadIOMethod · 0.80
push_backMethod · 0.80
backMethod · 0.80
codeMethod · 0.80
combineMethod · 0.80
formatFunction · 0.70
getRoutingInfoMethod · 0.45
allocateMethod · 0.45

Tested by

no test coverage detected