+
     IÔiÄ  c                   s`   € ^ RI t ] P                  ! ]4      tR t ! R R4      t ! R R4      tR# )é    Nc                 s2   € V P                  ^ \        4       R# )r    N)ZinsertÚTableResource)Zbase_classesÚkwargss   &,Ú9/usr/lib/python3.14/site-packages/boto3/dynamodb/table.pyÚregister_table_methodsr      s   € Ø×Ñ˜œ=Ö)ó    c                   s<   a a€ ] tR t^t oV 3R ltRR ltRtVtV ;t# )r   c                s(   <€ \         SV `  ! V/ VB  R # ©N)ZsuperÚ__init__)ÚselfZargsr   Ú	__class__s   &*,€r   r   ZTableResource.__init__   s   ø€ Ü‰Ò˜$Ð) &Ô)r   c                sZ   € \        V P                  V P                  P                  VR7      # )aÁ  Create a batch writer object.

This method creates a context manager for writing
objects to Amazon DynamoDB in batch.

The batch writer will automatically handle buffering and sending items
in batches.  In addition, the batch writer will also automatically
handle any unprocessed items and resend them as needed.  All you need
to do is call ``put_item`` for any items you want to add, and
``delete_item`` for any items you want to delete.

Example usage::

    with table.batch_writer() as batch:
        for _ in range(1000000):
            batch.put_item(Item={'HashKey': '...',
                                 'Otherstuff': '...'})
        # You can also delete_items in a batch.
        batch.delete_item(Key={'HashKey': 'SomeHashKey'})

:type overwrite_by_pkeys: list(string)
:param overwrite_by_pkeys: De-duplicate request items in buffer
    if match new request item on specified primary keys. i.e
    ``["partition_key1", "sort_key2", "sort_key3"]``

)Úoverwrite_by_pkeys)ÚBatchWriterZnameZmetaÚclient)r   r
   ó   &&r   Úbatch_writerZTableResource.batch_writer   s'   € ô6 ØI‰It—y‘y×'Ñ'Ð<Nô
ð 	
r   © r   )	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__r   r   Ú__static_attributes__Ú__classdictcell__Z__classcell__)r	   Ú__classdict__s   @@r   r   r      s   ù‡ € õ*÷
ô 
r   r   c                   sd   a € ] tR t^?t o RtRR ltR tR tR tR t	R t
R	 tR
 tR tR tRtV tR# )r   zAAutomatically handle batch writes to DynamoDB for a single table.Nc                sD   € Wn         W n        . V n        W0n        W@n        R# )a­  

:type table_name: str
:param table_name: The name of the table.  The class handles
    batch writes to a single table.

:type client: ``botocore.client.Client``
:param client: A botocore client.  Note this client
    **must** have the dynamodb customizations applied
    to it for transforming AttributeValues into the
    wire protocol.  What this means in practice is that
    you need to use a client that comes from a DynamoDB
    resource if you're going to instantiate this class
    directly, i.e
    ``boto3.resource('dynamodb').Table('foo').meta.client``.

:type flush_amount: int
:param flush_amount: The number of items to keep in
    a local buffer before sending a batch_write_item
    request to DynamoDB.

:type overwrite_by_pkeys: list(string)
:param overwrite_by_pkeys: De-duplicate request items in buffer
    if match new request item on specified primary keys. i.e
    ``["partition_key1", "sort_key2", "sort_key3"]``

N)Ú_table_nameÚ_clientÚ_items_bufferÚ_flush_amountÚ_overwrite_by_pkeys)r   Z
table_namer   Zflush_amountr
   s   &&&&&r   r   ZBatchWriter.__init__B   s#   € ð< &ÔØŒØˆÔØ)ÔØ#5Ö r   c                ó0   € V P                  R RV//4       R# )Ú
