RedisContainerMapping
public class RedisContainerMapping
源码Source
io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:34–214Redis 容器 Mapping,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.sandbox.manager.collections 包。核心成员包括 put、get、remove、containsKey、scan、getAll。
Redis-backed implementation for container mapping Maps SandboxKey to ContainerModel using Redis
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public RedisContainerMapping(RedisClientWrapper redisClient, String prefix) | 初始化 `RedisContainerMapping` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void put(SandboxKey key, ContainerModel value) | 执行 `put` 方法。 Performs the put operation. |
public ContainerModel get(SandboxKey key) | 按条件读取数据。 Performs the get operation. |
public boolean remove(SandboxKey key) | 设置移除。 Performs the remove operation. |
public boolean containsKey(SandboxKey key) | 设置该参数。 Performs the contains key operation. |
public Set<String> scan(String pattern) | 设置该参数。 Performs the scan operation. |
public Map<SandboxKey, ContainerModel> getAll() | 获取所有。 Returns the all. |
public void clear() | 清空或重置内部状态。 Clears or resets internal state. |
public int size() | 返回大小。 Returns the size. |
构造器详情Constructor Detail
RedisContainerMapping
public RedisContainerMapping(RedisClientWrapper redisClient, String prefix)
初始化 RedisContainerMapping 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
redisClient | RedisClientWrapper | Redis 客户端(类型 `RedisClientWrapper`)。The redis client. |
prefix | String | prefix(类型 `String`)。The prefix. |
源码Source
io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:42–48方法详情Method Detail
put
public void put(SandboxKey key, ContainerModel value)
执行 put 方法。
Performs the put operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | SandboxKey | 键(类型 `SandboxKey`)。The key. |
value | ContainerModel | 值(类型 `ContainerModel`)。The value. |
源码Source
io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:70–85get
public ContainerModel get(SandboxKey key)
按条件读取数据。
Performs the get operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | SandboxKey | 键(类型 `SandboxKey`)。The key. |
ContainerModel返回ContainerModel。Returns container model.
源码Source
io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:87–107remove
public boolean remove(SandboxKey key)
设置移除。
Performs the remove operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | SandboxKey | 键(类型 `SandboxKey`)。The key. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:109–123containsKey
public boolean containsKey(SandboxKey key)
设置该参数。
Performs the contains key operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
key | SandboxKey | 键(类型 `SandboxKey`)。The key. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:125–132scan
public Set<String> scan(String pattern)
设置该参数。
Performs the scan operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
pattern | String | pattern(类型 `String`)。The pattern. |
Set<String>返回设置。Returns set.
源码Source
io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:134–144getAll
public Map<SandboxKey, ContainerModel> getAll()
获取所有。
Returns the all.
Map<SandboxKey, ContainerModel>返回映射。Returns map.
源码Source
io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:146–171clear
public void clear()
清空或重置内部状态。
Clears or resets internal state.
源码Source
io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:198–207size
public int size()
返回大小。
Returns the size.
int返回数值结果。Returns a numeric result.
源码Source
io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:209–213