集群客户端
public class ClusterClient
extends Object
implements IClusterClient
java.lang.Object |
↳ | com.android.tradefed.cluster.ClusterClient |
用于与 TFC 后端交互的IClusterClient
实现。
概括
公共方法 |
---|
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 ClusterCommand.State getCommandState (String requestId,
String commandId)
确定集群命令的状态。
参数 |
---|
requestId | String : 集群请求ID |
commandId | String : 集群命令 ID |
获取命令状态
public ClusterCommandStatus getCommandStatus (String requestId,
String commandId)
获取集群命令的命令状态(取消时的状态和取消原因)。
参数 |
---|
requestId | String : 集群请求ID |
commandId | String : 集群命令 ID |
获取测试环境
public TestContext getTestContext (String requestId,
String commandId)
参数 |
---|
requestId | String |
commandId | String |
获取测试资源
public getTestResources (String requestId)
获取请求的TestResource
。
租赁主机命令
public leaseHostCommands (String clusterId,
String hostname,
deviceInfos,
nextClusterIds,
int maxTasksTolease)
为给定主机租用ClusterCommand
。
参数 |
---|
clusterId | String :主机的集群 ID |
hostname | String :主机名 |
deviceInfos | : 主机拥有的设备信息 |
nextClusterIds | :要从中租用命令的下一个集群 ID 的列表。 |
maxTasksTolease | int : 当前可以租用的最大任务数 |
更新测试环境
public void updateTestContext (String requestId,
String commandId,
TestContext testContext)
参数 |
---|
requestId | String |
commandId | String |
testContext | TestContext |