T - The type of the concrete actor creatorpublic class BaseActorCreator<T extends BaseActorCreator> extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected ActorCreationOptions.Builder |
builder |
| 构造器和说明 |
|---|
BaseActorCreator() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected ActorCreationOptions |
buildOptions() |
T |
setGlobalName(String name)
Set the name of this actor.
|
T |
setMaxConcurrency(int maxConcurrency)
Set the max number of concurrent calls to allow for this actor.
|
T |
setMaxRestarts(int maxRestarts)
This specifies the maximum number of times that the actor should be restarted when it dies
unexpectedly.
|
T |
setName(String name)
Set the actor name of a named actor.
|
T |
setPlacementGroup(PlacementGroup group,
int bundleIndex)
Set the placement group to place this actor in.
|
T |
setResource(String resourceName,
Double resourceQuantity)
Set a custom resource requirement to reserve for the lifetime of this actor.
|
T |
setResources(Map<String,Double> resources)
Set custom resource requirements to reserve for the lifetime of this actor.
|
protected ActorCreationOptions.Builder builder
public T setName(String name)
Ray.getActor(java.lang.String). If you want create a named actor that is
accessible from all jobs, use setGlobalName(java.lang.String) instead.name - The name of the named actor.ActorCreationOptions.Builder.setName(String)public T setGlobalName(String name)
Ray.getGlobalActor(java.lang.String). If you want to create a named actor that is only
accessible from this job, use setName(java.lang.String) instead.name - The name of the named actor.ActorCreationOptions.Builder.setGlobalName(String)public T setResource(String resourceName, Double resourceQuantity)
resourceName - resource nameresourceQuantity - resource quantityActorCreationOptions.Builder#setResource(java.lang.String, java.lang.Double)public T setResources(Map<String,Double> resources)
resources - requirements for multiple resources.setResources(java.util.Map)public T setMaxRestarts(int maxRestarts)
maxRestarts - max number of actor restartsActorCreationOptions.Builder#setMaxRestarts(int)public T setMaxConcurrency(int maxConcurrency)
The max concurrency defaults to 1 for threaded execution. Note that the execution order is
not guaranteed when max_concurrency > 1.
maxConcurrency - The max number of concurrent calls to allow for this actor.ActorCreationOptions.Builder#setMaxConcurrency(int)public T setPlacementGroup(PlacementGroup group, int bundleIndex)
group - The placement group of the actor.bundleIndex - The index of the bundle to place this actor in.ActorCreationOptions.Builder#setPlacementGroup(PlacementGroup, int)protected ActorCreationOptions buildOptions()
Copyright © 2021. All rights reserved.