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 Type
    Method
    Description
    void
    acquire(scala.collection.immutable.Map<String,Object> addressesAmounts)
    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(scala.collection.immutable.Map<String,Object> addressesAmounts)
    Release a sequence of resource addresses, these addresses must have been assigned.
    scala.collection.immutable.Seq<String>
     
     
    scala.collection.immutable.Map<String,Object>
    Get the amounts of resources that have been multiplied by ONE_ENTIRE_RESOURCE.
  • Method Details

    • acquire

      void acquire(scala.collection.immutable.Map<String,Object> addressesAmounts)
      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

      void release(scala.collection.immutable.Map<String,Object> addressesAmounts)
      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

      scala.collection.immutable.Map<String,Object> resourcesAmounts()
      Get the amounts of resources that have been multiplied by ONE_ENTIRE_RESOURCE.
      Returns:
      the resources amounts