| 72 | } |
| 73 | |
| 74 | CoTryTask<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 | |
| 94 | CoTryTask<storage::ChecksumInfo> FileWrapper::readFile(AdminEnv &env, |
| 95 | std::ostream &out, |