o
    `j                     @   s*   d dl mZ d dlmZ G dd dZdS )    )AbortTransactionSpec)TopicPartitionc                   @   s,   e Zd ZdZdZedd Zedd ZdS )AbortTransactionabortz9Administratively abort an open transaction on a partitionc                 C   sb   |j ddtddd |j ddtddd |j d	tdd
d |j dtddd |j dtddd d S )Nz-tz--topicTzTopic name.)typerequiredhelpz-pz--partitionzPartition index.z--producer-idz'Producer id of the hanging transaction.z--producer-epochz*Producer epoch of the hanging transaction.z--coordinator-epochz4Coordinator epoch (default: -1, the admin sentinel).)r   defaultr   )add_argumentstrint)clsparser r   `/home/djax/ivt_ai_plugin/venv/lib/python3.10/site-packages/kafka/cli/admin/transactions/abort.pyadd_arguments	   s(   
zAbortTransaction.add_argumentsc                 C   sD   t t|j|j|j|j|jd}|| d|j|j|j|jdiS )N)topic_partitionproducer_idproducer_epochcoordinator_epochaborted)topic	partitionr   r   )r   r   r   r   r   r   r   abort_transaction)r   clientargsspecr   r   r   command   s   

zAbortTransaction.commandN)__name__
__module____qualname__COMMANDHELPclassmethodr   r   r   r   r   r   r      s    
r   N)kafka.adminr   kafka.structsr   r   r   r   r   r   <module>   s    