Skip to content

Commit 0871e70

Browse files
fix: code formate fix
1 parent 8317337 commit 0871e70

14 files changed

Lines changed: 131 additions & 126 deletions

mooncake-integration/store/store_py.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,8 +1571,7 @@ PYBIND11_MODULE(store, m) {
15711571
const std::vector<std::vector<uintptr_t>>& all_buffer_ptrs,
15721572
const std::vector<std::vector<size_t>>& all_sizes,
15731573
bool aggregate_same_segment_task = false,
1574-
const std::optional<ReadConfigExt>& config_opt =
1575-
std::nullopt) {
1574+
const std::optional<ReadConfigExt>& config_opt = std::nullopt) {
15761575
ReadConfigExt config = config_opt.value_or(ReadConfigExt{});
15771576
py::gil_scoped_release release;
15781577
if (self.use_dummy_client_) {

mooncake-store/include/client_rpc_types.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ struct WriteCommitRequest {
107107

108108
YLT_REFL(WriteCommitRequest, key, pending_write_token);
109109

110-
/** Drops a pending PreWrite allocation without committing (e.g. after TE failure). */
110+
/** Drops a pending PreWrite allocation without committing (e.g. after TE
111+
* failure). */
111112
struct WriteRevokeRequest {
112113
std::string_view key;
113114
UUID pending_write_token;

mooncake-store/include/client_service.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ class ClientService {
158158
*/
159159
virtual tl::expected<int64_t, ErrorCode> Get(
160160
const std::string& key, const std::vector<void*>& buffers,
161-
const std::vector<size_t>& sizes,
162-
const ReadConfigExt& config = {}) = 0;
161+
const std::vector<size_t>& sizes, const ReadConfigExt& config = {}) = 0;
163162

164163
/**
165164
* @brief Batch get data into user-provided buffers

mooncake-store/include/data_manager.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class DataManager {
202202
* Used when forward TE fails after PreWrite on the peer.
203203
*/
204204
tl::expected<void, ErrorCode> WriteRevoke(std::string_view key,
205-
const UUID& pending_write_token);
205+
const UUID& pending_write_token);
206206

207207
tl::expected<PinKeyResponse, ErrorCode> PinKey(
208208
std::string_view key, std::optional<UUID> tier_id = std::nullopt);
@@ -350,8 +350,9 @@ class DataManager {
350350
const std::vector<RemoteBufferDesc>& remote_buffers,
351351
Transport::TransferRequest::OpCode opcode);
352352

353-
tl::expected<std::vector<std::tuple<Transport::BatchID, size_t, std::string>>,
354-
ErrorCode>
353+
tl::expected<
354+
std::vector<std::tuple<Transport::BatchID, size_t, std::string>>,
355+
ErrorCode>
355356
SubmitTeTransferBatches(void* transfer_ptr, size_t total_data_size,
356357
const std::vector<RemoteBufferDesc>& remote_buffers,
357358
Transport::TransferRequest::OpCode opcode);

mooncake-store/include/p2p_rpc_types.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ struct WriteConfigExt {
4949
RdmaDirectionMode rdma_direction_mode = RdmaDirectionMode::REVERSE;
5050

5151
WriteConfigExt() = default;
52-
/** Promotes legacy write-route-only config for variant overload resolution. */
52+
/** Promotes legacy write-route-only config for variant overload resolution.
53+
*/
5354
WriteConfigExt(WriteRouteRequestConfig r) : route_config(std::move(r)) {}
5455
};
5556
YLT_REFL(WriteConfigExt, route_config, rdma_direction_mode);

mooncake-store/include/pyclient.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,13 @@ class PyClient {
4444

4545
virtual std::vector<int64_t> batch_get_into(
4646
const std::vector<std::string>& keys, const std::vector<void*>& buffers,
47-
const std::vector<size_t>& sizes,
48-
const ReadConfigExt& config = {}) = 0;
47+
const std::vector<size_t>& sizes, const ReadConfigExt& config = {}) = 0;
4948

5049
virtual std::vector<int> batch_get_into_multi_buffers(
5150
const std::vector<std::string>& keys,
5251
const std::vector<std::vector<void*>>& all_buffers,
5352
const std::vector<std::vector<size_t>>& all_sizes,
54-
bool aggregate_same_segment_task,
55-
const ReadConfigExt& config = {}) = 0;
53+
bool aggregate_same_segment_task, const ReadConfigExt& config = {}) = 0;
5654

5755
virtual int put_from(const std::string& key, void* buffer, size_t size,
5856
const WriteConfig& config) = 0;

mooncake-store/include/real_client.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,7 @@ class RealClient : public PyClient {
406406
const ReadConfigExt& config = {});
407407

408408
std::vector<std::shared_ptr<BufferHandle>> batch_get_buffer_internal(
409-
const std::vector<std::string>& keys,
410-
const ReadConfigExt& config = {});
409+
const std::vector<std::string>& keys, const ReadConfigExt& config = {});
411410

412411
std::map<std::string, std::vector<Replica::Descriptor>>
413412
batch_get_replica_desc(const std::vector<std::string>& keys);

mooncake-store/src/centralized_client_service.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ CentralizedClientService::Query(const std::string& object_key,
242242
}
243243
std::chrono::steady_clock::time_point start_time =
244244
std::chrono::steady_clock::now();
245-
auto result = master_client_.GetReplicaList(object_key, config.route_config);
245+
auto result =
246+
master_client_.GetReplicaList(object_key, config.route_config);
246247
if (!result) {
247248
LOG(ERROR) << "Failed to get replica list: " << result.error();
248249
return tl::unexpected(result.error());
@@ -262,8 +263,7 @@ CentralizedClientService::Query(const std::string& object_key,
262263

263264
std::vector<tl::expected<std::unique_ptr<QueryResult>, ErrorCode>>
264265
CentralizedClientService::BatchQuery(
265-
const std::vector<std::string>& object_keys,
266-
const ReadConfigExt& config) {
266+
const std::vector<std::string>& object_keys, const ReadConfigExt& config) {
267267
auto guard = AcquireInflightGuard();
268268
if (!guard.is_valid()) {
269269
LOG(ERROR) << "client is shutting down";
@@ -279,7 +279,8 @@ CentralizedClientService::BatchQuery(
279279
std::chrono::steady_clock::now();
280280
std::vector<std::string_view> key_views(object_keys.begin(),
281281
object_keys.end());
282-
auto response = master_client_.BatchGetReplicaList(key_views, config.route_config);
282+
auto response =
283+
master_client_.BatchGetReplicaList(key_views, config.route_config);
283284

284285
// Check if we got the expected number of responses
285286
if (response.size() != object_keys.size()) {

mooncake-store/src/data_manager.cpp

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,8 @@ DataManager::PutViaTe(std::string_view key, std::vector<Slice>& slices) {
509509
return tl::unexpected(validate_result.error());
510510
}
511511

512-
// Local Put: allocation follows tier backend policy (not restricted to DRAM).
512+
// Local Put: allocation follows tier backend policy (not restricted to
513+
// DRAM).
513514
auto prewrite_result =
514515
PreWriteInternal(kctx, total_size, std::nullopt, false);
515516
if (!prewrite_result) {
@@ -882,8 +883,7 @@ tl::expected<UUID, ErrorCode> DataManager::WriteRemoteData(
882883

883884
// Reverse RDMA path: still one RPC, but internally use the 3-phase write
884885
// model (PreWrite -> transfer -> WriteCommit). Target tier may be non-DRAM.
885-
auto prewrite_result =
886-
PreWriteInternal(kctx, total_size, tier_id, false);
886+
auto prewrite_result = PreWriteInternal(kctx, total_size, tier_id, false);
887887
if (!prewrite_result) {
888888
timer.LogResponse("error_code=", prewrite_result.error());
889889
return tl::make_unexpected(prewrite_result.error());
@@ -926,10 +926,9 @@ tl::expected<PreWriteResponse, ErrorCode> DataManager::PreWrite(
926926
return PreWriteInternal(BuildKeyCtx(key), size_bytes, tier_id, true);
927927
}
928928

929-
tl::expected<PreWriteResponse, ErrorCode>
930-
DataManager::PreWriteInternal(const KeyCtx& ctx, size_t size_bytes,
931-
std::optional<UUID> tier_id,
932-
bool enforce_dram_allocation) {
929+
tl::expected<PreWriteResponse, ErrorCode> DataManager::PreWriteInternal(
930+
const KeyCtx& ctx, size_t size_bytes, std::optional<UUID> tier_id,
931+
bool enforce_dram_allocation) {
933932
ScopedVLogTimer timer(1, "DataManager::PreWrite");
934933
timer.LogRequest("key=", ctx.key, "size_bytes=", size_bytes);
935934

@@ -963,11 +962,11 @@ DataManager::PreWriteInternal(const KeyCtx& ctx, size_t size_bytes,
963962

964963
auto handle = std::move(handle_result.value());
965964
// When enforce_dram_allocation is true (RPC PreWrite): only DRAM is wired
966-
// for forward TE today; non-DRAM tiers TODO. Local Put / WriteRemoteData use
967-
// false and skip this check.
968-
if (enforce_dram_allocation &&
969-
handle->loc.data.type != MemoryType::DRAM) {
970-
timer.LogResponse("error_code=", ErrorCode::UNAVAILABLE_IN_CURRENT_MODE);
965+
// for forward TE today; non-DRAM tiers TODO. Local Put / WriteRemoteData
966+
// use false and skip this check.
967+
if (enforce_dram_allocation && handle->loc.data.type != MemoryType::DRAM) {
968+
timer.LogResponse("error_code=",
969+
ErrorCode::UNAVAILABLE_IN_CURRENT_MODE);
971970
return tl::make_unexpected(ErrorCode::UNAVAILABLE_IN_CURRENT_MODE);
972971
}
973972
auto list_it = shard.ordered_list.emplace(shard.ordered_list.end(),
@@ -1075,7 +1074,8 @@ tl::expected<PinKeyResponse, ErrorCode> DataManager::PinKeyInternal(
10751074
RemoveExpiredPinnedKeyLocked(shard, ctx.key_string, now);
10761075
auto record_it = shard.by_key.find(ctx.key_string);
10771076
if (record_it != shard.by_key.end()) {
1078-
// PinKey forward path: DRAM-only for now; non-DRAM replica handling TODO.
1077+
// PinKey forward path: DRAM-only for now; non-DRAM replica handling
1078+
// TODO.
10791079
if (record_it->second.handle->loc.data.type != MemoryType::DRAM) {
10801080
timer.LogResponse("error_code=",
10811081
ErrorCode::UNAVAILABLE_IN_CURRENT_MODE);
@@ -1103,7 +1103,8 @@ tl::expected<PinKeyResponse, ErrorCode> DataManager::PinKeyInternal(
11031103
auto handle = std::move(handle_result.value());
11041104
// PinKey forward path: DRAM-only for now; non-DRAM replica handling TODO.
11051105
if (handle->loc.data.type != MemoryType::DRAM) {
1106-
timer.LogResponse("error_code=", ErrorCode::UNAVAILABLE_IN_CURRENT_MODE);
1106+
timer.LogResponse("error_code=",
1107+
ErrorCode::UNAVAILABLE_IN_CURRENT_MODE);
11071108
return tl::make_unexpected(ErrorCode::UNAVAILABLE_IN_CURRENT_MODE);
11081109
}
11091110
auto list_it = shard.ordered_list.emplace(shard.ordered_list.end(),
@@ -1275,8 +1276,8 @@ DataManager::SubmitTeTransferInternal(
12751276
std::move(buffer_result.value());
12761277
}
12771278

1278-
auto batches_result = SubmitTeTransferBatches(
1279-
transfer_ptr, total_data_size, remote_buffers, opcode);
1279+
auto batches_result = SubmitTeTransferBatches(transfer_ptr, total_data_size,
1280+
remote_buffers, opcode);
12801281
if (!batches_result) {
12811282
return tl::unexpected(batches_result.error());
12821283
}

0 commit comments

Comments
 (0)