RedisSandboxMap
public class RedisSandboxMap implements SandboxMap
源码Source
io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:31–221Redis 沙箱映射,承载智能体的部署、调度与服务化运行。位于 io.agentscope.runtime.sandbox.map 包,实现 SandboxMap。核心成员包括 addSandbox、getSandbox、removeSandbox、containSandbox、getAllSandboxes、RedisSandboxMap。
A class in io.agentscope.runtime.sandbox.map that deploys, schedules and serves agents. Declared in io.agentscope.runtime.sandbox.map. Implements SandboxMap.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public RedisSandboxMap(RedisManagerConfig redisManagerConfig) | 初始化 `RedisSandboxMap` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void addSandbox(SandboxKey sandboxKey, ContainerModel containerModel) | 添加沙箱。 Adds the sandbox. |
public ContainerModel getSandbox(SandboxKey sandboxKey) | 获取沙箱。 Returns the sandbox. |
public ContainerModel getSandbox(String containerId) | 获取沙箱。 Returns the sandbox. |
public boolean removeSandbox(SandboxKey sandboxKey) | 移除沙箱。 Removes the sandbox. |
public void removeSandbox(String containerId) | 移除沙箱。 Removes the sandbox. |
public boolean containSandbox(SandboxKey sandboxKey) | 设置该参数。 Performs the contain sandbox operation. |
public boolean containSandbox(String containerId) | 设置该参数。 Performs the contain sandbox operation. |
public Map<String, ContainerModel> getAllSandboxes() | 获取 `getAllSandboxes`。 Returns the all sandboxes. |
构造器详情Constructor Detail
RedisSandboxMap
public RedisSandboxMap(RedisManagerConfig redisManagerConfig)
初始化 RedisSandboxMap 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
redisManagerConfig | RedisManagerConfig | Redis 管理器配置(类型 `RedisManagerConfig`)。The redis manager config. |
源码Source
io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:43–53方法详情Method Detail
addSandbox
public void addSandbox(SandboxKey sandboxKey, ContainerModel containerModel)
添加沙箱。
Adds the sandbox.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxKey | SandboxKey | 沙箱键(类型 `SandboxKey`)。The sandbox key. |
containerModel | ContainerModel | 容器模型(类型 `ContainerModel`)。The container model. |
源码Source
io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:67–97getSandbox
public ContainerModel getSandbox(SandboxKey sandboxKey)
获取沙箱。
Returns the sandbox.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxKey | SandboxKey | 沙箱键(类型 `SandboxKey`)。The sandbox key. |
ContainerModel返回ContainerModel。Returns container model.
源码Source
io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:99–120getSandbox
public ContainerModel getSandbox(String containerId)
获取沙箱。
Returns the sandbox.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
ContainerModel返回ContainerModel。Returns container model.
源码Source
io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:122–138removeSandbox
public boolean removeSandbox(SandboxKey sandboxKey)
移除沙箱。
Removes the sandbox.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxKey | SandboxKey | 沙箱键(类型 `SandboxKey`)。The sandbox key. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:140–156removeSandbox
public void removeSandbox(String containerId)
移除沙箱。
Removes the sandbox.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
源码Source
io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:158–178containSandbox
public boolean containSandbox(SandboxKey sandboxKey)
设置该参数。
Performs the contain sandbox operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandboxKey | SandboxKey | 沙箱键(类型 `SandboxKey`)。The sandbox key. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:180–189containSandbox
public boolean containSandbox(String containerId)
设置该参数。
Performs the contain sandbox operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
containerId | String | 容器标识(类型 `String`)。The container id. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:191–195getAllSandboxes
public Map<String, ContainerModel> getAllSandboxes()
获取 getAllSandboxes。
Returns the all sandboxes.
Map<String, ContainerModel>返回映射。Returns map.
源码Source
io/agentscope/runtime/sandbox/map/RedisSandboxMap.java:197–220