Table of Contents |
---|
Status
Current state: Under 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.
...
- org.apache.kafka.connect.runtime.WorkerConnector
- org.apache.kafka.common.record.MemoryRecordsBuilder
- org.apache.kafka.common.metrics.MetricsReporter
- org.apache.kafka.common.security.oauthbearer.internals.expiring.ExpiringCredentialRefreshingLogin
- org.apache.kafka.common.network.KafkaChannel
- org.apache.kafka.clients.consumer.ConsumerInterceptor
- org.apache.kafka.common.network.Selector.SelectorMetrics
- 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