IClusterClient
public
interface
IClusterClient
| com.android.tradefed.cluster.IClusterClient |
用于与 TFC 后端交互的接口。
摘要
常量 | |
|---|---|
String |
TYPE_NAME
唯一的配置对象类型名称。 |
公共方法 | |
|---|---|
abstract
IClusterEventUploader<ClusterCommandEvent>
|
getCommandEventUploader()
获取可用于上传 |
abstract
ClusterCommand.State
|
getCommandState(String requestId, String commandId)
确定集群命令的状态。 |
default
ClusterCommandStatus
|
getCommandStatus(String requestId, String commandId)
获取集群命令的命令状态(状态和取消原因,如果已取消)。 |
abstract
IClusterEventUploader<ClusterHostEvent>
|
getHostEventUploader()
获取可用于上传 |
abstract
TestContext
|
getTestContext(String requestId, String commandId)
|
abstract
TestEnvironment
|
getTestEnvironment(String requestId)
获取请求的 |
abstract
|
getTestResources(String requestId)
获取请求的 |
abstract
|
leaseHostCommands(String clusterId, String hostname,
为给定主机租用 |
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 ()
获取可用于上传 ClusterCommandEvent 的 IClusterEventUploader。
| 返回 | |
|---|---|
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 ()
获取可用于上传 ClusterHostEvent 的 IClusterEventUploader。
| 返回 | |
|---|---|
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 abstractgetTestResources (String requestId)
获取请求的 TestResource。
| 返回 | |
|---|---|
|
TestResource 的列表。 |
| 抛出 | |
|---|---|
|
IOException |
|
org.json.JSONException |
JSONException |
|
leaseHostCommands
public abstractleaseHostCommands (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 |
|