集群客户端

public class ClusterClient
extends Object implements IClusterClient

java.lang.Object
com.android.tradefed.cluster.ClusterClient


用于与 TFC 后端交互的IClusterClient实现。

概括

公共构造函数

ClusterClient ()

公共方法

IClusterEventUploader < ClusterCommandEvent > getCommandEventUploader ()

获取可用于上传ClusterCommandEvent IClusterEventUploader

ClusterCommand.State getCommandState (String requestId, String commandId)

确定集群命令的状态。

ClusterCommandStatus getCommandStatus (String requestId, String commandId)

获取集群命令的命令状态(状态和取消原因(如果取消))。

IClusterEventUploader < ClusterHostEvent > getHostEventUploader ()

获取可用于上传ClusterHostEvent IClusterEventUploader

TestContext getTestContext (String requestId, String commandId)

TestEnvironment getTestEnvironment (String requestId)

获取请求的TestEnvironment

getTestResources (String requestId)

获取请求的TestResource

leaseHostCommands (String clusterId, String hostname, deviceInfos, nextClusterIds, int maxTasksTolease) leaseHostCommands (String clusterId, String hostname, deviceInfos, nextClusterIds, int maxTasksTolease) leaseHostCommands (String clusterId, String hostname, deviceInfos, nextClusterIds, int maxTasksTolease)

为给定主机租用ClusterCommand

void updateTestContext (String requestId, String commandId, TestContext testContext)

公共构造函数

集群客户端

public ClusterClient ()

公共方法

获取命令事件上传器

public IClusterEventUploader<ClusterCommandEvent> getCommandEventUploader ()

获取可用于上传ClusterCommandEvent IClusterEventUploader

退货
IClusterEventUploader < ClusterCommandEvent >

获取命令状态

public ClusterCommand.State getCommandState (String requestId, 
                String commandId)

确定集群命令的状态。

参数
requestId String : 集群请求 ID

commandId String : 集群命令ID

退货
ClusterCommand.State cluster 命令的状态,如果无法确定状态,则ClusterCommand.State#UNKNOWN

获取命令状态

public ClusterCommandStatus getCommandStatus (String requestId, 
                String commandId)

获取集群命令的命令状态(状态和取消原因(如果取消))。

参数
requestId String : 集群请求 ID

commandId String : 集群命令ID

退货
ClusterCommandStatus ClusterCommandStatus 表示命令被取消时的状态和取消原因。如果无法确定,状态为ClusterCommand.State#UNKNOWN

获取主机事件上传器

public IClusterEventUploader<ClusterHostEvent> getHostEventUploader ()

获取可用于上传ClusterHostEvent IClusterEventUploader

退货
IClusterEventUploader < ClusterHostEvent >

获取测试上下文

public TestContext getTestContext (String requestId, 
                String commandId)

参数
requestId String

commandId String

退货
TestContext

投掷
JSONException

获取测试环境

public TestEnvironment getTestEnvironment (String requestId)

获取请求的TestEnvironment

退货
TestEnvironment一个TestEnvironment对象。

投掷
JSONException

获取测试资源

public  getTestResources (String requestId)

获取请求的TestResource

退货
TestResource列表。

投掷
JSONException

租赁主机命令

public  leaseHostCommands (String clusterId, 
                String hostname, 
                 deviceInfos, 
                 nextClusterIds, 
                int maxTasksTolease)

为给定主机租用ClusterCommand

参数
clusterId String : 主机的集群 ID

hostname String :主机名

deviceInfos :主机拥有的deviceInfos

nextClusterIds :从中租用命令的下一个集群 ID 的列表。

maxTasksTolease int : 当前可以租用的最大任务数

退货
ClusterCommand列表

投掷
JSONException

更新测试上下文

public void updateTestContext (String requestId, 
                String commandId, 
                TestContext testContext)

参数
requestId String

commandId String

testContext TestContext

投掷
JSONException