Mooncake/mooncake-store/include/cachelib_memory_allocator
JinYan Su bde2fcaa13
refactor: introduce expected pattern for error handling in master service (#562)
* refactor: introduce expected pattern for error handling in master service

- Replace ErrorCode return types with tl::expected<T, ErrorCode> pattern
- Improve error handling clarity by separating success values from error codes
- Update MasterService methods to return expected<void, ErrorCode> or expected<T, ErrorCode>
- Modify RPC service interfaces to support expected pattern
- Update all related tests to handle new expected return types
- Add necessary includes for ylt/util/expected.hpp

This change makes error handling more explicit and type-safe:
- Success cases can be accessed via .value()
- Error cases can be accessed via .error()
- Eliminates ambiguity between success and error states

Future work:
- Extend expected pattern to RPC response types
- Enhance error code system for more comprehensive error handling

* Refactor error handling to use expected<T,E> pattern instead of ErrorCode

- Updated MasterService methods to replace ylt::expected with tl::expected for better error handling.
- Modified BatchGetReplicaList, BatchPutStart, BatchPutEnd, and other methods to return tl::expected types.
- Enhanced ClientIntegrationTest to handle expected results from Put, Get, Remove, and other operations using tl::expected.
- Adjusted error handling in clientctl and master_metrics_test to utilize the new expected type.
- Improved overall error reporting in tests to provide clearer feedback on operation failures.

* fix test compile

* refactor: update client implementation and remove master.proto

- Enhanced client.h and client.cpp with new functionality
- Removed obsolete master.proto file
- Updated master_client.cpp and transfer_task.cpp
- Improved integration and stress tests

* fix: update Python integration to work with new batch API

- Replace BatchObjectInfo with vector<vector<Replica::Descriptor>>
- Update BatchPut to handle new return type vector<tl::expected<void, ErrorCode>>
- Fix BatchQuery API usage to work with new expected pattern
- Convert unordered_map to vector format for BatchPut parameter compatibility

* refine master log and metric

* fix(ci): should alloc first

* merge main

* fix tests
2025-07-03 14:54:06 +08:00
..
common [MooncakeStore] Introduce MooncakeStore: A new Distributed Object Store for XpYd PD disaggregation (#126) 2025-03-07 15:57:54 +08:00
fake_include/folly [CI] Add spell check process to CI (#165) 2025-03-25 09:50:29 +08:00
include [CI] Add spell check process to CI (#165) 2025-03-25 09:50:29 +08:00
AllocationClass.h [CI] Add spell check process to CI (#165) 2025-03-25 09:50:29 +08:00
MemoryAllocator.h [CI] Add spell check process to CI (#165) 2025-03-25 09:50:29 +08:00
MemoryPool.h [MooncakeStore] Introduce MooncakeStore: A new Distributed Object Store for XpYd PD disaggregation (#126) 2025-03-07 15:57:54 +08:00
MemoryPoolManager.h [MooncakeStore] Introduce MooncakeStore: A new Distributed Object Store for XpYd PD disaggregation (#126) 2025-03-07 15:57:54 +08:00
Slab.h refactor: introduce expected pattern for error handling in master service (#562) 2025-07-03 14:54:06 +08:00
SlabAllocator.h [CI] Add spell check process to CI (#165) 2025-03-25 09:50:29 +08:00