IClusterClient

public interface IClusterClient

com.android.tradefed.cluster.IClusterClient


用於與 TFC 後端互動的介面。

摘要

常數

String TYPE_NAME

設定物件類型的專屬名稱。

公用方法

abstract IClusterEventUploader<ClusterCommandEvent> getCommandEventUploader()

取得可用來上傳 ClusterCommandEventIClusterEventUploader

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

判斷叢集指令的狀態。

default ClusterCommandStatus getCommandStatus(String requestId, String commandId)

取得叢集指令的指令狀態 (狀態和取消原因,如果取消則為取消原因)。

abstract IClusterEventUploader<ClusterHostEvent> getHostEventUploader()

取得可用來上傳 ClusterHostEventIClusterEventUploader

abstract TestContext getTestContext(String requestId, String commandId)
abstract TestEnvironment getTestEnvironment(String requestId)

取得要求的 TestEnvironment

abstract getTestResources(String requestId)

取得要求的 TestResource

abstract leaseHostCommands(String clusterId, String hostname, devices, nextClusterIds, int maxTasksTolease)

為指定主機租用 ClusterCommand

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

常數

TYPE_NAME

public static final String TYPE_NAME

專屬設定物件類型名稱。用於從 GlobalConfiguration 擷取單例模式例項。

常數值: "cluster_client"

公用方法

getCommandEventUploader

public abstract IClusterEventUploader<ClusterCommandEvent> getCommandEventUploader ()

取得可用來上傳 ClusterCommandEventIClusterEventUploader

傳回
IClusterEventUploader<ClusterCommandEvent>

getCommandState

public abstract 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 abstract IClusterEventUploader<ClusterHostEvent> getHostEventUploader ()

取得可用來上傳 ClusterHostEventIClusterEventUploader

傳回
IClusterEventUploader<ClusterHostEvent>

getTestContext

public abstract TestContext getTestContext (String requestId, 
                String commandId)

參數
requestId String

commandId String

傳回
TestContext

擲回
JSONException

getTestEnvironment

public abstract TestEnvironment getTestEnvironment (String requestId)

取得要求的 TestEnvironment

傳回
TestEnvironment TestEnvironment 物件。

擲回
IOException
org.json.JSONException
JSONException

getTestResources

public abstract  getTestResources (String requestId)

取得要求的 TestResource

傳回
TestResource 清單。

擲回
IOException
org.json.JSONException
JSONException

leaseHostCommands

public abstract  leaseHostCommands (String clusterId, 
                String hostname, 
                 devices, 
                 nextClusterIds, 
                int maxTasksTolease)

為指定主機租用 ClusterCommand

參數
clusterId String:主機的叢集 ID

hostname String:主機名稱

devices :主機擁有的 deviceInfo

nextClusterIds :要從中租用指令的下一個叢集 ID 清單。

maxTasksTolease int:目前可租用的作業數量上限

傳回
ClusterCommand 清單

擲回
org.json.JSONException
JSONException

updateTestContext

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

參數
requestId String

commandId String

testContext TestContext

擲回
JSONException