远程缓存客户端

public class RemoteCacheClient
extends Object implements ICacheClient

java.lang.Object
   ↳ com.android.tradefed.cache.remote.RemoteCacheClient


使用 gRPC 调用远程 API 服务器的 RemoteActionCache 实现。

摘要

公共构造函数

RemoteCacheClient(File workFolder, String instanceName, ManagedChannel channel, CallCredentials callCredentials, ByteStreamDownloader downloader, ByteStreamUploader uploader)

公共方法

ExecutableActionResult lookupCache(ExecutableAction action)

ExecutableActionResult 中查找 action

void uploadCache(ExecutableAction action, ExecutableActionResult actionResult)

上传 ExecutableAction 的结果。

公共构造函数

远程缓存客户端

public RemoteCacheClient (File workFolder, 
                String instanceName, 
                ManagedChannel channel, 
                CallCredentials callCredentials, 
                ByteStreamDownloader downloader, 
                ByteStreamUploader uploader)

参数
workFolder File

instanceName String

channel ManagedChannel

callCredentials CallCredentials

downloader ByteStreamDownloader

uploader ByteStreamUploader

公共方法

lookupCache

public ExecutableActionResult lookupCache (ExecutableAction action)

ExecutableActionResult 中查找 action

请注意,调用方应在用量结束后删除输出文件,以避免耗尽磁盘空间。

参数
action ExecutableAction:应返回其结果的 ExecutableAction

返回
ExecutableActionResult 如果结果存在,则为 actionExecutableActionResult,否则为 null。

uploadCache

public void uploadCache (ExecutableAction action, 
                ExecutableActionResult actionResult)

上传 ExecutableAction 的结果。

如果 action 的结果不存在,系统会存储 actionResult。否则,系统会更新结果。

参数
action ExecutableAction:生成结果的操作。

actionResult ExecutableActionResult:要与 action 关联的操作结果。