PutRequestÚItemN©Ú_add_request_and_process)r   r   r   r   Úput_itemZBatchWriter.put_itemf   s   € Ø×%Ñ% |°f¸d°^Ð&DÖEr   c                r   )ÚDeleteRequestÚKeyNr   )r   r#   r   r   Údelete_itemZBatchWriter.delete_itemi   s   € Ø×%Ñ% ¸À¸Ð&EÖFr   c                s¢   € V P                   '       d   V P                  V4       V P                  P                  V4       V P	                  4        R # r   )r   Ú _remove_dup_pkeys_request_if_anyr   ZappendÚ_flush_if_needed)r   Úrequestr   r   r    Z$BatchWriter._add_request_and_processl   s<   € Ø×#×#Ð#Ø×1Ñ1°'Ô:Ø×Ñ×!Ñ! 'Ô*Ø×ÑÖr   c                sà   € V P                  V4      pV P                   FL  pV P                  V4      V8X  g   K  V P                  P                  V4       \        P	                  R V4       KN  	  R# )z4With overwrite_by_pkeys enabled, skipping request:%sN)Ú_extract_pkey_valuesr   ZremoveÚloggerÚdebug)r   r'   Zpkey_values_newZitems   &&  r   r%   Z,BatchWriter._remove_dup_pkeys_request_if_anyr   s[   € Ø×3Ñ3°GÓ<ˆØ×&Ô&ˆDØ×(Ñ(¨Ó.°/ÖAØ×"Ñ"×)Ñ)¨$Ô/Ü—‘ØJØöó 'r   c                s:  € VP                  R 4      '       d2   V P                   Uu. uF  pVR ,          R,          V,          NK  	  up# VP                  R4      '       d2   V P                   Uu. uF  pVR,          R,          V,          NK  	  up# R# u upi u upi )r   r   r"   r#   N)Úgetr   )r   r'   Zkeys   && r   r(   Z BatchWriter._extract_pkey_values|   s¥   € Ø;‰;|×$Ò$ð  ×3Ò3óá3Cð ˜Õ% fÕ-¨c×2Ð2Ù3ñð ð [‰[˜×)Ò)ð  ×3Ò3óá3Cð ˜Õ(¨Õ/°×4Ð4Ù3ñð ñ ùòùò
s   ¦ BÁ. Bc                sr   € \        V P                  4      V P                  8¼  d   V P                  4        R # R # r   )Úlenr   r   Ú_flush©r   ó   &r   r&   ZBatchWriter._flush_if_needed‰   s)   € Üˆt×!Ñ!Ó" d×&8Ñ&8Ô8ØK‰KŽMñ 9r   c                s¾  € V P                   R V P                   pV P                   V P                  R  V n         V P                  P                  V P                  V/R7      pVR,          pV'       g   / pVP                  V P                  . 4      pV P                   P                  V4       \        P                  R\        V4      \        V P                   4      4       R # )N)ZRequestItemsZUnprocessedItemsz$Batch write sent %s, unprocessed: %s)
r   r   r   Zbatch_write_itemr   r+   Zextendr)   r*   r,   )r   Zitems_to_sendZresponseZunprocessed_itemsZ	item_lists   &    r   r-   ZBatchWriter._flush   sÈ   € Ø×*Ñ*Ð+?¨T×-?Ñ-?Ð@ˆØ!×/Ñ/°×0BÑ0BÐ0DÐEˆÔØ—<‘<×0Ñ0Ø×*Ñ*¨MÐ:ð 1ó 
ˆð %Ð%7Õ8Ðß Ø "ÐØ%×)Ñ)¨$×*:Ñ*:¸BÓ?ˆ	ð 	×Ñ×!Ñ! )Ô,Ü‰Ø2ÜÓÜ×"Ñ"Ó#ö	
r   c                s   € V # r   r   r.   r/   r   Ú	__enter__ZBatchWriter.__enter__    s   € Øˆr   c                sN   € V P                   '       d   V P                  4        K$  R # r   )r   r-   )r   Zexc_typeZ	exc_valueZtbs   &&&&r   Ú__exit__ZBatchWriter.__exit__£   s   € ð × × Ð ØK‰KŽMñ !r   )r   r   r   r   r   )i   N)r   r   r   r   Z__doc__r   r!   r$   r    r%   r(   r&   r-   r0   r1   r   r   )r   s   @r   r   r   ?   sB   ø‡ € ÙKô"6òHFòGò òòòò
ò&÷ð r   r   )ZloggingZ	getLoggerr   r)   r   r   r   r   r   r   Ú<module>r2      s6   ðó à	×	Ò	˜8Ó	$€ò*÷!
ñ !
÷Hhó hr   