Package org.apache.spark.resource
Interface ResourceAllocator
public interface ResourceAllocator
Trait used to help executor/worker allocate resources.
Please note that this is intended to be used in a single thread.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Acquire a sequence of resource addresses (to a launched task), these addresses must be available.scala.collection.immutable.Seq<String>
Sequence of currently assigned resource addresses.scala.collection.immutable.Seq<String>
Sequence of currently available resource addresses which are not fully assigned.void
Release a sequence of resource addresses, these addresses must have been assigned.scala.collection.immutable.Seq<String>
Get the amounts of resources that have been multiplied by ONE_ENTIRE_RESOURCE.
-
Method Details
-
acquire
Acquire a sequence of resource addresses (to a launched task), these addresses must be available. When the task finishes, it will return the acquired resource addresses. Throw an Exception if an address is not available or doesn't exist.- Parameters:
addressesAmounts
- (undocumented)
-
assignedAddrs
scala.collection.immutable.Seq<String> assignedAddrs()Sequence of currently assigned resource addresses.- Returns:
- (undocumented)
-
availableAddrs
scala.collection.immutable.Seq<String> availableAddrs()Sequence of currently available resource addresses which are not fully assigned.- Returns:
- (undocumented)
-
release
Release a sequence of resource addresses, these addresses must have been assigned. Resource addresses are released when a task has finished. Throw an Exception if an address is not assigned or doesn't exist.- Parameters:
addressesAmounts
- (undocumented)
-
resourceAddresses
scala.collection.immutable.Seq<String> resourceAddresses() -
resourceName
String resourceName() -
resourcesAmounts
Get the amounts of resources that have been multiplied by ONE_ENTIRE_RESOURCE.- Returns:
- the resources amounts
-