AS AgentScopeAPI 手册 / API Reference

RedisContainerMapping

public class RedisContainerMapping
源码Source io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:34–214

Redis 容器 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
redisClientRedisClientWrapperRedis 客户端(类型 `RedisClientWrapper`)。The redis client.
prefixStringprefix(类型 `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
keySandboxKey键(类型 `SandboxKey`)。The key.
valueContainerModel值(类型 `ContainerModel`)。The value.
源码Source io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:70–85

get

public ContainerModel get(SandboxKey key)

按条件读取数据。

Performs the get operation.

参数Parameters
名称Name类型Type说明Description
keySandboxKey键(类型 `SandboxKey`)。The key.
返回Returns ContainerModel
返回ContainerModel。Returns container model.
源码Source io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:87–107

remove

public boolean remove(SandboxKey key)

设置移除。

Performs the remove operation.

参数Parameters
名称Name类型Type说明Description
keySandboxKey键(类型 `SandboxKey`)。The key.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:109–123

containsKey

public boolean containsKey(SandboxKey key)

设置该参数。

Performs the contains key operation.

参数Parameters
名称Name类型Type说明Description
keySandboxKey键(类型 `SandboxKey`)。The key.
返回Returns boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:125–132

scan

public Set<String> scan(String pattern)

设置该参数。

Performs the scan operation.

参数Parameters
名称Name类型Type说明Description
patternStringpattern(类型 `String`)。The pattern.
返回Returns Set<String>
返回设置。Returns set.
源码Source io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:134–144

getAll

public Map<SandboxKey, ContainerModel> getAll()

获取所有。

Returns the all.

返回Returns Map<SandboxKey, ContainerModel>
返回映射。Returns map.
源码Source io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:146–171

clear

public void clear()

清空或重置内部状态。

Clears or resets internal state.

源码Source io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:198–207

size

public int size()

返回大小。

Returns the size.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/runtime/sandbox/manager/collections/RedisContainerMapping.java:209–213
基于官方固定版本源码静态生成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.