o
    bi                     @   s<   d dl mZ d dlmZmZmZmZ G dd dee ZdS )    )Generic)BlockBlockAccessor	BlockTypeTc                   @   s   e Zd ZdZededd fddZdeddfdd	Zdeddfd
dZ	de
fddZdefddZdefddZdefddZdefddZdS )BlockBuilderzA builder class for blocks.blockreturnc                 C   s   t |  S )N)r   	for_blockbuilder)r    r   T/home/ubuntu/.local/lib/python3.10/site-packages/ray/data/_internal/block_builder.pyr
   	   s   zBlockBuilder.for_blockitemNc                 C      t )z-Append a single row to the block being built.NotImplementedError)selfr   r   r   r   add      zBlockBuilder.addc                 C   r   )z0Append an entire block to the block being built.r   )r   r   r   r   r   	add_block   r   zBlockBuilder.add_blockc                 C   r   )z8Whether building this block will yield a new block copy.r   r   r   r   r   will_build_yield_copy   r   z"BlockBuilder.will_build_yield_copyc                 C   r   )zBuild the block.r   r   r   r   r   build   r   zBlockBuilder.buildc                 C   r   )z-Return the number of rows added in the block.r   r   r   r   r   num_rows   r   zBlockBuilder.num_rowsc                 C   r   )z2Return the estimated memory usage so far in bytes.r   r   r   r   r   get_estimated_memory_usage!   r   z'BlockBuilder.get_estimated_memory_usagec                 C   r   )zReturn the block type.r   r   r   r   r   
block_type%   r   zBlockBuilder.block_type)__name__
__module____qualname____doc__staticmethodr   r
   r   r   r   boolr   r   intr   r   r   r   r   r   r   r   r      s    r   N)typingr   ray.data.blockr   r   r   r   r   r   r   r   r   <module>   s    