RemoteSnapshotClient
public interface RemoteSnapshotClient
源码Source
io/agentscope/harness/agent/sandbox/snapshot/RemoteSnapshotClient.java:28–56定义远程快照客户端契约的接口。位于 io.agentscope.harness.agent.sandbox.snapshot 包。核心成员包括 upload、download、exists。
User-implemented interface for uploading and downloading snapshot archives to/from remote storage (e.g. S3, OSS, GCS, or a custom blob store).
Implement this interface and pass it to RemoteSnapshotSpec to enable
remote snapshot storage. The implementation is responsible for authentication,
retry logic, and connection management.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public void upload(String snapshotId, InputStream data) throws Exception | 执行上传相关操作。 Uploads a snapshot archive to remote storage. |
public InputStream download(String snapshotId) throws Exception | 设置下载。 Downloads a snapshot archive from remote storage. |
public boolean exists(String snapshotId) throws Exception | 判断数据是否存在。 Checks whether a snapshot with the given ID exists in remote storage. |
方法详情Method Detail
upload
public void upload(String snapshotId, InputStream data) throws Exception
执行上传相关操作。
Uploads a snapshot archive to remote storage.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
snapshotId | String | 快照标识(类型 `String`)。unique identifier for this snapshot |
data | InputStream | 数据(类型 `InputStream`)。the workspace tar archive stream to upload |
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/harness/agent/sandbox/snapshot/RemoteSnapshotClient.java:37download
public InputStream download(String snapshotId) throws Exception
设置下载。
Downloads a snapshot archive from remote storage.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
snapshotId | String | 快照标识(类型 `String`)。unique identifier for the snapshot to download |
InputStream返回InputStream。an `InputStream` over the downloaded tar archive
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/harness/agent/sandbox/snapshot/RemoteSnapshotClient.java:46exists
public boolean exists(String snapshotId) throws Exception
判断数据是否存在。
Checks whether a snapshot with the given ID exists in remote storage.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
snapshotId | String | 快照标识(类型 `String`)。unique identifier to check |
boolean返回布尔值,表示判断结果。`true` if the snapshot exists and can be downloaded
Exception可能抛出 `Exception`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/harness/agent/sandbox/snapshot/RemoteSnapshotClient.java:55