集群客戶端
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 |