RemoteCacheClient

public class RemoteCacheClient
extends Object implements ICacheClient

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


使用 gRPC 呼叫遠端 API 伺服器的 RemoteActionCache 實作。

摘要

欄位

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)

action 查詢 ExecutableActionResult

請注意,呼叫端應在使用後刪除輸出檔案,以免磁碟空間不足。

參數
action ExecutableAction:應傳回結果的 ExecutableAction

傳回
ExecutableActionResult 如果結果存在,則為 actionExecutableActionResult;否則為空值。

uploadCache

public void uploadCache (ExecutableAction action, 
                ExecutableActionResult actionResult)

上傳 ExecutableAction 的結果。

如果 action 的結果不存在,系統會儲存 actionResult。否則系統會更新結果。

參數
action ExecutableAction:產生結果的動作。

actionResult ExecutableActionResult:要與 action 建立關聯的動作結果。