ClusterClient
public
class
ClusterClient
extends Object
implements
IClusterClient
| java.lang.Object | |
| ↳ | com.android.tradefed.cluster.ClusterClient |
用於與 TFC 後端互動的 IClusterClient 實作項目。
摘要
公用建構函式 | |
|---|---|
ClusterClient()
|
|
公用方法 | |
|---|---|
IClusterEventUploader<ClusterCommandEvent>
|
getCommandEventUploader()
取得可用來上傳 |
ClusterCommand.State
|
getCommandState(String requestId, String commandId)
判斷叢集指令的狀態。 |
ClusterCommandStatus
|
getCommandStatus(String requestId, String commandId)
取得叢集指令的指令狀態 (狀態和取消原因,如果取消則為取消原因)。 |
IClusterEventUploader<ClusterHostEvent>
|
getHostEventUploader()
取得可用來上傳 |
TestContext
|
getTestContext(String requestId, String commandId)
|
TestEnvironment
|
getTestEnvironment(String requestId)
取得要求的 |
|
getTestResources(String requestId)
取得要求的 |
|
leaseHostCommands(String clusterId, String hostname,
為指定主機租用 |
void
|
updateTestContext(String requestId, String commandId, TestContext testContext)
|
公用建構函式
ClusterClient
public ClusterClient ()
公用方法
getCommandEventUploader
public IClusterEventUploader<ClusterCommandEvent> getCommandEventUploader ()
取得可用來上傳 ClusterCommandEvent 的 IClusterEventUploader。
| 傳回 | |
|---|---|
IClusterEventUploader<ClusterCommandEvent> |
|
getCommandState
public ClusterCommand.State getCommandState (String requestId, String commandId)
判斷叢集指令的狀態。
| 參數 | |
|---|---|
requestId |
String:叢集要求 ID |
commandId |
String:叢集指令 ID |
| 傳回 | |
|---|---|
ClusterCommand.State |
叢集指令的狀態,如果無法判斷狀態,則為 ClusterCommand.State#UNKNOWN |
getCommandStatus
public ClusterCommandStatus getCommandStatus (String requestId, String commandId)
取得叢集指令的指令狀態 (狀態和取消原因,如果取消則為取消原因)。
| 參數 | |
|---|---|
requestId |
String:叢集要求 ID |
commandId |
String:叢集指令 ID |
| 傳回 | |
|---|---|
ClusterCommandStatus |
代表狀態的 ClusterCommandStatus,以及指令遭到取消的取消原因。如果無法判斷狀態,則狀態為 ClusterCommand.State#UNKNOWN。 |
getHostEventUploader
public IClusterEventUploader<ClusterHostEvent> getHostEventUploader ()
取得可用來上傳 ClusterHostEvent 的 IClusterEventUploader。
| 傳回 | |
|---|---|
IClusterEventUploader<ClusterHostEvent> |
|
getTestContext
public TestContext getTestContext (String requestId, String commandId)
| 參數 | |
|---|---|
requestId |
String |
commandId |
String |
| 傳回 | |
|---|---|
TestContext |
|
| 擲回 | |
|---|---|
JSONException |
|
getTestEnvironment
public TestEnvironment getTestEnvironment (String requestId)
取得要求的 TestEnvironment。
| 傳回 | |
|---|---|
TestEnvironment |
TestEnvironment 物件。 |
| 擲回 | |
|---|---|
JSONException |
|
getTestResources
publicgetTestResources (String requestId)
取得要求的 TestResource。
| 傳回 | |
|---|---|
|
TestResource 清單。 |
| 擲回 | |
|---|---|
JSONException |
|
leaseHostCommands
publicleaseHostCommands (String clusterId, String hostname, deviceInfos, nextClusterIds, int maxTasksTolease)
為指定主機租用 ClusterCommand。
| 參數 | |
|---|---|
clusterId |
String:主機的叢集 ID |
hostname |
String:主機名稱 |
deviceInfos |
:主機擁有的 deviceInfo |
nextClusterIds |
:要從中租用指令的下一個叢集 ID 清單。 |
maxTasksTolease |
int:目前可租用的作業數量上限 |
| 傳回 | |
|---|---|
|
ClusterCommand 清單 |
| 擲回 | |
|---|---|
JSONException |
|
updateTestContext
public void updateTestContext (String requestId,
String commandId,
TestContext testContext)
| 參數 | |
|---|---|
requestId |
String |
commandId |
String |
testContext |
TestContext |
| 擲回 | |
|---|---|
JSONException |
|