class_docstr: This class maintains a dequeue per TopicPartition that accumulates messages
  into MessageSets to be sent to the server.
  
  The accumulator attempts to bound memory use, and append calls will block
  when that memory is exhausted.
  
  Keyword Arguments:
      batch_size (int): Requests sent to brokers will contain multiple
          batches, one for each partition with data available to be sent.
          A small batch size will make batching less common and may reduce
          throughput (a batch size of zero will disable batching entirely).
          Default: 16384
      buffer_memory (int): The total bytes of memory the producer should use
          to buffer records waiting to be sent to the server. If records are
          sent faster than they can be delivered to the server the producer
          will block up to max_block_ms, raising an exception on timeout.
          In the current implementation, this setting is an approximation.
          Default: 33554432 (32MB)
      compression_attrs (int): The compression type for all data generated by
          the producer. Valid values are gzip(1), snappy(2), lz4(3), or
          none(0).
          Compression is of full batches of data, so the efficacy of batching
          will also impact the compression ratio (more batching means better
          compression). Default: None.
      linger_ms (int): An artificial delay time to add before declaring a
          messageset (that isn't full) ready for sending. This allows
          time for more records to arrive. Setting a non-zero linger_ms
          will trade off some latency for potentially better throughput
          due to more batching (and hence fewer, larger requests).
          Default: 0
      retry_backoff_ms (int): An artificial delay time to retry the
          produce request upon receiving an error. This avoids exhausting
          all retries in a short period of time. Default: 100
class_docstr_tok: ["This","class","maintains","a","dequeue","per","TopicPartition","that","accumulates","messages","into","MessageSets","to","be","sent","to","the","server",".","The","accumulator","attempts","to","bound","memory","use",",","and","append","calls","will","block","when","that","memory","is","exhausted",".","Keyword","Arguments",":","batch_size","(","int",")",":","Requests","sent","to","brokers","will","contain","multiple","batches",",","one","for","each","partition","with","data","available","to","be","sent",".","A","small","batch","size","will","make","batching","less","common","and","may","reduce","throughput","(","a","batch","size","of","zero","will","disable","batching","entirely",")",".","Default",":","16384","buffer_memory","(","int",")",":","The","total","bytes","of","memory","the","producer","should","use","to","buffer","records","waiting","to","be","sent","to","the","server",".","If","records","are","sent","faster","than","they","can","be","delivered","to","the","server","the","producer","will","block","up","to","max_block_ms",",","raising","an","exception","on","timeout",".","In","the","current","implementation",",","this","setting","is","an","approximation",".","Default",":","33554432","(","32MB",")","compression_attrs","(","int",")",":","The","compression","type","for","all","data","generated","by","the","producer",".","Valid","values","are","gzip","(","1",")",",","snappy","(","2",")",",","lz4","(","3",")",",","or","none","(","0",")",".","Compression","is","of","full","batches","of","data",",","so","the","efficacy","of","batching","will","also","impact","the","compression","ratio","(","more","batching","means","better","compression",")",".","Default",":","None",".","linger_ms","(","int",")",":","An","artificial","delay","time","to","add","before","declaring","a","messageset","(","that","is","n't","full",")","ready","for","sending",".","This","allows","time","for","more","records","to","arrive",".","Setting","a","non-zero","linger_ms","will","trade","off","some","latency","for","potentially","better","throughput","due","to","more","batching","(","and","hence","fewer",",","larger","requests",")",".","Default",":","0","retry_backoff_ms","(","int",")",":","An","artificial","delay","time","to","retry","the","produce","request","upon","receiving","an","error",".","This","avoids","exhausting","all","retries","in","a","short","period","of","time",".","Default",":","100"]
docstr: Go through incomplete batches and abort them.
docstr_tok: ["Go","through","incomplete","batches","and","abort","them","."]
code: def _abort_batches(self):
      """Go through incomplete batches and abort them."""
      error = Errors.IllegalStateError("Producer is closed forcefully.")
      for batch in self._incomplete.all():
          tp = batch.topic_partition
          # Close the batch before aborting
          with self._tp_locks[tp]:
              batch.records.close()
          batch.done(exception=error)
          self.deallocate(batch)
  
imports: from __future__ import absolute_import
  import collections
  import copy
  import logging
  import threading
  import time
  import kafka.errors
  from kafka.producer.buffer import SimpleBufferPool
  from kafka.producer.future import FutureRecordMetadata, FutureProduceResult
  from kafka.record.memory_records import MemoryRecordsBuilder
  from kafka.structs import TopicPartition
label_desc: Use image node_id 13 for calling the RecordAccumulator obj's underlying member method code with example usage: obj._abort_batches() without return types