叢集客戶端

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