Interface CompactionStrategy
- All Known Implementing Classes:
WindowCompactionStrategy
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Decides what leaves a session's active view. A strategy is policy, not storage: given
the view it says which events leave it (covered), which stay at its front (pinned),
which recent events are kept verbatim (preserved), and what summary stands in for the
covered ones; it never writes.
SessionService.compact(java.lang.String, org.springframework.ai.session.compaction.CompactionTrigger, org.springframework.ai.session.compaction.CompactionStrategy) records the decision by
appending a CompactionBoundary event and the summary events.- Since:
- 2.1.0
- Author:
- Christian Tzolov
-
Method Summary
Modifier and TypeMethodDescriptioncompact(CompactionRequest request) Decides how to compact the view.
-
Method Details
-
compact
Decides how to compact the view.- Parameters:
request- the session, its active view and the view's turn count- Returns:
- the decision;
CompactionResult.unchanged()when nothing should leave the view
-