xintongsong commented on code in PR #311:
URL: https://github.com/apache/flink-agents/pull/311#discussion_r2559250119
##########
api/src/main/java/org/apache/flink/agents/api/context/MemoryRef.java:
##########
@@ -47,12 +47,12 @@ public static MemoryRef create(String path) {
/**
* Resolves the reference using the provided RunnerContext to get the
actual data.
*
- * @param ctx The current execution context, used to access Short-Term
Memory.
+ * @param memory The memory this ref based on.
* @return The deserialized, original data object.
* @throws Exception if the memory cannot be accessed or the data cannot
be resolved.
*/
- public MemoryObject resolve(RunnerContext ctx) throws Exception {
- return ctx.getShortTermMemory().get(this);
+ public MemoryObject resolve(MemoryObject memory) throws Exception {
Review Comment:
We should store the information that whether a memory object belongs to
short-term or long-term memory in the MemoryRef. Otherwise, we are leaving
users the chance to make mistake and try to resolve the reference from the
wrong memory type.
##########
python/flink_agents/api/memory_reference.py:
##########
@@ -48,17 +48,17 @@ def create(path: str) -> MemoryRef:
"""
return MemoryRef(path=path)
- def resolve(self, ctx: RunnerContext) -> Any:
+ def resolve(self, memory: MemoryObject) -> Any:
Review Comment:
ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]