Package io.ray.api.call
Class BaseActorCreator<T extends BaseActorCreator>
java.lang.Object
io.ray.api.call.BaseActorCreator<T>
- Type Parameters:
T- The type of the concrete actor creator
- Direct Known Subclasses:
ActorCreator,PyActorCreator
Base helper to create actor.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ActorCreationOptionssetLifetime(ActorLifetime lifetime)setMaxConcurrency(int maxConcurrency)Set the max number of concurrent calls to allow for this actor.setMaxPendingCalls(int maxPendingCalls)Set the max number of pending calls allowed on the actor handle.setMaxRestarts(int maxRestarts)This specifies the maximum number of times that the actor should be restarted when it dies unexpectedly.Set the actor name of a named actor.setPlacementGroup(PlacementGroup group)Set the placement group to place this actor in, which may use any available bundle.setPlacementGroup(PlacementGroup group, int bundleIndex)Set the placement group to place this actor in.setResource(String resourceName, Double resourceQuantity)Set a custom resource requirement to reserve for the lifetime of this actor.setResources(Map<String,Double> resources)Set custom resource requirements to reserve for the lifetime of this actor.
-
Field Details
-
builder
-
-
Constructor Details
-
BaseActorCreator
public BaseActorCreator()
-
-
Method Details
-
setName
Set the actor name of a named actor.- Parameters:
name- The name of the named actor.- Returns:
- self
- See Also:
ActorCreationOptions.Builder.setName(String)
-
setLifetime
-
setResource
Set a custom resource requirement to reserve for the lifetime of this actor. This method can be called multiple times. If the same resource is set multiple times, the latest quantity will be used.- Parameters:
resourceName- resource nameresourceQuantity- resource quantity- Returns:
- self
- See Also:
ActorCreationOptions.Builder.setResource(java.lang.String, java.lang.Double)
-
setResources
Set custom resource requirements to reserve for the lifetime of this actor. This method can be called multiple times. If the same resource is set multiple times, the latest quantity will be used.- Parameters:
resources- requirements for multiple resources.- Returns:
- self
- See Also:
setResources(java.util.Map)
-
setMaxRestarts
This specifies the maximum number of times that the actor should be restarted when it dies unexpectedly. The minimum valid value is 0 (default), which indicates that the actor doesn't need to be restarted. A value of -1 indicates that an actor should be restarted indefinitely.- Parameters:
maxRestarts- max number of actor restarts- Returns:
- self
- See Also:
ActorCreationOptions.Builder.setMaxRestarts(int)
-
setMaxConcurrency
Set the max number of concurrent calls to allow for this actor.The maximum concurrency defaults to 1 for threaded execution. Note that the execution order is not guaranteed when
max_concurrency > 1.- Parameters:
maxConcurrency- The maximum number of concurrent calls to allow for this actor.- Returns:
- self
- See Also:
ActorCreationOptions.Builder.setMaxConcurrency(int)
-
setMaxPendingCalls
Set the max number of pending calls allowed on the actor handle. When this value is exceeded, ray.exceptions.PendingCallsLimitExceededException will be thrown for further tasks. Note that this limit is counted per handle. -1 means that the number of pending calls is unlimited.- Parameters:
maxPendingCalls- The maximum number of pending calls for this actor.- Returns:
- self
-
setPlacementGroup
Set the placement group to place this actor in.- Parameters:
group- The placement group of the actor.bundleIndex- The index of the bundle to place this actor in.- Returns:
- self
- See Also:
ActorCreationOptions.Builder.setPlacementGroup(PlacementGroup, int)
-
setPlacementGroup
Set the placement group to place this actor in, which may use any available bundle.- Parameters:
group- The placement group of the actor.- Returns:
- self
- See Also:
ActorCreationOptions.Builder.setPlacementGroup(PlacementGroup, int)
-
buildOptions
-