RemoteCacheClient

public class RemoteCacheClient
extends Object implements ICacheClient

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


一种 RemoteActionCache 实现,它使用对远程 API 服务器的 gRPC 调用。

摘要

字段

public static final Duration REMOTE_TIMEOUT

公共构造函数

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

公共方法

ExecutableActionResult lookupCache(ExecutableAction action)

查找 actionExecutableActionResult

void uploadCache(ExecutableAction action, ExecutableActionResult actionResult)

上传 ExecutableAction 的结果。

字段

REMOTE_TIMEOUT

public static final Duration REMOTE_TIMEOUT

公共构造函数

RemoteCacheClient

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)

查找 actionExecutableActionResult

注意,调用方应在使用后删除输出文件,以避免磁盘空 间不足。

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

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

抛出
IOException
InterruptedException

uploadCache

public void uploadCache (ExecutableAction action, 
                ExecutableActionResult actionResult)

上传 ExecutableAction 的结果。

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

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

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

抛出
IOException
InterruptedException