Class DefaultAllocatedSlotPool

    • Constructor Detail

      • DefaultAllocatedSlotPool

        public DefaultAllocatedSlotPool()
    • Method Detail

      • addSlots

        public void addSlots​(Collection<org.apache.flink.runtime.jobmaster.slotpool.AllocatedSlot> slots,
                             long currentTime)
        Description copied from interface: AllocatedSlotPool
        Adds the given collection of slots to the slot pool.
        Specified by:
        addSlots in interface AllocatedSlotPool
        Parameters:
        slots - slots to add to the slot pool
        currentTime - currentTime when the slots have been added to the slot pool
      • removeSlot

        public Optional<org.apache.flink.runtime.jobmaster.slotpool.AllocatedSlot> removeSlot​(AllocationID allocationId)
        Description copied from interface: AllocatedSlotPool
        Removes the slot with the given allocationId from the slot pool.
        Specified by:
        removeSlot in interface AllocatedSlotPool
        Parameters:
        allocationId - allocationId identifying the slot to remove from the slot pool
        Returns:
        the removed slot if there was a slot with the given allocationId; otherwise Optional.empty()
      • containsSlots

        public boolean containsSlots​(ResourceID owner)
        Description copied from interface: AllocatedSlotPool
        Checks whether the slot pool contains at least one slot belonging to the specified owner.
        Specified by:
        containsSlots in interface AllocatedSlotPool
        Parameters:
        owner - owner for which to check whether the slot pool contains slots
        Returns:
        true if the slot pool contains a slot from the given owner; otherwise false
      • containsSlot

        public boolean containsSlot​(AllocationID allocationId)
        Description copied from interface: AllocatedSlotPool
        Checks whether the slot pool contains a slot with the given allocationId.
        Specified by:
        containsSlot in interface AllocatedSlotPool
        Parameters:
        allocationId - allocationId identifying the slot for which to check whether it is contained
        Returns:
        true if the slot pool contains the slot with the given allocationId; otherwise false
      • containsFreeSlot

        public boolean containsFreeSlot​(AllocationID allocationId)
        Description copied from interface: AllocatedSlotPool
        Checks whether the slot pool contains a slot with the given AllocationID and if it is free.
        Specified by:
        containsFreeSlot in interface AllocatedSlotPool
        Parameters:
        allocationId - allocationId specifies the slot to check for
        Returns:
        true if the slot pool contains a free slot registered under the given allocation id; otherwise false
      • reserveFreeSlot

        public org.apache.flink.runtime.jobmaster.slotpool.AllocatedSlot reserveFreeSlot​(AllocationID allocationId)
        Description copied from interface: AllocatedSlotPool
        Reserves the free slot specified by the given allocationId.
        Specified by:
        reserveFreeSlot in interface AllocatedSlotPool
        Parameters:
        allocationId - allocationId identifying the free slot to reserve
        Returns:
        the AllocatedSlot which has been reserved
      • freeReservedSlot

        public Optional<org.apache.flink.runtime.jobmaster.slotpool.AllocatedSlot> freeReservedSlot​(AllocationID allocationId,
                                                                                                    long currentTime)
        Description copied from interface: AllocatedSlotPool
        Frees the reserved slot, adding it back into the set of free slots.
        Specified by:
        freeReservedSlot in interface AllocatedSlotPool
        Parameters:
        allocationId - identifying the reserved slot to freed
        currentTime - currentTime when the slot has been freed
        Returns:
        the freed AllocatedSlot if there was an allocated with the given allocationId; otherwise Optional.empty().