Conversation
🤖 Augment PR SummarySummary: This PR refactors tiering offload/stash code by centralizing serialization-descriptor computation behind a new abstraction. Changes:
Technical Notes: Behavior for stashing strings and listpack-encoded hashes is preserved while reusing the descriptor in both scheduling and completion paths. 🤖 Was this summary useful? React with 👍 or 👎 |
There was a problem hiding this comment.
Pull request overview
This PR introduces a FragmentRef class in the dfly::tiering namespace that encapsulates value introspection and serialization description logic previously spread across a free function (DetermineSerializationParams) and the StashDescriptor struct. FragmentRef wraps a CompactValue* and exposes methods like IsOffloaded, HasStashPending, ClearStashPending, ObjType, and GetSerializationDescr. StashDescriptor now inherits from FragmentRef::SerializationDescr, and CancelStash/ShouldStash signatures are updated to accept FragmentRef.
Changes:
- New
FragmentRefclass added tosrc/core/tiering_types.h/.cc, centralizing serialization introspection TieredStorage::StashDescriptorupdated to inherit fromFragmentRef::SerializationDescr;CancelStashandShouldStashsignatures updated to accepttiering::FragmentReftiering_types.ccadded to thedfly_coreCMake library target
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/core/tiering_types.h |
Defines new FragmentRef class and nested SerializationDescr struct |
src/core/tiering_types.cc |
Implements FragmentRef::GetDescr (moved from DetermineSerializationParams) |
src/core/CMakeLists.txt |
Adds tiering_types.cc to dfly_core build target |
src/server/tiered_storage.h |
Updates StashDescriptor, ShouldStash, CancelStash, and adds unimplemented GetStashParams private method |
src/server/tiered_storage.cc |
Updates call sites to use FragmentRef, removes DetermineSerializationParams |
Move DetermineSerializationParams logic into a new FragmentRef class in the tiering namespace. FragmentRef wraps a CompactValue* and exposes IsOffloaded, HasStashPending, ClearStashPending, ObjType, and GetSerializationDescr methods. StashDescriptor now inherits from FragmentRef::SerializationDescr. CancelStash and ShouldStash updated to accept FragmentRef instead of PrimeValue*. Signed-off-by: Roman Gershman <roman@dragonflydb.io>
Summary
DetermineSerializationParamslogic into a newFragmentRefclass in thetieringnamespaceFragmentRefwraps aCompactValue*and exposesIsOffloaded,HasStashPending,ClearStashPending,ObjType, andGetSerializationDescrStashDescriptornow inherits fromFragmentRef::SerializationDescrCancelStashandShouldStashupdated to acceptFragmentRefinstead ofPrimeValue*🤖 Generated with Claude Code