AS AgentScopeAPI 手册 / API Reference

RedisStateVersionSupport

public final class RedisStateVersionSupport
源码Source io/agentscope/extensions/redis/state/RedisStateVersionSupport.java:24–104

Redis 状态版本 Support,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.extensions.redis.state 包。核心成员包括 versionKey、parseVersion、saveScriptKeys、saveScriptArgs、unconditionalSaveArgs、VERSION_SUFFIX。

Shared optimistic-concurrency helpers for Redis-backed io.agentscope.core.state.AgentStateStore implementations.

字段摘要Field Summary

字段Field类型Type说明Description
VERSION_SUFFIX
staticfinal
String
版本 SUFFIX字段。
Redis key suffix for the monotonic version counter of a single state value.
UNCONDITIONAL
staticfinal
String
UNCONDITIONAL字段。
Lua `ARGV[2]` sentinel for unconditional overwrite inside `#SAVE_SCRIPT`.
SAVE_SCRIPT
staticfinal
String
保存 SCRIPT字段。
Atomically compare-and-set or unconditionally bump a versioned payload.

方法摘要Method Summary

方法Method说明Description
public static String versionKey(String payloadKey)
static
设置版本键。
Performs the version key operation.
public static long parseVersion(String payload, String versionValue)
static
解析版本。
Parses the version.
public static List<String> saveScriptKeys(String payloadKey, String versionKey, String keysKey)
static
保存 `saveScriptKeys`。
Saves the script keys.
public static List<String> saveScriptArgs(String payload, long expectedVersion, String keyMember)
static
保存 `saveScriptArgs`。
Saves the script args.
public static List<String> unconditionalSaveArgs(String payload, String keyMember)
static
执行 `unconditionalSaveArgs` 方法。
Performs the unconditional save args operation.

字段详情Field Detail

VERSION_SUFFIX

public static final String VERSION_SUFFIX
staticfinal

版本 SUFFIX字段。声明为 public static final String VERSION_SUFFIX。

Redis key suffix for the monotonic version counter of a single state value.

源码Source io/agentscope/extensions/redis/state/RedisStateVersionSupport.java:27

UNCONDITIONAL

public static final String UNCONDITIONAL
staticfinal

UNCONDITIONAL字段。声明为 public static final String UNCONDITIONAL。

Lua ARGV[2] sentinel for unconditional overwrite inside #SAVE_SCRIPT.

源码Source io/agentscope/extensions/redis/state/RedisStateVersionSupport.java:30

SAVE_SCRIPT

public static final String SAVE_SCRIPT
staticfinal

保存 SCRIPT字段。声明为 public static final String SAVE_SCRIPT。

Atomically compare-and-set or unconditionally bump a versioned payload.

源码Source io/agentscope/extensions/redis/state/RedisStateVersionSupport.java:39–73

方法详情Method Detail

versionKey

public static String versionKey(String payloadKey)
static

设置版本键。

Performs the version key operation.

参数Parameters
名称Name类型Type说明Description
payloadKeyString负载键(类型 `String`)。The payload key.
返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/redis/state/RedisStateVersionSupport.java:77–79

parseVersion

public static long parseVersion(String payload, String versionValue)
static

解析版本。

Parses the version.

参数Parameters
名称Name类型Type说明Description
payloadString负载(类型 `String`)。The payload.
versionValueString版本值(类型 `String`)。The version value.
返回Returns long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/extensions/redis/state/RedisStateVersionSupport.java:81–89

saveScriptKeys

public static List<String> saveScriptKeys(String payloadKey, String versionKey, String keysKey)
static

保存 saveScriptKeys。

Saves the script keys.

参数Parameters
名称Name类型Type说明Description
payloadKeyString负载键(类型 `String`)。The payload key.
versionKeyString版本键(类型 `String`)。The version key.
keysKeyString密钥键(类型 `String`)。The keys key.
返回Returns List<String>
返回列出。Returns list.
源码Source io/agentscope/extensions/redis/state/RedisStateVersionSupport.java:91–94

saveScriptArgs

public static List<String> saveScriptArgs(String payload, long expectedVersion, String keyMember)
static

保存 saveScriptArgs。

Saves the script args.

参数Parameters
名称Name类型Type说明Description
payloadString负载(类型 `String`)。The payload.
expectedVersionlongexpected 版本(类型 `long`)。The expected version.
keyMemberString键成员(类型 `String`)。The key member.
返回Returns List<String>
返回列出。Returns list.
源码Source io/agentscope/extensions/redis/state/RedisStateVersionSupport.java:96–99

unconditionalSaveArgs

public static List<String> unconditionalSaveArgs(String payload, String keyMember)
static

执行 unconditionalSaveArgs 方法。

Performs the unconditional save args operation.

参数Parameters
名称Name类型Type说明Description
payloadString负载(类型 `String`)。The payload.
keyMemberString键成员(类型 `String`)。The key member.
返回Returns List<String>
返回列出。Returns list.
源码Source io/agentscope/extensions/redis/state/RedisStateVersionSupport.java:101–103
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.