o
    b²“i‰  ã                   @   sh   d dl mZmZ d dlmZ d dlmZ er(d dlmZ d dl	m
Z
 d dlmZ eG dd„ deƒƒZd	S )
é    )ÚABCÚabstractmethod)ÚTYPE_CHECKING)ÚDeveloperAPI)ÚExecutionResources)ÚResourceManager)ÚTopologyc                   @   sL   e Zd ZdZdddddefdd„Zed	d
„ ƒZedd„ ƒZeddd„ƒZ	dS )Ú
Autoscalerz+Abstract interface for Ray Data autoscaler.Útopologyr   Úresource_managerr   Úexecution_idc                 C   s   || _ || _|| _d S )N)Ú	_topologyÚ_resource_managerÚ_execution_id)Úselfr
   r   r   © r   úf/home/ubuntu/.local/lib/python3.10/site-packages/ray/data/_internal/execution/autoscaler/autoscaler.pyÚ__init__   s   
zAutoscaler.__init__c                 C   ó   dS )a  Try trigger autoscaling.

        This method will be called each time when StreamingExecutor makes
        a scheduling decision. A subclass should override this method to
        handle the autoscaling of both the cluster and `AutoscalingActorPool`s.
        Nr   ©r   r   r   r   Útry_trigger_scaling   s   zAutoscaler.try_trigger_scalingc                 C   r   )z5Callback when the StreamingExecutor is shutting down.Nr   r   r   r   r   Úon_executor_shutdown&   ó   zAutoscaler.on_executor_shutdownÚreturnr   c                 C   r   )zBGet the total resources that are available to this data execution.Nr   r   r   r   r   Úget_total_resources+   r   zAutoscaler.get_total_resourcesN)r   r   )
Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ústrr   r   r   r   r   r   r   r   r   r	      s    þý
ü

	
r	   N)Úabcr   r   Útypingr   Úray.util.annotationsr   Ú9ray.data._internal.execution.interfaces.execution_optionsr   Ú-ray.data._internal.execution.resource_managerr   Ú5ray.data._internal.execution.streaming_executor_stater   r	   r   r   r   r   Ú<module>   s    