public final class InstanceContext extends Object
| 构造器和说明 |
|---|
InstanceContext(ComputeNodeInstance instance,
WorkerIdGenerator workerIdGenerator,
ModeConfiguration modeConfiguration,
LockContext lockContext,
EventBusContext eventBusContext) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addComputeNodeInstance(ComputeNodeInstance instance)
Add compute node instance.
|
void |
deleteComputeNodeInstance(ComputeNodeInstance instance)
Delete compute node instance.
|
long |
generateWorkerId(Properties props)
Generate worker id.
|
List<InstanceMetaData> |
getAllClusterInstances(InstanceType instanceType,
Collection<String> labels)
Get compute node instances by instance type and labels.
|
Optional<ComputeNodeInstance> |
getComputeNodeInstanceById(String instanceId)
Get compute node instance by instance id.
|
long |
getWorkerId()
Get worker id.
|
boolean |
isCluster()
Is cluster instance or not.
|
void |
updateInstanceStatus(String instanceId,
Collection<String> status)
Update instance status.
|
void |
updateLabel(String instanceId,
Collection<String> labels)
Update instance label.
|
public InstanceContext(ComputeNodeInstance instance, WorkerIdGenerator workerIdGenerator, ModeConfiguration modeConfiguration, LockContext lockContext, EventBusContext eventBusContext)
public void updateInstanceStatus(String instanceId, Collection<String> status)
instanceId - instance idstatus - statuspublic void updateLabel(String instanceId, Collection<String> labels)
instanceId - instance idlabels - collection of labelpublic long getWorkerId()
public long generateWorkerId(Properties props)
props - propertiespublic void addComputeNodeInstance(ComputeNodeInstance instance)
instance - compute node instancepublic void deleteComputeNodeInstance(ComputeNodeInstance instance)
instance - compute node instancepublic List<InstanceMetaData> getAllClusterInstances(InstanceType instanceType, Collection<String> labels)
instanceType - instance typelabels - collection of contained labelpublic Optional<ComputeNodeInstance> getComputeNodeInstanceById(String instanceId)
instanceId - instance idpublic boolean isCluster()
Copyright © 2022 The Apache Software Foundation. All rights reserved.