Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

Status

Current stateUnder Discussion

Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]

JIRA: KAFKA-7402

Motivation

Quoting John John Roesler:

...

An object that may hold resources (such as file or socket handles) until it is closed. The {@link #close()} method of an {@code AutoCloseable} object is called automatically when exiting a {@code try}-with-resources block for which the object has been declared in the resource specification header. This construction ensures prompt release, avoiding resource exhaustion exceptions and errors that may otherwise occur.

Public Interfaces

By going over the project, here is a list that I found which can implement AutoCloseable. Suggestions are welcome.

...

  1. org.apache.kafka.connect.runtime.WorkerConnector
  2. org.apache.kafka.common.record.MemoryRecordsBuilder
  3. org.apache.kafka.common.metrics.MetricsReporter
  4. org.apache.kafka.common.security.oauthbearer.internals.expiring.ExpiringCredentialRefreshingLogin
  5. org.apache.kafka.common.network.KafkaChannel
  6. org.apache.kafka.clients.consumer.ConsumerInterceptor
  7. org.apache.kafka.common.network.Selector.SelectorMetrics
  8. org.apache.kafka.clients.consumer.internals.AbstractCoordinator.HeartbeatThread

Proposed Changes

Here are some examples for the proposed changes:

...

For Chia-ping's list, the changes are very similar ( ...implements AutoCloseable). Specific changes can be added to this KIP if requested by reviewers.

Compatibility, Deprecation, and Migration Plan

  • N/A