ControlPlaneBaseStore
public final class ControlPlaneBaseStore implements BaseStore
源码Source
io/agentscope/extensions/controlplane/store/ControlPlaneBaseStore.java:39–214控制面基类存储,负责持久化与读取数据。位于 io.agentscope.extensions.controlplane.store 包,实现 BaseStore。核心成员包括 get、put、supportsAtomicSessionStorage、putIfVersion、search、delete。
Control-plane hosted BaseStore over /api/v1/dp/kv/*.
HTTP failures and unexpected status codes throw RuntimeException — never silently
return empty results (except #get which maps 404 to null).
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public StoreItem get(List<String> ns, String key) | 按条件读取数据。 Performs the get operation. |
public void put(List<String> ns, String key, Map<String, Object> value) | 执行 `put` 方法。 Performs the put operation. |
public boolean supportsAtomicSessionStorage() | 返回 `supportsAtomicSessionStorage` 结果。 Returns the supports atomic session storage. |
public boolean putIfVersion(List<String> ns, String key, Map<String, Object> value, long expectedVersion) | 执行 `putIfVersion` 方法。 Performs the put if version operation. |
public List<StoreItem> search(List<String> ns, int limit, int offset) | 执行搜索相关操作。 Performs the search operation. |
public void delete(List<String> ns, String key) | 删除数据。 Performs the delete operation. |
方法详情Method Detail
get
public StoreItem get(List<String> ns, String key)
按条件读取数据。
Performs the get operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ns | List<String> | ns(类型 `List`)。The ns. |
key | String | 键(类型 `String`)。The key. |
StoreItem返回StoreItem。Returns store item.
源码Source
io/agentscope/extensions/controlplane/store/ControlPlaneBaseStore.java:54–68put
public void put(List<String> ns, String key, Map<String, Object> value)
执行 put 方法。
Performs the put operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ns | List<String> | ns(类型 `List`)。The ns. |
key | String | 键(类型 `String`)。The key. |
value | Map<String, Object> | 值(类型 `Map`)。The value. |
源码Source
io/agentscope/extensions/controlplane/store/ControlPlaneBaseStore.java:70–73supportsAtomicSessionStorage
public boolean supportsAtomicSessionStorage()
返回 supportsAtomicSessionStorage 结果。
Returns the supports atomic session storage.
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/extensions/controlplane/store/ControlPlaneBaseStore.java:75–78putIfVersion
public boolean putIfVersion(List<String> ns, String key, Map<String, Object> value, long expectedVersion)
执行 putIfVersion 方法。
Performs the put if version operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ns | List<String> | ns(类型 `List`)。The ns. |
key | String | 键(类型 `String`)。The key. |
value | Map<String, Object> | 值(类型 `Map`)。The value. |
expectedVersion | long | expected 版本(类型 `long`)。The expected version. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/extensions/controlplane/store/ControlPlaneBaseStore.java:80–94search
public List<StoreItem> search(List<String> ns, int limit, int offset)
执行搜索相关操作。
Performs the search operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ns | List<String> | ns(类型 `List`)。The ns. |
limit | int | 数量上限(类型 `int`)。The limit. |
offset | int | 偏移量(类型 `int`)。The offset. |
List<StoreItem>返回列出。Returns list.
源码Source
io/agentscope/extensions/controlplane/store/ControlPlaneBaseStore.java:96–122delete
public void delete(List<String> ns, String key)
删除数据。
Performs the delete operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
ns | List<String> | ns(类型 `List`)。The ns. |
key | String | 键(类型 `String`)。The key. |
源码Source
io/agentscope/extensions/controlplane/store/ControlPlaneBaseStore.java:124–137