@Test(expected = IllegalStateException.class) public void shouldThrowOnAbortIfTransactionsNotInitialized() { producer.abortTransaction(); }
@Override public void abortTransaction() throws ProducerFencedException { verifyProducerState(); verifyTransactionsInitialized(); verifyNoTransactionInFlight(); flush(); this.uncommittedSends.clear(); this.uncommittedConsumerGroupOffsets.clear(); this.transactionCommitted = false; this.transactionAborted = true; this.transactionInFlight = false; }
MockProducer implements Producer<K, V> { @Override public void abortTransaction() throws ProducerFencedException { verifyProducerState(); verifyTransactionsInitialized(); verifyNoTransactionInFlight(); flush(); this.uncommittedSends.clear(); this.uncommittedConsumerGroupOffsets.clear(); this.transactionCommitted = false; this.transactionAborted = true; this.transactionInFlight = false; } }
MockProducer implements Producer<K, V> { @Override public void abortTransaction() throws ProducerFencedException { verifyProducerState(); verifyTransactionsInitialized(); verifyNoTransactionInFlight(); flush(); this.uncommittedSends.clear(); this.uncommittedConsumerGroupOffsets.clear(); this.transactionCommitted = false; this.transactionAborted = true; this.transactionInFlight = false; } MockProducer(final Cluster cluster,
                        final boolean autoComplete,
                        final Partitioner partitioner,
                        final Serializer<K> keySerializer,
                        final Serializer<V> valueSerializer);  MockProducer(final boolean autoComplete,
                        final Serializer<K> keySerializer,
                        final Serializer<V> valueSerializer);  MockProducer(final boolean autoComplete,
                        final Partitioner partitioner,
                        final Serializer<K> keySerializer,
                        final Serializer<V> valueSerializer);  MockProducer(); }
MockProducer implements Producer<K, V> { @Override public void abortTransaction() throws ProducerFencedException { verifyProducerState(); verifyTransactionsInitialized(); verifyNoTransactionInFlight(); flush(); this.uncommittedSends.clear(); this.uncommittedConsumerGroupOffsets.clear(); this.transactionCommitted = false; this.transactionAborted = true; this.transactionInFlight = false; } MockProducer(final Cluster cluster,
                        final boolean autoComplete,
                        final Partitioner partitioner,
                        final Serializer<K> keySerializer,
                        final Serializer<V> valueSerializer);  MockProducer(final boolean autoComplete,
                        final Serializer<K> keySerializer,
                        final Serializer<V> valueSerializer);  MockProducer(final boolean autoComplete,
                        final Partitioner partitioner,
                        final Serializer<K> keySerializer,
                        final Serializer<V> valueSerializer);  MockProducer(); @Override void initTransactions(); @Override void beginTransaction(); @Override void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets,
                                         String consumerGroupId); @Override void commitTransaction(); @Override void abortTransaction(); @Override synchronized Future<RecordMetadata> send(ProducerRecord<K, V> record); @Override synchronized Future<RecordMetadata> send(ProducerRecord<K, V> record, Callback callback); synchronized void flush(); List<PartitionInfo> partitionsFor(String topic); Map<MetricName, Metric> metrics(); @Override void close(); @Override void close(long timeout, TimeUnit timeUnit); boolean closed(); void fenceProducer(); boolean transactionInitialized(); boolean transactionInFlight(); boolean transactionCommitted(); boolean transactionAborted(); boolean flushed(); boolean sentOffsets(); long commitCount(); synchronized List<ProducerRecord<K, V>> history(); synchronized List<Map<String, Map<TopicPartition, OffsetAndMetadata>>> consumerGroupOffsetsHistory(); synchronized void clear(); synchronized boolean completeNext(); synchronized boolean errorNext(RuntimeException e); }
MockProducer implements Producer<K, V> { @Override public void abortTransaction() throws ProducerFencedException { verifyProducerState(); verifyTransactionsInitialized(); verifyNoTransactionInFlight(); flush(); this.uncommittedSends.clear(); this.uncommittedConsumerGroupOffsets.clear(); this.transactionCommitted = false; this.transactionAborted = true; this.transactionInFlight = false; } MockProducer(final Cluster cluster,
                        final boolean autoComplete,
                        final Partitioner partitioner,
                        final Serializer<K> keySerializer,
                        final Serializer<V> valueSerializer);  MockProducer(final boolean autoComplete,
                        final Serializer<K> keySerializer,
                        final Serializer<V> valueSerializer);  MockProducer(final boolean autoComplete,
                        final Partitioner partitioner,
                        final Serializer<K> keySerializer,
                        final Serializer<V> valueSerializer);  MockProducer(); @Override void initTransactions(); @Override void beginTransaction(); @Override void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets,
                                         String consumerGroupId); @Override void commitTransaction(); @Override void abortTransaction(); @Override synchronized Future<RecordMetadata> send(ProducerRecord<K, V> record); @Override synchronized Future<RecordMetadata> send(ProducerRecord<K, V> record, Callback callback); synchronized void flush(); List<PartitionInfo> partitionsFor(String topic); Map<MetricName, Metric> metrics(); @Override void close(); @Override void close(long timeout, TimeUnit timeUnit); boolean closed(); void fenceProducer(); boolean transactionInitialized(); boolean transactionInFlight(); boolean transactionCommitted(); boolean transactionAborted(); boolean flushed(); boolean sentOffsets(); long commitCount(); synchronized List<ProducerRecord<K, V>> history(); synchronized List<Map<String, Map<TopicPartition, OffsetAndMetadata>>> consumerGroupOffsetsHistory(); synchronized void clear(); synchronized boolean completeNext(); synchronized boolean errorNext(RuntimeException e);  }