RemoteCacheClient

public class RemoteCacheClient
extends Object implements ICacheClient

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


A RemoteActionCache implementation that uses gRPC calls to a remote API server.

Summary

Fields

public static final Duration REMOTE_TIMEOUT

Public constructors

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

Public methods

ExecutableActionResult lookupCache(ExecutableAction action)

Lookups the ExecutableActionResult for the action.

void uploadCache(ExecutableAction action, ExecutableActionResult actionResult)

Uploads the results for the ExecutableAction.

Fields

REMOTE_TIMEOUT

public static final Duration REMOTE_TIMEOUT

Public constructors

RemoteCacheClient

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

Parameters
workFolder File

instanceName String

channel ManagedChannel

callCredentials CallCredentials

downloader ByteStreamDownloader

uploader ByteStreamUploader

Public methods

lookupCache

public ExecutableActionResult lookupCache (ExecutableAction action)

Lookups the ExecutableActionResult for the action.

Note, caller should delete the output files after usage to avoid running out of disk space.

Parameters
action ExecutableAction: The ExecutableAction whose result should be returned.

Returns
ExecutableActionResult the ExecutableActionResult of the action if the result exists, otherwise, null.

uploadCache

public void uploadCache (ExecutableAction action, 
                ExecutableActionResult actionResult)

Uploads the results for the ExecutableAction.

If the result of the action doesn't exist, the actionResult will be stored. Otherwise, the result will be updated.

Parameters
action ExecutableAction: The action that generated the results.

actionResult ExecutableActionResult: The action result to associate with the action.